org.opensaml.xml
Class ElementProxy

java.lang.Object
  extended by org.opensaml.xml.AbstractXMLObject
      extended by org.opensaml.xml.validation.AbstractValidatingXMLObject
          extended by org.opensaml.xml.ElementProxy
All Implemented Interfaces:
AttributeExtensibleXMLObject, ElementExtensibleXMLObject, ValidatingXMLObject, XMLObject

public class ElementProxy
extends AbstractValidatingXMLObject
implements AttributeExtensibleXMLObject, ElementExtensibleXMLObject

An XMLObject that proxies a DOM element. This can be used represent the content of elements that do not have their own XMLObject representation. Generally this would be used as a catch-all mechanism such as when working with XML documents that contain content that may not be known at the time, such as elements defined in XML Schema that contain <any> constructs.


Constructor Summary
protected ElementProxy(java.lang.String namespaceURI, java.lang.String elementLocalName, java.lang.String namespacePrefix)
          Constructor.
 
Method Summary
 java.util.List<XMLObject> getOrderedChildren()
          Gets the list of child XMLObjects in insertion order.
 java.lang.String getTextContent()
          Gets the text content for the proxied DOM Element.
 AttributeMap getUnknownAttributes()
          Gets a mutable map of the attributes.
 java.util.List<XMLObject> getUnknownXMLObjects()
          Gets the list of XMLObjects added to this XMLObject as part of the "any" content model.
 void setElementQName(java.lang.String namespaceURI, java.lang.String elementLocalName, java.lang.String namespacePrefix)
          Sets the name of the element this XMLObject is proxying.
 void setTextContent(java.lang.String newContent)
          Sets the text content for the proxied DOM Element.
 
Methods inherited from class org.opensaml.xml.validation.AbstractValidatingXMLObject
deregisterValidator, getValidators, registerValidator, validate, validateChildren
 
Methods inherited from class org.opensaml.xml.AbstractXMLObject
addNamespace, getDOM, getElementQName, getIDIndex, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, prepareForAssignment, prepareForAssignment, prepareForAssignment, prepareForAssignment, registerOwnID, releaseChildrenDOM, releaseDOM, releaseParentDOM, releaseThisAndChildrenDOM, releaseThisandParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setElementNamespacePrefix, setElementQName, setNoNamespaceSchemaLocation, setParent, setSchemaLocation, setSchemaType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.xml.XMLObject
addNamespace, getDOM, getElementQName, getIDIndex, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, releaseChildrenDOM, releaseDOM, releaseParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setNoNamespaceSchemaLocation, setParent, setSchemaLocation
 
Methods inherited from interface org.opensaml.xml.XMLObject
addNamespace, getDOM, getElementQName, getIDIndex, getNamespaces, getNoNamespaceSchemaLocation, getParent, getSchemaLocation, getSchemaType, hasChildren, hasParent, releaseChildrenDOM, releaseDOM, releaseParentDOM, removeNamespace, resolveID, resolveIDFromRoot, setDOM, setNoNamespaceSchemaLocation, setParent, setSchemaLocation
 

Constructor Detail

ElementProxy

protected ElementProxy(java.lang.String namespaceURI,
                       java.lang.String elementLocalName,
                       java.lang.String namespacePrefix)
Constructor.

Parameters:
namespaceURI - the namespace the proxied element is in
elementLocalName - the local name of the proxied element
namespacePrefix - the prefix for the given namespace
Method Detail

setElementQName

public void setElementQName(java.lang.String namespaceURI,
                            java.lang.String elementLocalName,
                            java.lang.String namespacePrefix)
Sets the name of the element this XMLObject is proxying. This MUST must be set before marshalling can occur and would ideally be set immediately after it's built.

Parameters:
namespaceURI - the namespace the proxied element is in
elementLocalName - the local name of the proxied element
namespacePrefix - the prefix for the given namespace

getTextContent

public java.lang.String getTextContent()
Gets the text content for the proxied DOM Element.

Returns:
the text content for the proxied DOM Element

setTextContent

public void setTextContent(java.lang.String newContent)
Sets the text content for the proxied DOM Element.

Parameters:
newContent - the text content for the proxied DOM Element

getUnknownAttributes

public AttributeMap getUnknownAttributes()
Gets a mutable map of the attributes. The map key is the namespace qualified name of the attribute, the map value is the value of the attribute.

Specified by:
getUnknownAttributes in interface AttributeExtensibleXMLObject
Returns:
a map of the attributes

getUnknownXMLObjects

public java.util.List<XMLObject> getUnknownXMLObjects()
Gets the list of XMLObjects added to this XMLObject as part of the "any" content model.

Specified by:
getUnknownXMLObjects in interface ElementExtensibleXMLObject
Returns:
list of XMLObjects added to this XMLObject as part of the "any" content model

getOrderedChildren

public java.util.List<XMLObject> getOrderedChildren()
Gets the list of child XMLObjects in insertion order.

Specified by:
getOrderedChildren in interface XMLObject
Returns:
the list of child XMLObjects in insertion order