Package com.helger.as2lib.util
Class AS2XMLHelper
- java.lang.Object
-
- com.helger.as2lib.util.AS2XMLHelper
-
@Immutable public final class AS2XMLHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends IDynamicComponent>
TcreateComponent(com.helger.xml.microdom.IMicroElement aElement, Class<T> aClass, IAS2Session aSession, String sBaseDirectory)static com.helger.commons.collection.attr.StringMapgetAllAttrsWithLowercaseName(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.StringMapgetAllAttrsWithLowercaseNameWithRequired(com.helger.xml.microdom.IMicroElement aElement, String... aRequiredAttributes)static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String>mapAttributeNodes(com.helger.xml.microdom.IMicroElement aNode, String sNodeName, String sNodeKeyName, String sNodeValueName)
-
-
-
Method Detail
-
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
nullbut 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-
nullMap. - 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
-
-