Package org.opensaml.core.xml.util
Class XMLAttributeSupport
- java.lang.Object
-
- org.opensaml.core.xml.util.XMLAttributeSupport
-
public final class XMLAttributeSupport extends Object
Helper methods for working with global attributes from the XML namespace. These are namely:- xml:id
- xml:lang
- xml:base
- xml:space
-
-
Constructor Summary
Constructors Modifier Constructor Description privateXMLAttributeSupport()Private constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddXMLBase(XMLObject xmlObject, String base)Adds axml:baseattribute to the given XML object.static voidaddXMLId(XMLObject xmlObject, String id)Adds axml:idattribute to the given XML object.static voidaddXMLLang(XMLObject xmlObject, String lang)Adds axml:langattribute to the given XML object.static voidaddXMLSpace(XMLObject xmlObject, SpaceBearing.XMLSpaceEnum space)Adds axml:spaceattribute to the given XML object.static StringgetXMLBase(XMLObject xmlObject)Gets thexml:baseattribute from a given XML object.static StringgetXMLId(XMLObject xmlObject)Gets thexml:idattribute from a given XML object.static StringgetXMLLang(XMLObject xmlObject)Gets thexml:langattribute from a given XML object.static SpaceBearing.XMLSpaceEnumgetXMLSpace(XMLObject xmlObject)Gets thexml:spaceattribute from a given XML object.
-
-
-
Method Detail
-
addXMLId
public static void addXMLId(XMLObject xmlObject, String id)
Adds axml:idattribute to the given XML object.- Parameters:
xmlObject- the XML object to which to add the attributeid- the Id value
-
getXMLId
public static String getXMLId(XMLObject xmlObject)
Gets thexml:idattribute 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 axml:langattribute to the given XML object.- Parameters:
xmlObject- the XML object to which to add the attributelang- the lang value
-
getXMLLang
public static String getXMLLang(XMLObject xmlObject)
Gets thexml:langattribute 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 axml:baseattribute to the given XML object.- Parameters:
xmlObject- the XML object to which to add the attributebase- the base value
-
getXMLBase
public static String getXMLBase(XMLObject xmlObject)
Gets thexml:baseattribute 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 axml:spaceattribute to the given XML object.- Parameters:
xmlObject- the XML object to which to add the attributespace- the space value
-
getXMLSpace
public static SpaceBearing.XMLSpaceEnum getXMLSpace(XMLObject xmlObject)
Gets thexml:spaceattribute 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
-
-