public interface OMSourcedElement extends OMElement
OMDataSource
(or OMDataSourceExt
) interface.
An OMSourcedElement can be in one of two states:
Here are the steps to place an arbitrary java object into the OM tree:
OMDataSourceExt
implementation that provides access to your Java
object.OMFactory.createOMElement(OMDataSource, String, OMNamespace)
to create
the OMSourcedElement.CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
Modifier and Type | Method and Description |
---|---|
OMDataSource |
getDataSource() |
Object |
getObject(Class dataSourceClass)
Get the object that backs the data source set on this element.
|
boolean |
isExpanded() |
OMDataSource |
setDataSource(OMDataSource dataSource)
Replace an existing OMDataSource with a new one.
|
addAttribute, addAttribute, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getAttributeValue, getChildElements, getDefaultNamespace, getFirstElement, getLineNumber, getNamespaceContext, getNamespacesInScope, getText, getTextAsQName, getTextAsStream, removeAttribute, resolveQName, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setBuilder, setLineNumber, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, setText, toString, toStringWithConsume, undeclarePrefix, writeTextTo
buildWithAttachments, detach, discard, getNextOMSibling, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore
addChild, getBuilder, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChildWithName, getFirstOMChild, getSAXSource, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, removeChildren
build, close, isComplete, serialize, serialize, serializeAndConsume
clone, getOMFactory
getLocalName, getNamespace, getNamespaceURI, getPrefix, getQName, setLocalName
boolean isExpanded()
OMDataSource getDataSource()
OMDataSource setDataSource(OMDataSource dataSource)
dataSource
- new OMDataSourceObject getObject(Class dataSourceClass)
OMDataSource
of the type specified by the
dataSourceClass
parameter (in the sense of Class.isInstance(Object)
).
OMDataSourceExt.getObject()
method returns a non null value on the configured
data source.
isExpanded()
returns
false
), but the implementation may use additional mechanisms to detect changes
after expansion of the element.
dataSourceClass
- the expected data source class; must be assignment compatible with
OMDataSourceExt
null
if the conditions specified above are
not satisfiedCopyright © 2004–2018 The Apache Software Foundation. All rights reserved.