public class OMSourcedElementImpl extends OMElementImpl implements org.apache.axiom.om.OMSourcedElement
Element backed by an arbitrary data source. When necessary, this element will be expanded by creating a parser from the data source.
Whenever methods are added to the base OMElementImpl
class the corresponding methods must be added to this class (there's a unit test to verify that
this has been done, just to make sure nothing gets accidentally broken). If the method only
requires the element name and/or namespace information, the base class method can be called
directly. Otherwise, the element must be expanded into a full OM tree (by calling the forceExpand() method) before the base class method is called. This will typically involve a
heavy overhead penalty, so should be avoided if possible.
attributes, namespacesCDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODECOMPLETE, DISCARDED, INCOMPLETEARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI| Constructor and Description |
|---|
OMSourcedElementImpl(org.apache.axiom.om.OMContainer parent,
String localName,
org.apache.axiom.om.OMNamespace ns,
org.apache.axiom.om.OMXMLParserWrapper builder,
org.apache.axiom.om.OMFactory factory,
boolean generateNSDecl) |
OMSourcedElementImpl(org.apache.axiom.om.OMFactory factory,
org.apache.axiom.om.OMDataSource source) |
OMSourcedElementImpl(QName qName,
org.apache.axiom.om.OMFactory factory,
org.apache.axiom.om.OMDataSource source)
Constructor that takes a QName instead of the local name and the namespace seperately
|
OMSourcedElementImpl(String localName,
org.apache.axiom.om.OMNamespace ns,
org.apache.axiom.om.OMContainer parent,
org.apache.axiom.om.OMFactory factory) |
OMSourcedElementImpl(String localName,
org.apache.axiom.om.OMNamespace ns,
org.apache.axiom.om.OMFactory factory,
org.apache.axiom.om.OMDataSource source)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.axiom.om.OMAttribute |
addAttribute(org.apache.axiom.om.OMAttribute attr)
Inserts an attribute to this element.
|
org.apache.axiom.om.OMAttribute |
addAttribute(String attributeName,
String value,
org.apache.axiom.om.OMNamespace namespace) |
void |
addNamespaceDeclaration(org.apache.axiom.om.OMNamespace ns) |
org.apache.axiom.om.OMNamespace |
addNamespaceDeclaration(String uri,
String prefix) |
void |
build() |
void |
buildWithAttachments() |
org.apache.axiom.om.OMInformationItem |
clone(org.apache.axiom.om.OMCloneOptions options) |
org.apache.axiom.om.OMElement |
cloneOMElement() |
org.apache.axiom.core.CoreChildNode |
coreGetFirstChildIfAvailable() |
protected org.apache.axiom.om.OMElement |
createClone(org.apache.axiom.om.OMCloneOptions options,
org.apache.axiom.om.OMContainer targetParent) |
protected org.apache.axiom.om.OMSourcedElement |
createClone(org.apache.axiom.om.OMCloneOptions options,
org.apache.axiom.om.OMDataSource ds) |
org.apache.axiom.om.OMNamespace |
declareDefaultNamespace(String uri) |
org.apache.axiom.om.OMNamespace |
declareNamespace(org.apache.axiom.om.OMNamespace namespace) |
org.apache.axiom.om.OMNamespace |
declareNamespace(String uri,
String prefix) |
org.apache.axiom.om.OMNode |
detach() |
void |
discard() |
org.apache.axiom.om.OMNamespace |
findNamespace(String uri,
String prefix)
Finds a namespace with the given uri and prefix, in the scope of the document.
|
org.apache.axiom.om.OMNamespace |
findNamespaceURI(String prefix) |
void |
forceExpand()
Set parser for OM, if not previously set.
|
Iterator |
getAllAttributes()
Returns a List of OMAttributes.
|
Iterator |
getAllDeclaredNamespaces()
Method getAllDeclaredNamespaces.
|
org.apache.axiom.om.OMAttribute |
getAttribute(QName qname)
Returns a named attribute if present.
|
String |
getAttributeValue(QName qname)
Returns a named attribute's value, if present.
|
org.apache.axiom.om.OMDataSource |
getDataSource()
Provide access to the data source encapsulated in OMSourcedElement.
|
org.apache.axiom.om.OMNamespace |
getDefaultNamespace() |
int |
getLineNumber() |
String |
getLocalName() |
org.apache.axiom.om.OMNamespace |
getNamespace() |
org.apache.axiom.om.OMNode |
getNextOMSibling() |
org.apache.axiom.om.OMNode |
getNextOMSiblingIfAvailable() |
Object |
getObject(Class dataSourceClass) |
QName |
getQName() |
SAXResult |
getSAXResult() |
int |
getState() |
String |
getText() |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader() |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean cache) |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean cache,
org.apache.axiom.om.OMXMLStreamReaderConfiguration configuration) |
javax.xml.stream.XMLStreamReader |
getXMLStreamReaderWithoutCaching() |
boolean |
hasName(QName name) |
void |
internalSerialize(org.apache.axiom.om.impl.common.serializer.push.Serializer serializer,
org.apache.axiom.om.OMOutputFormat format,
boolean cache) |
boolean |
isComplete() |
boolean |
isExpanded()
Check if element has been expanded into tree.
|
void |
removeAttribute(org.apache.axiom.om.OMAttribute attr) |
void |
setComplete(boolean complete)
setComplete override The OMSourcedElement has its own isolated builder/reader during the
expansion process.
|
org.apache.axiom.om.OMDataSource |
setDataSource(org.apache.axiom.om.OMDataSource dataSource)
setOMDataSource
|
void |
setLineNumber(int lineNumber) |
void |
setLocalName(String localName) |
void |
setNamespace(org.apache.axiom.om.OMNamespace namespace) |
void |
setNamespace(org.apache.axiom.om.OMNamespace namespace,
boolean declare) |
void |
setNamespaceWithNoFindInCurrentScope(org.apache.axiom.om.OMNamespace namespace) |
String |
toString() |
String |
toStringWithConsume() |
void |
undeclarePrefix(String prefix) |
checkChild, getNamespaceURIcoreSetParentgetOMFactoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildElements, getFirstElement, getNamespaceContext, getNamespacesInScope, getTextAsQName, getTextAsStream, resolveQName, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setText, setText, writeTextTogetParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBeforeaddChild, getBuilder, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChildWithName, getFirstOMChild, getSAXSource, removeChildrenclose, serialize, serialize, serializeAndConsumegetNamespaceURI, getPrefixdetachAndDiscardParent, getChildElements, getFirstElement, getNamespaceContext, getNamespacesInScope, getTextAsQName, getTextAsStream, getType, handleNamespace, insertChild, resolveQName, setText, setText, writeTextToaddChild, addChild, defaultBuild, discarded, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getSAXSource, prepareNewChild, removeChildren, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsumegetParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBeforeclose, getBuilder, serialize, serialize, serializeAndConsumecoreGetNodeFactorygetPrefix, handleNamespace, internalGetLocalName, internalSetLocalName, internalSetNamespacecoreDetach, coreGetNextSibling, coreGetNextSiblingIfAvailable, coreGetParent, coreGetPreviousSibling, coreHasParent, coreInsertSiblingAfter, coreInsertSiblingBefore, coreInsertSiblingsBefore, coreSetNextSibling, coreSetOwnerDocument, coreSetPreviousSibling, internalSetParent, internalUnsetParentpublic OMSourcedElementImpl(org.apache.axiom.om.OMFactory factory,
org.apache.axiom.om.OMDataSource source)
public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)
localName - ns - factory - source - public OMSourcedElementImpl(QName qName, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)
qName - factory - source - public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
public OMSourcedElementImpl(org.apache.axiom.om.OMContainer parent,
String localName,
org.apache.axiom.om.OMNamespace ns,
org.apache.axiom.om.OMXMLParserWrapper builder,
org.apache.axiom.om.OMFactory factory,
boolean generateNSDecl)
public void forceExpand()
forceExpand in interface org.apache.axiom.core.DeferringParentNodepublic boolean isExpanded()
isExpanded in interface org.apache.axiom.om.OMSourcedElementtrue if expanded, false if notpublic org.apache.axiom.om.OMNamespace declareNamespace(String uri, String prefix)
declareNamespace in interface org.apache.axiom.om.OMElementdeclareNamespace in class OMElementImplpublic org.apache.axiom.om.OMNamespace declareDefaultNamespace(String uri)
declareDefaultNamespace in interface org.apache.axiom.om.OMElementdeclareDefaultNamespace in class OMElementImplpublic org.apache.axiom.om.OMNamespace getDefaultNamespace()
getDefaultNamespace in interface org.apache.axiom.om.OMElementgetDefaultNamespace in class OMElementImplpublic org.apache.axiom.om.OMNamespace declareNamespace(org.apache.axiom.om.OMNamespace namespace)
declareNamespace in interface org.apache.axiom.om.OMElementdeclareNamespace in class OMElementImplpublic org.apache.axiom.om.OMNamespace addNamespaceDeclaration(String uri, String prefix)
addNamespaceDeclaration in interface org.apache.axiom.om.impl.OMElementExaddNamespaceDeclaration in class OMElementImplpublic void addNamespaceDeclaration(org.apache.axiom.om.OMNamespace ns)
addNamespaceDeclaration in interface org.apache.axiom.om.impl.common.AxiomElementaddNamespaceDeclaration in class OMElementImplpublic void undeclarePrefix(String prefix)
undeclarePrefix in interface org.apache.axiom.om.OMElementundeclarePrefix in class OMElementImplpublic org.apache.axiom.om.OMNamespace findNamespace(String uri, String prefix)
OMElementImplfindNamespace in interface org.apache.axiom.om.OMElementfindNamespace in class OMElementImplpublic org.apache.axiom.om.OMNamespace findNamespaceURI(String prefix)
findNamespaceURI in interface org.apache.axiom.om.OMElementfindNamespaceURI in class OMElementImplpublic Iterator getAllDeclaredNamespaces() throws org.apache.axiom.om.OMException
OMElementImplgetAllDeclaredNamespaces in interface org.apache.axiom.om.OMElementgetAllDeclaredNamespaces in class OMElementImplorg.apache.axiom.om.OMExceptionpublic Iterator getAllAttributes()
OMElementImplgetAllAttributes in interface org.apache.axiom.om.OMElementgetAllAttributes in class OMElementImplpublic org.apache.axiom.om.OMAttribute getAttribute(QName qname)
OMElementImplgetAttribute in interface org.apache.axiom.om.OMElementgetAttribute in class OMElementImplqname - the qualified name to search forpublic String getAttributeValue(QName qname)
OMElementImplgetAttributeValue in interface org.apache.axiom.om.OMElementgetAttributeValue in class OMElementImplqname - the qualified name to search forpublic org.apache.axiom.om.OMAttribute addAttribute(org.apache.axiom.om.OMAttribute attr)
OMElementImplThe owner of the attribute is set to be the particular OMElement.
If the attribute already has an owner then the attribute is cloned (i.e. its name,
value and namespace are copied to a new attribute) and the new attribute is added
to the element. It's owner is then set to be the particular OMElement.
addAttribute in interface org.apache.axiom.om.OMElementaddAttribute in class OMElementImplOMAttributeImpl.equals(Object)public org.apache.axiom.om.OMAttribute addAttribute(String attributeName, String value, org.apache.axiom.om.OMNamespace namespace)
addAttribute in interface org.apache.axiom.om.OMElementaddAttribute in class OMElementImplpublic void removeAttribute(org.apache.axiom.om.OMAttribute attr)
removeAttribute in interface org.apache.axiom.om.OMElementremoveAttribute in class OMElementImplpublic javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
getXMLStreamReader in interface org.apache.axiom.om.impl.common.AxiomContainergetXMLStreamReader in interface org.apache.axiom.om.OMContainerpublic javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache, org.apache.axiom.om.OMXMLStreamReaderConfiguration configuration)
getXMLStreamReader in interface org.apache.axiom.om.impl.common.AxiomContainergetXMLStreamReader in interface org.apache.axiom.om.OMContainerpublic javax.xml.stream.XMLStreamReader getXMLStreamReader()
getXMLStreamReader in interface org.apache.axiom.om.impl.common.AxiomContainergetXMLStreamReader in interface org.apache.axiom.om.OMContainerpublic javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching in interface org.apache.axiom.om.impl.common.AxiomContainergetXMLStreamReaderWithoutCaching in interface org.apache.axiom.om.OMContainerpublic String getText()
getText in interface org.apache.axiom.om.impl.common.AxiomElementgetText in interface org.apache.axiom.om.OMElementpublic String getLocalName()
getLocalName in interface org.apache.axiom.om.impl.common.AxiomNamedInformationItemgetLocalName in interface org.apache.axiom.om.OMNamedInformationItempublic void setLocalName(String localName)
setLocalName in interface org.apache.axiom.om.impl.common.AxiomNamedInformationItemsetLocalName in interface org.apache.axiom.om.OMNamedInformationItempublic org.apache.axiom.om.OMNamespace getNamespace()
throws org.apache.axiom.om.OMException
getNamespace in interface org.apache.axiom.om.impl.common.AxiomNamedInformationItemgetNamespace in interface org.apache.axiom.om.OMNamedInformationItemorg.apache.axiom.om.OMExceptionpublic void setNamespace(org.apache.axiom.om.OMNamespace namespace)
setNamespace in interface org.apache.axiom.om.OMElementsetNamespace in class OMElementImplpublic void setNamespaceWithNoFindInCurrentScope(org.apache.axiom.om.OMNamespace namespace)
setNamespaceWithNoFindInCurrentScope in interface org.apache.axiom.om.impl.common.AxiomElementsetNamespaceWithNoFindInCurrentScope in interface org.apache.axiom.om.OMElementpublic void setNamespace(org.apache.axiom.om.OMNamespace namespace,
boolean declare)
setNamespace in interface org.apache.axiom.om.impl.common.AxiomElementsetNamespace in interface org.apache.axiom.om.OMNamedInformationItempublic QName getQName()
getQName in interface org.apache.axiom.om.impl.common.AxiomNamedInformationItemgetQName in interface org.apache.axiom.om.OMNamedInformationItempublic boolean hasName(QName name)
hasName in interface org.apache.axiom.om.impl.common.AxiomNamedInformationItemhasName in interface org.apache.axiom.om.OMNamedInformationItempublic String toStringWithConsume() throws javax.xml.stream.XMLStreamException
toStringWithConsume in interface org.apache.axiom.om.OMElementtoStringWithConsume in class OMElementImpljavax.xml.stream.XMLStreamExceptionpublic org.apache.axiom.om.OMElement cloneOMElement()
cloneOMElement in interface org.apache.axiom.om.OMElementcloneOMElement in class OMElementImplpublic org.apache.axiom.om.OMInformationItem clone(org.apache.axiom.om.OMCloneOptions options)
clone in interface org.apache.axiom.om.OMInformationItemclone in class OMNodeImplprotected org.apache.axiom.om.OMElement createClone(org.apache.axiom.om.OMCloneOptions options,
org.apache.axiom.om.OMContainer targetParent)
createClone in class OMElementImplprotected org.apache.axiom.om.OMSourcedElement createClone(org.apache.axiom.om.OMCloneOptions options,
org.apache.axiom.om.OMDataSource ds)
public void setLineNumber(int lineNumber)
setLineNumber in interface org.apache.axiom.om.OMElementsetLineNumber in class OMElementImplpublic int getLineNumber()
getLineNumber in interface org.apache.axiom.om.OMElementgetLineNumber in class OMElementImplpublic void discard()
throws org.apache.axiom.om.OMException
discard in interface org.apache.axiom.om.impl.common.AxiomElementdiscard in interface org.apache.axiom.om.OMNodeorg.apache.axiom.om.OMExceptionpublic void internalSerialize(org.apache.axiom.om.impl.common.serializer.push.Serializer serializer,
org.apache.axiom.om.OMOutputFormat format,
boolean cache)
throws org.apache.axiom.om.impl.common.serializer.push.OutputException
internalSerialize in interface org.apache.axiom.om.impl.common.AxiomSerializableinternalSerialize in class OMElementImplorg.apache.axiom.om.impl.common.serializer.push.OutputExceptionpublic org.apache.axiom.om.OMNode detach()
throws org.apache.axiom.om.OMException
detach in interface org.apache.axiom.om.impl.common.AxiomChildNodedetach in interface org.apache.axiom.om.OMNodeorg.apache.axiom.om.OMExceptionpublic org.apache.axiom.om.OMNode getNextOMSibling()
throws org.apache.axiom.om.OMException
getNextOMSibling in interface org.apache.axiom.om.impl.common.AxiomChildNodegetNextOMSibling in interface org.apache.axiom.om.OMNodeorg.apache.axiom.om.OMExceptionpublic org.apache.axiom.om.OMNode getNextOMSiblingIfAvailable()
getNextOMSiblingIfAvailable in interface org.apache.axiom.om.impl.common.AxiomChildNodegetNextOMSiblingIfAvailable in interface org.apache.axiom.om.impl.OMNodeExpublic int getState()
getState in interface org.apache.axiom.core.CoreParentNodegetState in interface org.apache.axiom.core.DeferringParentNodepublic boolean isComplete()
isComplete in interface org.apache.axiom.om.impl.common.AxiomContainerisComplete in interface org.apache.axiom.om.OMSerializablepublic String toString()
toString in interface org.apache.axiom.om.OMElementtoString in class OMElementImplpublic void buildWithAttachments()
buildWithAttachments in interface org.apache.axiom.om.impl.common.AxiomChildNodebuildWithAttachments in interface org.apache.axiom.om.OMNodebuildWithAttachments in class OMElementImplpublic void build()
throws org.apache.axiom.om.OMException
build in interface org.apache.axiom.core.CoreParentNodebuild in interface org.apache.axiom.om.OMSerializablebuild in class OMElementImplorg.apache.axiom.om.OMExceptionpublic org.apache.axiom.om.OMDataSource getDataSource()
getDataSource in interface org.apache.axiom.om.OMSourcedElementpublic org.apache.axiom.om.OMDataSource setDataSource(org.apache.axiom.om.OMDataSource dataSource)
setDataSource in interface org.apache.axiom.om.OMSourcedElementpublic void setComplete(boolean complete)
setComplete in interface org.apache.axiom.om.impl.common.AxiomSerializablesetComplete in interface org.apache.axiom.om.impl.OMContainerExsetComplete in interface org.apache.axiom.om.impl.OMNodeExsetComplete in class OMElementImplpublic SAXResult getSAXResult()
getSAXResult in interface org.apache.axiom.om.impl.common.AxiomContainergetSAXResult in interface org.apache.axiom.om.OMContainerpublic Object getObject(Class dataSourceClass)
getObject in interface org.apache.axiom.om.OMSourcedElementpublic org.apache.axiom.core.CoreChildNode coreGetFirstChildIfAvailable()
coreGetFirstChildIfAvailable in interface org.apache.axiom.core.CoreParentNodeCopyright ? The Apache Software Foundation. All Rights Reserved.