Package com.helger.as2lib.util
Class AS2XMLHelper
java.lang.Object
com.helger.as2lib.util.AS2XMLHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends IDynamicComponent>
TcreateComponent
(com.helger.xml.microdom.IMicroElement aElement, Class<T> aClass, IAS2Session aSession, String sBaseDirectory) static com.helger.commons.collection.attr.StringMap
getAllAttrsWithLowercaseName
(com.helger.xml.microdom.IMicroElement aElement) Get all attributes of the passed element as a map with a lowercase attribute name.static com.helger.commons.collection.attr.StringMap
getAllAttrsWithLowercaseNameWithRequired
(com.helger.xml.microdom.IMicroElement aElement, String... aRequiredAttributes) mapAttributeNodes
(com.helger.xml.microdom.IMicroElement aNode, String sNodeName, String sNodeKeyName, String sNodeValueName)
-
Method Details
-
getAllAttrsWithLowercaseName
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.attr.StringMap getAllAttrsWithLowercaseName(@Nonnull com.helger.xml.microdom.IMicroElement aElement) Get all attributes of the passed element as a map with a lowercase attribute name.- Parameters:
aElement
- The source element to extract the attributes from. May not benull
.- Returns:
- A new map and never
null
but maybe empty.
-
getAllAttrsWithLowercaseNameWithRequired
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.attr.StringMap getAllAttrsWithLowercaseNameWithRequired(@Nonnull com.helger.xml.microdom.IMicroElement aElement, @Nonnull String... aRequiredAttributes) throws AS2Exception - Throws:
AS2Exception
-
mapAttributeNodes
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> mapAttributeNodes(@Nonnull com.helger.xml.microdom.IMicroElement aNode, @Nonnull String sNodeName, @Nonnull String sNodeKeyName, @Nonnull String sNodeValueName) throws AS2Exception - Parameters:
aNode
- Start node. May not benull
.sNodeName
- The element name to be queried relative to the start node.sNodeKeyName
- The attribute name of the key.sNodeValueName
- The attribute name of the value.- Returns:
- The non-
null
Map
. - Throws:
AS2Exception
- In case a node is missing a key or value attribute.
-
createComponent
@Nonnull public static <T extends IDynamicComponent> T createComponent(@Nonnull com.helger.xml.microdom.IMicroElement aElement, @Nonnull Class<T> aClass, @Nonnull IAS2Session aSession, @Nullable String sBaseDirectory) throws AS2Exception - Throws:
AS2Exception
-