|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.om.impl.llom.OMSerializableImpl
org.apache.axiom.om.impl.llom.OMNodeImpl
org.apache.axiom.om.impl.llom.OMElementImpl
org.apache.axiom.om.impl.llom.OMSourcedElementImpl
public class OMSourcedElementImpl
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.
| Field Summary |
|---|
| Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl |
|---|
attributes, firstChild, lastChild, localName, namespaces, ns, qName |
| Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl |
|---|
nextSibling, nodeType, parent, previousSibling |
| Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl |
|---|
builder, done, factory |
| Fields inherited from interface org.apache.axiom.om.OMNode |
|---|
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE |
| Constructor Summary | |
|---|---|
OMSourcedElementImpl(javax.xml.namespace.QName qName,
OMFactory factory,
OMDataSource source)
Constructor that takes a QName instead of the local name and the namespace seperately |
|
OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent,
OMFactory factory)
|
|
OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent,
OMXMLParserWrapper builder,
OMFactory factory)
|
|
OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMFactory factory)
|
|
OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMFactory factory,
OMDataSource source)
Constructor. |
|
| Method Summary | |
|---|---|
OMAttribute |
addAttribute(OMAttribute attr)
Inserts an attribute to this element. |
OMAttribute |
addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace namespace)
|
void |
addChild(OMNode omNode)
Adds child to the element. |
OMNamespace |
addNamespaceDeclaration(java.lang.String uri,
java.lang.String prefix)
|
void |
build()
Parses this node and builds the object structure in memory. |
void |
buildNext()
Forces the parser to proceed, if parser has not yet finished with the XML input. |
void |
buildWithAttachments()
Parses this node and builds the object structure in memory. |
OMElement |
cloneOMElement()
|
OMNamespace |
declareDefaultNamespace(java.lang.String uri)
|
OMNamespace |
declareNamespace(OMNamespace namespace)
|
OMNamespace |
declareNamespace(java.lang.String uri,
java.lang.String prefix)
|
OMNode |
detach()
Removes this information item and its children, from the model completely. |
void |
discard()
Method discard. |
OMNamespace |
findNamespace(java.lang.String uri,
java.lang.String prefix)
Finds a namespace with the given uri and prefix, in the scope of the document. |
OMNamespace |
findNamespaceURI(java.lang.String prefix)
|
java.util.Iterator |
getAllAttributes()
Returns a List of OMAttributes. |
java.util.Iterator |
getAllDeclaredNamespaces()
Method getAllDeclaredNamespaces. |
OMAttribute |
getAttribute(javax.xml.namespace.QName qname)
Returns a named attribute if present. |
java.lang.String |
getAttributeValue(javax.xml.namespace.QName qname)
Returns a named attribute's value, if present. |
OMXMLParserWrapper |
getBuilder()
Method getBuilder. |
java.util.Iterator |
getChildElements()
Returns a filtered list of children - just the elements. |
java.util.Iterator |
getChildren()
Returns a collection of this element. |
java.util.Iterator |
getChildrenWithLocalName(java.lang.String localName)
|
java.util.Iterator |
getChildrenWithName(javax.xml.namespace.QName elementQName)
Searches for children with a given QName and returns an iterator to traverse through the OMNodes. |
java.util.Iterator |
getChildrenWithNamespaceURI(java.lang.String uri)
|
OMDataSource |
getDataSource()
Provide access to the data source encapsulated in OMSourcedElement. |
OMNamespace |
getDefaultNamespace()
|
java.util.Iterator |
getDescendants(boolean includeSelf)
|
OMElement |
getFirstChildWithName(javax.xml.namespace.QName elementQName)
Method getFirstChildWithName. |
OMElement |
getFirstElement()
Gets first element. |
OMNode |
getFirstOMChild()
Method getFirstOMChild. |
OMNode |
getFirstOMChildIfAvailable()
|
int |
getLineNumber()
|
java.lang.String |
getLocalName()
Method getLocalName. |
OMNamespace |
getNamespace()
|
javax.xml.namespace.NamespaceContext |
getNamespaceContext(boolean detached)
|
java.util.Iterator |
getNamespacesInScope()
|
java.lang.String |
getNamespaceURI()
|
OMNode |
getNextOMSibling()
Gets the next sibling. |
OMNode |
getNextOMSiblingIfAvailable()
|
java.lang.String |
getPrefix()
|
javax.xml.namespace.QName |
getQName()
Method getQName. |
javax.xml.transform.sax.SAXSource |
getSAXSource(boolean cache)
|
java.lang.String |
getText()
|
javax.xml.namespace.QName |
getTextAsQName()
|
java.io.Reader |
getTextAsStream(boolean cache)
|
int |
getType()
Gets the type of node, as this is the super class of all the nodes. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader()
|
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean cache)
|
javax.xml.stream.XMLStreamReader |
getXMLStreamReader(boolean cache,
OMXMLStreamReaderConfiguration configuration)
|
javax.xml.stream.XMLStreamReader |
getXMLStreamReaderWithoutCaching()
|
void |
internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
Serializes the node. |
boolean |
isComplete()
|
boolean |
isExpanded()
Check if element has been expanded into tree. |
void |
removeAttribute(OMAttribute attr)
Method removeAttribute. |
javax.xml.namespace.QName |
resolveQName(java.lang.String qname)
|
void |
serialize(java.io.OutputStream output)
|
void |
serialize(java.io.OutputStream output,
OMOutputFormat format)
|
void |
serialize(java.io.Writer writer)
|
void |
serialize(java.io.Writer writer,
OMOutputFormat format)
|
void |
serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
|
void |
serializeAndConsume(java.io.OutputStream output)
|
void |
serializeAndConsume(java.io.OutputStream output,
OMOutputFormat format)
|
void |
serializeAndConsume(java.io.Writer writer)
|
void |
serializeAndConsume(java.io.Writer writer,
OMOutputFormat format)
|
void |
serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
|
void |
setBuilder(OMXMLParserWrapper wrapper)
Method setBuilder. |
void |
setComplete(boolean value)
setComplete override The OMSourcedElement has its own isolated builder/reader during the expansion process. |
OMDataSource |
setDataSource(OMDataSource dataSource)
setOMDataSource |
void |
setFirstChild(OMNode node)
Method setFirstChild. |
void |
setLastChild(OMNode omNode)
|
void |
setLineNumber(int lineNumber)
|
void |
setLocalName(java.lang.String localName)
Method setLocalName. |
void |
setNamespace(OMNamespace namespace)
|
void |
setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
|
void |
setText(javax.xml.namespace.QName text)
|
void |
setText(java.lang.String text)
|
java.lang.String |
toString()
|
java.lang.String |
toStringWithConsume()
|
void |
undeclarePrefix(java.lang.String prefix)
|
void |
writeTextTo(java.io.Writer out,
boolean cache)
|
| Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl |
|---|
getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling, setType |
| Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl |
|---|
close, getOMFactory, serialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.axiom.om.OMNode |
|---|
getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore |
| Methods inherited from interface org.apache.axiom.om.OMSerializable |
|---|
close, serialize |
| Methods inherited from interface org.apache.axiom.om.OMInformationItem |
|---|
getOMFactory |
| Methods inherited from interface org.apache.axiom.om.OMSerializable |
|---|
close, serialize |
| Methods inherited from interface org.apache.axiom.om.OMInformationItem |
|---|
getOMFactory |
| Methods inherited from interface org.apache.axiom.om.impl.OMNodeEx |
|---|
internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling, setType |
| Constructor Detail |
|---|
public OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMFactory factory,
OMDataSource source)
localName - ns - factory - source -
public OMSourcedElementImpl(javax.xml.namespace.QName qName,
OMFactory factory,
OMDataSource source)
qName - factory - source -
public OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent,
OMFactory factory)
public OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMContainer parent,
OMXMLParserWrapper builder,
OMFactory factory)
public OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMFactory factory)
| Method Detail |
|---|
public boolean isExpanded()
isExpanded in interface OMSourcedElementtrue if expanded, false if notpublic java.util.Iterator getChildElements()
OMElementImpl
getChildElements in interface OMElementgetChildElements in class OMElementImpl
public OMNamespace declareNamespace(java.lang.String uri,
java.lang.String prefix)
declareNamespace in interface OMElementdeclareNamespace in class OMElementImplpublic OMNamespace declareDefaultNamespace(java.lang.String uri)
declareDefaultNamespace in interface OMElementdeclareDefaultNamespace in class OMElementImplpublic OMNamespace getDefaultNamespace()
getDefaultNamespace in interface OMElementgetDefaultNamespace in class OMElementImplpublic OMNamespace declareNamespace(OMNamespace namespace)
declareNamespace in interface OMElementdeclareNamespace in class OMElementImpl
public OMNamespace addNamespaceDeclaration(java.lang.String uri,
java.lang.String prefix)
addNamespaceDeclaration in interface OMElementExaddNamespaceDeclaration in class OMElementImplpublic void undeclarePrefix(java.lang.String prefix)
undeclarePrefix in interface OMElementundeclarePrefix in class OMElementImpl
public OMNamespace findNamespace(java.lang.String uri,
java.lang.String prefix)
OMElementImpl
findNamespace in interface OMElementfindNamespace in class OMElementImplpublic OMNamespace findNamespaceURI(java.lang.String prefix)
findNamespaceURI in interface OMElementfindNamespaceURI in class OMElementImpl
public java.util.Iterator getAllDeclaredNamespaces()
throws OMException
OMElementImpl
getAllDeclaredNamespaces in interface OMElementgetAllDeclaredNamespaces in class OMElementImplOMException
public java.util.Iterator getNamespacesInScope()
throws OMException
getNamespacesInScope in interface OMElementgetNamespacesInScope in class OMElementImplOMExceptionpublic javax.xml.namespace.NamespaceContext getNamespaceContext(boolean detached)
getNamespaceContext in interface OMElementgetNamespaceContext in class OMElementImplpublic java.util.Iterator getAllAttributes()
OMElementImpl
getAllAttributes in interface OMElementgetAllAttributes in class OMElementImplpublic OMAttribute getAttribute(javax.xml.namespace.QName qname)
OMElementImpl
getAttribute in interface OMElementgetAttribute in class OMElementImplqname - the qualified name to search for
public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
OMElementImpl
getAttributeValue in interface OMElementgetAttributeValue in class OMElementImplqname - the qualified name to search for
public OMAttribute addAttribute(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 OMElementaddAttribute in class OMElementImplOMAttributeImpl.equals(Object)
public OMAttribute addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace namespace)
addAttribute in interface OMElementaddAttribute in class OMElementImplpublic void removeAttribute(OMAttribute attr)
OMElementImpl
removeAttribute in interface OMElementremoveAttribute in class OMElementImplpublic void setBuilder(OMXMLParserWrapper wrapper)
OMElementImpl
setBuilder in interface OMElementsetBuilder in class OMElementImplpublic OMXMLParserWrapper getBuilder()
OMElementImpl
getBuilder in interface OMContainergetBuilder in class OMElementImplpublic void setFirstChild(OMNode node)
OMElementImpl
setFirstChild in interface OMContainerExsetFirstChild in class OMElementImplpublic void setLastChild(OMNode omNode)
setLastChild in interface OMContainerExsetLastChild in class OMElementImplpublic OMElement getFirstElement()
OMElementImpl
getFirstElement in interface OMElementgetFirstElement in class OMElementImplpublic javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
getXMLStreamReader in interface OMContainergetXMLStreamReader in class OMElementImpl
public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache,
OMXMLStreamReaderConfiguration configuration)
getXMLStreamReader in interface OMContainergetXMLStreamReader in class OMElementImplpublic javax.xml.stream.XMLStreamReader getXMLStreamReader()
getXMLStreamReader in interface OMContainergetXMLStreamReader in class OMElementImplpublic javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching in interface OMContainergetXMLStreamReaderWithoutCaching in class OMElementImplpublic void setText(java.lang.String text)
setText in interface OMElementsetText in class OMElementImplpublic void setText(javax.xml.namespace.QName text)
setText in interface OMElementsetText in class OMElementImplpublic java.lang.String getText()
getText in interface OMElementgetText in class OMElementImplpublic java.io.Reader getTextAsStream(boolean cache)
getTextAsStream in interface OMElementgetTextAsStream in class OMElementImplpublic javax.xml.namespace.QName getTextAsQName()
getTextAsQName in interface OMElementgetTextAsQName in class OMElementImpl
public void writeTextTo(java.io.Writer out,
boolean cache)
throws java.io.IOException
writeTextTo in interface OMElementwriteTextTo in class OMElementImpljava.io.IOExceptionpublic java.lang.String getLocalName()
OMElementImpl
getLocalName in interface OMNamedInformationItemgetLocalName in class OMElementImplpublic void setLocalName(java.lang.String localName)
OMElementImpl
setLocalName in interface OMNamedInformationItemsetLocalName in class OMElementImpl
public OMNamespace getNamespace()
throws OMException
getNamespace in interface OMNamedInformationItemgetNamespace in class OMElementImplOMExceptionpublic java.lang.String getPrefix()
getPrefix in interface OMNamedInformationItemgetPrefix in class OMElementImplpublic java.lang.String getNamespaceURI()
getNamespaceURI in interface OMNamedInformationItemgetNamespaceURI in class OMElementImplpublic void setNamespace(OMNamespace namespace)
setNamespace in interface OMElementsetNamespace in class OMElementImplpublic void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
setNamespaceWithNoFindInCurrentScope in interface OMElementsetNamespaceWithNoFindInCurrentScope in class OMElementImplpublic javax.xml.namespace.QName getQName()
OMElementImpl
getQName in interface OMNamedInformationItemgetQName in class OMElementImpl
public java.lang.String toStringWithConsume()
throws javax.xml.stream.XMLStreamException
toStringWithConsume in interface OMElementtoStringWithConsume in class OMElementImpljavax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.QName resolveQName(java.lang.String qname)
resolveQName in interface OMElementresolveQName in class OMElementImplpublic OMElement cloneOMElement()
cloneOMElement in interface OMElementcloneOMElement in class OMElementImplpublic void setLineNumber(int lineNumber)
setLineNumber in interface OMElementsetLineNumber in class OMElementImplpublic int getLineNumber()
getLineNumber in interface OMElementgetLineNumber in class OMElementImpl
public void discard()
throws OMException
OMElementImpl
discard in interface OMNodediscard in class OMElementImplOMExceptionpublic int getType()
OMElementImpl
getType in interface OMNodegetType in class OMElementImplOMNodeImpl.setType(int)OMNodeImpl.setType(int)
public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
OMSerializableImpl
internalSerialize in interface OMNodeExinternalSerialize in class OMElementImpljavax.xml.stream.XMLStreamException
public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
serialize in interface OMSerializableserialize in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
serialize in interface OMContainerserialize in interface OMElementserialize in interface OMNodeserialize in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
serialize in interface OMContainerserialize in interface OMElementserialize in interface OMNodeserialize in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
serialize in interface OMContainerserialize in interface OMElementserialize in interface OMNodeserialize in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.Writer writer,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
serialize in interface OMContainerserialize in interface OMElementserialize in interface OMNodeserialize in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
serializeAndConsume in interface OMSerializableserializeAndConsume in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
serializeAndConsume in interface OMContainerserializeAndConsume in interface OMElementserializeAndConsume in interface OMNodeserializeAndConsume in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
serializeAndConsume in interface OMContainerserializeAndConsume in interface OMElementserializeAndConsume in interface OMNodeserializeAndConsume in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
serializeAndConsume in interface OMContainerserializeAndConsume in interface OMElementserializeAndConsume in interface OMNodeserializeAndConsume in class OMSerializableImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.Writer writer,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
serializeAndConsume in interface OMContainerserializeAndConsume in interface OMElementserializeAndConsume in interface OMNodeserializeAndConsume in class OMSerializableImpljavax.xml.stream.XMLStreamExceptionpublic void addChild(OMNode omNode)
OMElementImpl
addChild in interface OMContaineraddChild in class OMElementImplpublic java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
OMElementImpl
getChildrenWithName in interface OMContainergetChildrenWithName in class OMElementImplpublic java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
getChildrenWithLocalName in interface OMContainergetChildrenWithLocalName in class OMElementImplpublic java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
getChildrenWithNamespaceURI in interface OMContainergetChildrenWithNamespaceURI in class OMElementImpl
public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
throws OMException
OMElementImpl
getFirstChildWithName in interface OMContainergetFirstChildWithName in class OMElementImplOMExceptionpublic java.util.Iterator getChildren()
OMElementImpl
getChildren in interface OMContainergetChildren in class OMElementImplpublic java.util.Iterator getDescendants(boolean includeSelf)
getDescendants in interface OMContainergetDescendants in class OMElementImplpublic OMNode getFirstOMChild()
OMElementImpl
getFirstOMChild in interface OMContainergetFirstOMChild in class OMElementImplpublic OMNode getFirstOMChildIfAvailable()
getFirstOMChildIfAvailable in interface OMContainerExgetFirstOMChildIfAvailable in class OMElementImplpublic void buildNext()
OMElementImpl
buildNext in interface OMContainerbuildNext in class OMElementImpl
public OMNode detach()
throws OMException
OMElementImpl
detach in interface OMNodedetach in class OMElementImplOMException
public OMNode getNextOMSibling()
throws OMException
OMElementImpl
getNextOMSibling in interface OMNodegetNextOMSibling in class OMElementImplOMExceptionpublic OMNode getNextOMSiblingIfAvailable()
getNextOMSiblingIfAvailable in interface OMNodeExgetNextOMSiblingIfAvailable in class OMNodeImplpublic boolean isComplete()
isComplete in interface OMSerializableisComplete in class OMSerializableImplpublic java.lang.String toString()
toString in interface OMElementtoString in class OMElementImplpublic void buildWithAttachments()
OMNodeImpl
buildWithAttachments in interface OMNodebuildWithAttachments in class OMElementImpl
public void build()
throws OMException
OMSerializableImpl
build in interface OMSerializablebuild in class OMElementImplOMExceptionpublic OMDataSource getDataSource()
getDataSource in interface OMSourcedElementpublic OMDataSource setDataSource(OMDataSource dataSource)
setDataSource in interface OMSourcedElementpublic void setComplete(boolean value)
setComplete in interface OMContainerExsetComplete in interface OMNodeExsetComplete in class OMNodeImplpublic javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
getSAXSource in interface OMContainergetSAXSource in class OMElementImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||