com.sun.identity.federation.message.common
Class Extension

java.lang.Object
  extended by com.sun.identity.federation.message.common.Extension

public class Extension
extends Object

The class Extension is used to create , parse Extension object.


Constructor Summary
Extension(Element element)
          Constructor to create Extension object.
Extension(List children)
          Constructor to create Extension object.
Extension(Map avpairs)
          Constructor to create Extension object.
 
Method Summary
 Map getAttributeMap()
           
 List getChildren()
          Returns a list of XML String objects.
 int getMinorVersion()
          Returns the MinorVersion.
static Extension parseURLEncodedRequest(HttpServletRequest request, String prefix, int minorVersion)
          Returns Extension object.
 void setAttributeMap(Map avpairs)
          Converts attribute value pairs to a list of XML String objects.
 void setChildren(List children)
          Sets a list of XML String object.
 void setMinorVersion(int minorVersion)
          Sets the MinorVersion.
 String toURLEncodedQueryString(String prefix)
          Returns an URL Encoded String.
 String toXMLString()
          Returns a String representation of the Extension element.
 String toXMLString(boolean includeNS, boolean declareNS)
          Creates a String representation of the Extension element.
 

Constructor Detail

Extension

public Extension(List children)
          throws FSMsgException
Constructor to create Extension object.

Parameters:
children - a list of XML String object.
Throws:
FSMsgException - on error.

Extension

public Extension(Element element)
          throws FSMsgException
Constructor to create Extension object.

Parameters:
element - the Extension Element object.
Throws:
FSMsgException - on error.

Extension

public Extension(Map avpairs)
          throws FSMsgException
Constructor to create Extension object. Each attribute value pair will be converted to a XML string. The converted XML string has only one element. The local name of the element will be the key of the map entry and the value of the element will be the value of the map entry. Both key and value of the map entry should be a String object.

Parameters:
avpairs - attribute value pairs.
Throws:
FSMsgException - on error.
Method Detail

getChildren

public List getChildren()
Returns a list of XML String objects.

Returns:
a list of XML String objects.
See Also:
Extension.setChildren(List)

setChildren

public void setChildren(List children)
                 throws FSMsgException
Sets a list of XML String object.

Parameters:
children - a list of XML String object.
Throws:
FSMsgException
See Also:
Extension.getChildren()

getAttributeMap

public Map getAttributeMap()

setAttributeMap

public void setAttributeMap(Map avpairs)
                     throws FSMsgException
Converts attribute value pairs to a list of XML String objects. Each attribute value pair will be converted to a XML string. The converted XML string has only one element. The local name of the element will be the key of the map entry and the value of the element will be the value of the map entry. Both key and value of the map entry should be a String object.

Parameters:
avpairs - attribute value pairs.
Throws:
FSMsgException - on error.

getMinorVersion

public int getMinorVersion()
Returns the MinorVersion.

Returns:
the MinorVersion.
See Also:
Extension.setMinorVersion(int)

setMinorVersion

public void setMinorVersion(int minorVersion)
Sets the MinorVersion.

Parameters:
minorVersion - the MinorVersion.
See Also:
Extension.getMinorVersion()

toXMLString

public String toXMLString()
                   throws FSMsgException
Returns a String representation of the Extension element.

Returns:
a string containing the valid XML for this element
Throws:
FSMsgException - if there is an error converting this object to a string.

toXMLString

public String toXMLString(boolean includeNS,
                          boolean declareNS)
                   throws FSMsgException
Creates a String representation of the Extension element.

Parameters:
includeNS - : Determines whether or not the namespace qualifier is prepended to the Element when converted
declareNS - : Determines whether or not the namespace is declared within the Element.
Returns:
string containing the valid XML for this element.
Throws:
FSMsgException - if there is an error.

parseURLEncodedRequest

public static Extension parseURLEncodedRequest(HttpServletRequest request,
                                               String prefix,
                                               int minorVersion)
                                        throws FSMsgException
Returns Extension object. The object is creating by parsing the HttpServletRequest object.

Parameters:
request - the HttpServletRequest object.
prefix - the string that is prepended to the key of query string.
minorVersion - the MinorVersion.
Returns:
object.
Throws:
FSMsgException - if there is an error creating Extension object.

toURLEncodedQueryString

public String toURLEncodedQueryString(String prefix)
                               throws FSMsgException
Returns an URL Encoded String.

Parameters:
prefix - the string that will be prepended to the key of query string.
Returns:
a url encoded query string.
Throws:
FSMsgException - if there is an error.