Class XMLAttributeSupport


  • public final class XMLAttributeSupport
    extends Object
    Helper methods for working with global attributes from the XML namespace. These are namely:
    1. xml:id
    2. xml:lang
    3. xml:base
    4. xml:space
    • Constructor Detail

      • XMLAttributeSupport

        private XMLAttributeSupport()
        Private constructor.
    • Method Detail

      • addXMLId

        public static void addXMLId​(XMLObject xmlObject,
                                    String id)
        Adds a xml:id attribute to the given XML object.
        Parameters:
        xmlObject - the XML object to which to add the attribute
        id - the Id value
      • getXMLId

        public static String getXMLId​(XMLObject xmlObject)
        Gets the xml:id attribute from a given XML object.
        Parameters:
        xmlObject - the XML object from which to extract the attribute
        Returns:
        the value of the xml:id attribute, or null if not present
      • addXMLLang

        public static void addXMLLang​(XMLObject xmlObject,
                                      String lang)
        Adds a xml:lang attribute to the given XML object.
        Parameters:
        xmlObject - the XML object to which to add the attribute
        lang - the lang value
      • getXMLLang

        public static String getXMLLang​(XMLObject xmlObject)
        Gets the xml:lang attribute from a given XML object.
        Parameters:
        xmlObject - the XML object from which to extract the attribute
        Returns:
        the value of the xml:lang attribute, or null if not present
      • addXMLBase

        public static void addXMLBase​(XMLObject xmlObject,
                                      String base)
        Adds a xml:base attribute to the given XML object.
        Parameters:
        xmlObject - the XML object to which to add the attribute
        base - the base value
      • getXMLBase

        public static String getXMLBase​(XMLObject xmlObject)
        Gets the xml:base attribute from a given XML object.
        Parameters:
        xmlObject - the XML object from which to extract the attribute
        Returns:
        the value of the xml:base attribute, or null if not present
      • addXMLSpace

        public static void addXMLSpace​(XMLObject xmlObject,
                                       SpaceBearing.XMLSpaceEnum space)
        Adds a xml:space attribute to the given XML object.
        Parameters:
        xmlObject - the XML object to which to add the attribute
        space - the space value
      • getXMLSpace

        public static SpaceBearing.XMLSpaceEnum getXMLSpace​(XMLObject xmlObject)
        Gets the xml:space attribute from a given XML object.
        Parameters:
        xmlObject - the XML object from which to extract the attribute
        Returns:
        the value of the xml:space attribute, or null if not present