public abstract class AbstractXMLObject extends Object implements XMLObject
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractXMLObject(String namespaceURI,
String elementLocalName,
String namespacePrefix)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamespace(Namespace namespace)
Adds a namespace to the ones already scoped to this element.
|
void |
detach()
Detaches the XMLObject from its parent.
|
Element |
getDOM()
Gets the DOM representation of this XMLObject, if one exists.
|
QName |
getElementQName()
Gets the QName for this element.
|
IDIndex |
getIDIndex()
Get the IDIndex holding the ID-to-XMLObject index mapping, rooted at this XMLObject's subtree.
|
Set<Namespace> |
getNamespaces()
Gets the namespaces that are scoped to this element.
|
String |
getNoNamespaceSchemaLocation()
Gets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.
|
XMLObject |
getParent()
Gets the parent of this element.
|
String |
getSchemaLocation()
Gets the value of the XML Schema schemaLocation attribute for this object.
|
QName |
getSchemaType()
Gets the XML schema type of this element.
|
boolean |
hasChildren()
Checks if this XMLObject has children.
|
boolean |
hasParent()
Checks to see if this object has a parent.
|
protected QName |
prepareForAssignment(QName oldValue,
QName newValue)
A helper function for derived classes.
|
protected String |
prepareForAssignment(String oldValue,
String newValue)
A helper function for derived classes.
|
protected <T> T |
prepareForAssignment(T oldValue,
T newValue)
A helper function for derived classes that checks to see if the old and new value are equal and if so releases
the cached dom.
|
protected <T extends XMLObject> |
prepareForAssignment(T oldValue,
T newValue)
A helper function for derived classes, similar to assignString, but for (singleton) SAML objects.
|
protected void |
registerOwnID(String oldID,
String newID)
A helper function for derived classes.
|
void |
releaseChildrenDOM(boolean propagateRelease)
Releases the DOM representation of this XMLObject's children.
|
void |
releaseDOM()
Releases the DOM representation of this XMLObject, if there is one.
|
void |
releaseParentDOM(boolean propagateRelease)
Releases the DOM representation of this XMLObject's parent.
|
void |
releaseThisAndChildrenDOM()
A convience method that is equal to calling
releaseDOM() then releaseChildrenDOM(boolean) with
the release being propogated. |
void |
releaseThisandParentDOM()
A convience method that is equal to calling
releaseDOM() then releaseParentDOM(boolean) with
the release being propogated. |
void |
removeNamespace(Namespace namespace)
Removes a namespace from this element.
|
XMLObject |
resolveID(String id)
Find the XMLObject which is identified by the specified ID attribute, within the subtree of XMLObjects which has
this XMLObject as its root.
|
XMLObject |
resolveIDFromRoot(String id)
Find the XMLObject which is identified by the specified ID attribute, from the root of the tree of XMLObjects in
which this XMLObject is a member.
|
void |
setDOM(Element newDom)
Sets the DOM representation of this XMLObject.
|
void |
setElementNamespacePrefix(String prefix)
Sets the prefix for this element's namespace.
|
protected void |
setElementQName(QName elementQName)
Sets the element QName.
|
void |
setNoNamespaceSchemaLocation(String location)
Sets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.
|
void |
setParent(XMLObject newParent)
Sets the parent of this element.
|
void |
setSchemaLocation(String location)
Sets the value of the XML Schema schemaLocation attribute for this object.
|
protected void |
setSchemaType(QName type)
Sets a given QName as the schema type for the Element represented by this XMLObject.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetOrderedChildrenprotected AbstractXMLObject(String namespaceURI, String elementLocalName, String namespacePrefix)
namespaceURI - the namespace the element is inelementLocalName - the local name of the XML element this Object representsnamespacePrefix - the prefix for the given namespacepublic void addNamespace(Namespace namespace)
addNamespace in interface XMLObjectnamespace - the namespace to addpublic void detach()
public Element getDOM()
public QName getElementQName()
getElementQName in interface XMLObjectpublic IDIndex getIDIndex()
getIDIndex in interface XMLObjectpublic Set<Namespace> getNamespaces()
getNamespaces in interface XMLObjectpublic String getNoNamespaceSchemaLocation()
getNoNamespaceSchemaLocation in interface XMLObjectpublic XMLObject getParent()
public String getSchemaLocation()
getSchemaLocation in interface XMLObjectpublic QName getSchemaType()
getSchemaType in interface XMLObjectpublic boolean hasChildren()
hasChildren in interface XMLObjectpublic boolean hasParent()
protected QName prepareForAssignment(QName oldValue, QName newValue)
oldValue - - the current valuenewValue - - the new valueprotected String prepareForAssignment(String oldValue, String newValue)
oldValue - - the current valuenewValue - - the new valueprotected <T> T prepareForAssignment(T oldValue,
T newValue)
this.foo = prepareForAssignment(this.foo, foo);
This method will do a (null) safe compare of the objects and will also invalidate the DOM if appropriateT - - type of object being compared and assignedoldValue - - current valuenewValue - - proposed new valueprotected <T extends XMLObject> T prepareForAssignment(T oldValue, T newValue)
this.foo = prepareForAssignment(this.foo, foo);
This method will do a (null) safe compare of the objects and will also invalidate the DOM if appropriateT - type of object being compared and assignedoldValue - current valuenewValue - proposed new valueprotected void registerOwnID(String oldID, String newID)
oldID - the old value of the ID-typed attributenewID - the new value of the ID-typed attributepublic void releaseChildrenDOM(boolean propagateRelease)
releaseChildrenDOM in interface XMLObjectpropagateRelease - true if all descendants of this element should release their DOMpublic void releaseDOM()
releaseDOM in interface XMLObjectpublic void releaseParentDOM(boolean propagateRelease)
releaseParentDOM in interface XMLObjectpropagateRelease - true if all ancestors of this element should release their DOMpublic void releaseThisAndChildrenDOM()
releaseDOM() then releaseChildrenDOM(boolean) with
the release being propogated.public void releaseThisandParentDOM()
releaseDOM() then releaseParentDOM(boolean) with
the release being propogated.public void removeNamespace(Namespace namespace)
removeNamespace in interface XMLObjectnamespace - the namespace to removepublic XMLObject resolveID(String id)
public XMLObject resolveIDFromRoot(String id)
resolveIDFromRoot in interface XMLObjectid - the ID attribute to resolve to an XMLObjectpublic void setDOM(Element newDom)
public void setElementNamespacePrefix(String prefix)
prefix - the prefix for this element's namespaceprotected void setElementQName(QName elementQName)
elementQName - the element's QNamepublic void setNoNamespaceSchemaLocation(String location)
setNoNamespaceSchemaLocation in interface XMLObjectlocation - value of the XML Schema noNamespaceSchemaLocation attribute for this objectpublic void setParent(XMLObject newParent)
public void setSchemaLocation(String location)
setSchemaLocation in interface XMLObjectlocation - value of the XML Schema schemaLocation attribute for this objectprotected void setSchemaType(QName type)
type - the schema typeCopyright © 2006-2013 Internet2. All Rights Reserved.