Class AttributesUtil


  • public class AttributesUtil
    extends Object
    • Constructor Detail

      • AttributesUtil

        public AttributesUtil()
    • Method Detail

      • getAttributesXml

        public static String getAttributesXml​(Map<String,​Map<String,​String>> attributesMap)

        Serialize an attributes group map to XML.

        The information will be encapsulated in the default tag: XML_TAG.

        If a null or empty Map is given, the generated XML will have the default tag (with no content).

        Equivalent to:

          getAttributesXml( attributesMap, AttributesUtil.XML_TAG )
        Parameters:
        attributesMap - the attribute groups to serialize
        Returns:
        the XML serialized attribute groups
        See Also:
        getAttributesXml(Map, String)
      • getAttributesXml

        public static String getAttributesXml​(Map<String,​Map<String,​String>> attributesMap,
                                              String xmlTag)

        Serialize an attributes group map to XML.

        The information will be encapsulated in the specified tag.

        If a null or empty Map is given, the generated XML will have the provided tag (with no content).

        Parameters:
        attributesMap - the attribute groups to serialize
        xmlTag - the xml tag to use for the generated xml
        Returns:
        the XML serialized attribute groups
        See Also:
        getAttributesXml(Map)
      • loadAttributes

        public static Map<String,​Map<String,​String>> loadAttributes​(Node attributesNode)

        Load the attribute groups from an XML DOM Node.

        An empty Map will be returned if a null or empty Node is given.

        Parameters:
        attributesNode - the attributes node to read from
        Returns:
        the Map with the attribute groups