org.opensaml.xml.util
Class XMLAttributeHelper

java.lang.Object
  extended by org.opensaml.xml.util.XMLAttributeHelper

public final class XMLAttributeHelper
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 Summary
private XMLAttributeHelper()
          Private constructor.
 
Method Summary
static void addXMLBase(XMLObject xmlObject, String base)
          Adds a xml:base attribute to the given XML object.
static void addXMLId(XMLObject xmlObject, String id)
          Adds a xml:id attribute to the given XML object.
static void addXMLLang(XMLObject xmlObject, String lang)
          Adds a xml:lang attribute to the given XML object.
static void addXMLSpace(XMLObject xmlObject, SpaceBearing.XMLSpaceEnum space)
          Adds a xml:space attribute to the given XML object.
static String getXMLBase(XMLObject xmlObject)
          Gets the xml:base attribute from a given XML object.
static String getXMLId(XMLObject xmlObject)
          Gets the xml:id attribute from a given XML object.
static String getXMLLang(XMLObject xmlObject)
          Gets the xml:lang attribute from a given XML object.
static SpaceBearing.XMLSpaceEnum getXMLSpace(XMLObject xmlObject)
          Gets the xml:space attribute from a given XML object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLAttributeHelper

private XMLAttributeHelper()
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


Copyright © 1999-2013. All Rights Reserved.