Class AbstractXSAnyAdapter
- All Implemented Interfaces:
XMLObject,XSAnyAdapter
- Direct Known Subclasses:
BaseIDXSAnyAdapter,ConditionXSAnyAdapter,RoleDescriptorXSAnyAdapter,StatementXSAnyAdapter
XSAny.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddetach()Detaches the XMLObject from its parent.Gets the DOM representation of this XMLObject, if one exists, or raises aConstraintViolationException.Get the adaptedXSAnyinstance.getDOM()Gets the DOM representation of this XMLObject, if one exists.Gets the QName for this element.Get the IDIndex holding the ID-to-XMLObject index mapping, rooted at this XMLObject's subtree.Gets theNamespaceManagerinstance for this object.Gets the namespaces that are scoped to this element.Gets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.Get the mutable multimap which holds additional information (represented by plain Java object instances) associated with this XMLObject.Gets an unmodifiable list of child elements in the order that they will appear in the DOM.Gets the parent of this element or null if there is no parent.Gets the value of the XML Schema schemaLocation attribute for this object.Gets the XML schema type of this element.booleanChecks if this XMLObject has children.booleanChecks to see if this object has a parent.isNil()Gets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.Gets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.voidreleaseChildrenDOM(boolean propagateRelease) Releases the DOM representation of this XMLObject's children.voidReleases the DOM representation of this XMLObject, if there is one.voidreleaseParentDOM(boolean propagateRelease) Releases the DOM representation of this XMLObject's parent.Find the XMLObject identified by the specified ID attribute, within the subtree of XMLObjects which has this XMLObject as its root.Find the XMLObject identified by the specified ID attribute, from the root of the tree of XMLObjects in which this XMLObject is a member.voidSets the DOM representation of this XMLObject.voidSets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.voidsetNil(XSBooleanValue newNil) Sets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.voidsetNoNamespaceSchemaLocation(String location) Sets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.voidSets the parent of this element.voidsetSchemaLocation(String location) Sets the value of the XML Schema schemaLocation attribute for this object.
-
Field Details
-
adapted
The adapted XSAny instance.
-
-
Constructor Details
-
AbstractXSAnyAdapter
Constructor.- Parameters:
xsAny- the adapted XSAny instance
-
-
Method Details
-
getAdapted
Get the adaptedXSAnyinstance.- Specified by:
getAdaptedin interfaceXSAnyAdapter- Returns:
- the adapted XSAny
-
detach
public void detach()Detaches the XMLObject from its parent. This will release the parent's cached DOM (if it has one) and set this object's parent to null. It does not remove this object from its parent, that's the responsibility of the invoker of this method, nor does it re-root the cached DOM node (if there is one) in a new document. This is handled at marshalling time. -
getDOM
Gets the DOM representation of this XMLObject, if one exists. -
ensureDOM
Gets the DOM representation of this XMLObject, if one exists, or raises aConstraintViolationException. -
getElementQName
Gets the QName for this element. This QName MUST contain the namespace URI, namespace prefix, and local element name.- Specified by:
getElementQNamein interfaceXMLObject- Returns:
- the QName for this attribute
-
getIDIndex
Get the IDIndex holding the ID-to-XMLObject index mapping, rooted at this XMLObject's subtree.- Specified by:
getIDIndexin interfaceXMLObject- Returns:
- the IDIndex owned by this XMLObject
-
getNamespaceManager
Gets theNamespaceManagerinstance for this object.- Specified by:
getNamespaceManagerin interfaceXMLObject- Returns:
- the namespace manager for this object
-
getNamespaces
Gets the namespaces that are scoped to this element.- Specified by:
getNamespacesin interfaceXMLObject- Returns:
- the namespaces that are scoped to this element
-
getNoNamespaceSchemaLocation
Gets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.- Specified by:
getNoNamespaceSchemaLocationin interfaceXMLObject- Returns:
- value of the XML Schema noNamespaceSchemaLocation attribute for this object
-
getOrderedChildren
Gets an unmodifiable list of child elements in the order that they will appear in the DOM.- Specified by:
getOrderedChildrenin interfaceXMLObject- Returns:
- ordered list of child elements
-
getParent
Gets the parent of this element or null if there is no parent. -
getSchemaLocation
Gets the value of the XML Schema schemaLocation attribute for this object.- Specified by:
getSchemaLocationin interfaceXMLObject- Returns:
- schema location defined for this object
-
getSchemaType
Gets the XML schema type of this element. This translates to the contents of the xsi:type attribute.- Specified by:
getSchemaTypein interfaceXMLObject- Returns:
- XML schema type of this element, or null
-
hasChildren
public boolean hasChildren()Checks if this XMLObject has children.- Specified by:
hasChildrenin interfaceXMLObject- Returns:
- true if this XMLObject has children, false if not
-
hasParent
public boolean hasParent()Checks to see if this object has a parent. -
releaseChildrenDOM
public void releaseChildrenDOM(boolean propagateRelease) Releases the DOM representation of this XMLObject's children.- Specified by:
releaseChildrenDOMin interfaceXMLObject- Parameters:
propagateRelease- true if all descendants of this element should release their DOM
-
releaseDOM
public void releaseDOM()Releases the DOM representation of this XMLObject, if there is one.- Specified by:
releaseDOMin interfaceXMLObject
-
releaseParentDOM
public void releaseParentDOM(boolean propagateRelease) Releases the DOM representation of this XMLObject's parent.- Specified by:
releaseParentDOMin interfaceXMLObject- Parameters:
propagateRelease- true if all ancestors of this element should release their DOM
-
resolveID
Find the XMLObject identified by the specified ID attribute, within the subtree of XMLObjects which has this XMLObject as its root. -
resolveIDFromRoot
Find the XMLObject identified by the specified ID attribute, from the root of the tree of XMLObjects in which this XMLObject is a member.- Specified by:
resolveIDFromRootin interfaceXMLObject- Parameters:
id- the ID attribute to resolve to an XMLObject- Returns:
- the XMLObject identified by the specified ID attribute value, or null
-
setDOM
Sets the DOM representation of this XMLObject. -
setNoNamespaceSchemaLocation
Sets the value of the XML Schema noNamespaceSchemaLocation attribute for this object.- Specified by:
setNoNamespaceSchemaLocationin interfaceXMLObject- Parameters:
location- value of the XML Schema noNamespaceSchemaLocation attribute for this object
-
setParent
Sets the parent of this element. -
setSchemaLocation
Sets the value of the XML Schema schemaLocation attribute for this object.- Specified by:
setSchemaLocationin interfaceXMLObject- Parameters:
location- value of the XML Schema schemaLocation attribute for this object
-
isNil
Gets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.Note that it is up to the developer to ensure that the value of this attribute is consistent with the actual element content on the object instance.
Per the XML Schema specification, a value of true disallows element content, but not element attributes.
-
isNilXSBoolean
Gets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.Note that it is up to the developer to ensure that the value of this attribute is consistent with the actual element content on the object instance.
Per the XML Schema specification, a value of true disallows element content, but not element attributes.
- Specified by:
isNilXSBooleanin interfaceXMLObject- Returns:
- whether the object's content model is null
- See Also:
-
setNil
Sets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.Note that it is up to the developer to ensure that the value of this attribute is consistent with the actual element content on the object instance.
Per the XML Schema specification, a value of true disallows element content, but not element attributes.
-
setNil
Sets whether the object declares that its element content is null, which corresponds to anxsi:nilattribute oftrue.Note that it is up to the developer to ensure that the value of this attribute is consistent with the actual element content on the object instance.
Per the XML Schema specification, a value of true disallows element content, but not element attributes.
-
getObjectMetadata
Get the mutable multimap which holds additional information (represented by plain Java object instances) associated with this XMLObject.Objects added to this multimap will be indexed and retrievable by their concrete
Classas well as by theClasstypes representing all superclasses (excludingjava.lang.Object) and all implemented interfaces.- Specified by:
getObjectMetadatain interfaceXMLObject- Returns:
- the class-to-instance multimap
-