Package org.apache.axiom.om.impl.llom
Class OMDocumentImpl
- java.lang.Object
-
- org.apache.axiom.om.impl.llom.OMSerializableImpl
-
- org.apache.axiom.om.impl.llom.OMDocumentImpl
-
- All Implemented Interfaces:
org.apache.axiom.om.impl.OMContainerEx,org.apache.axiom.om.OMContainer,org.apache.axiom.om.OMDocument,org.apache.axiom.om.OMSerializable
- Direct Known Subclasses:
SOAPMessageImpl
public class OMDocumentImpl extends OMSerializableImpl implements org.apache.axiom.om.OMDocument, org.apache.axiom.om.impl.OMContainerEx
Class OMDocumentImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcharSetEncodingField charSetEncoding Default : UTF-8protected org.apache.axiom.om.OMElementdocumentElementField documentElementprotected org.apache.axiom.om.OMNodefirstChildField firstChildprotected StringisStandaloneprotected org.apache.axiom.om.OMNodelastChildField lastChildprotected StringxmlVersionField xmlVersion-
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factory
-
-
Constructor Summary
Constructors Constructor Description OMDocumentImpl(org.apache.axiom.om.OMElement documentElement, org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)Create theOMDoucmentwith the factory and set the givenOMElementas the document elementOMDocumentImpl(org.apache.axiom.om.OMFactory factory)Create aOMDocumentgiven theOMFactoryOMDocumentImpl(org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)Create theOMDocumentwith the factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(org.apache.axiom.om.OMNode child)Adds child to the element.voidbuildNext()Forces the parser to proceed, if parser has not yet finished with the XML input.org.apache.axiom.om.OMXMLParserWrappergetBuilder()StringgetCharsetEncoding()Returns the character set encoding scheme to be used.IteratorgetChildren()Returns a collection of this element.IteratorgetChildrenWithLocalName(String localName)IteratorgetChildrenWithName(QName elementQName)Searches for children with a given QName and returns an iterator to traverse through the OMNodes.IteratorgetChildrenWithNamespaceURI(String uri)org.apache.axiom.om.OMElementgetFirstChildWithName(QName elementQName)Method getFirstChildWithName.org.apache.axiom.om.OMNodegetFirstOMChild()Method getFirstOMChild.org.apache.axiom.om.OMNodegetFirstOMChildIfAvailable()org.apache.axiom.om.OMElementgetOMDocumentElement()Method getDocumentElement.XMLStreamReadergetXMLStreamReader()XMLStreamReadergetXMLStreamReader(boolean cache)XMLStreamReadergetXMLStreamReaderWithoutCaching()StringgetXMLVersion()voidinternalSerialize(XMLStreamWriter writer)Serializes the document with cache.voidinternalSerialize(XMLStreamWriter writer, boolean cache)Serializes the node.protected voidinternalSerialize(XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration)voidinternalSerializeAndConsume(XMLStreamWriter writer)Serializes the document with the XML declaration.StringisStandalone()voidsetCharsetEncoding(String charEncoding)Sets the character set encoding scheme.voidsetComplete(boolean state)Method setComplete.voidsetFirstChild(org.apache.axiom.om.OMNode firstChild)Method setFirstChild.voidsetLastChild(org.apache.axiom.om.OMNode omNode)Forcefully set the last childvoidsetOMDocumentElement(org.apache.axiom.om.OMElement documentElement)Method setDocumentElement.voidsetStandalone(String isStandalone)voidsetXMLVersion(String xmlVersion)-
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
build, close, getOMFactory, isComplete, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
documentElement
protected org.apache.axiom.om.OMElement documentElement
Field documentElement
-
firstChild
protected org.apache.axiom.om.OMNode firstChild
Field firstChild
-
lastChild
protected org.apache.axiom.om.OMNode lastChild
Field lastChild
-
charSetEncoding
protected String charSetEncoding
Field charSetEncoding Default : UTF-8
-
xmlVersion
protected String xmlVersion
Field xmlVersion
-
isStandalone
protected String isStandalone
-
-
Constructor Detail
-
OMDocumentImpl
public OMDocumentImpl(org.apache.axiom.om.OMFactory factory)
Create aOMDocumentgiven theOMFactory- Parameters:
factory- TheOMFactorythat created this instace
-
OMDocumentImpl
public OMDocumentImpl(org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)Create theOMDocumentwith the factory- Parameters:
parserWrapper-factory-
-
OMDocumentImpl
public OMDocumentImpl(org.apache.axiom.om.OMElement documentElement, org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)Create theOMDoucmentwith the factory and set the givenOMElementas the document element- Parameters:
documentElement-parserWrapper-factory-
-
-
Method Detail
-
getBuilder
public org.apache.axiom.om.OMXMLParserWrapper getBuilder()
- Specified by:
getBuilderin interfaceorg.apache.axiom.om.OMContainer
-
getOMDocumentElement
public org.apache.axiom.om.OMElement getOMDocumentElement()
Method getDocumentElement.- Specified by:
getOMDocumentElementin interfaceorg.apache.axiom.om.OMDocument- Returns:
- Returns OMElement.
-
setOMDocumentElement
public void setOMDocumentElement(org.apache.axiom.om.OMElement documentElement)
Method setDocumentElement.- Specified by:
setOMDocumentElementin interfaceorg.apache.axiom.om.OMDocument- Parameters:
documentElement-
-
setComplete
public void setComplete(boolean state)
Method setComplete.- Specified by:
setCompletein interfaceorg.apache.axiom.om.impl.OMContainerEx- Specified by:
setCompletein classOMSerializableImpl- Parameters:
state-
-
buildNext
public void buildNext()
Forces the parser to proceed, if parser has not yet finished with the XML input.- Specified by:
buildNextin interfaceorg.apache.axiom.om.OMContainer
-
addChild
public void addChild(org.apache.axiom.om.OMNode child)
Adds child to the element. One can decide whether to append the child or to add to the front of the children list.- Specified by:
addChildin interfaceorg.apache.axiom.om.OMContainer- Parameters:
child-
-
getChildren
public Iterator getChildren()
Returns a collection of this element. Children can be of types OMElement, OMText.- Specified by:
getChildrenin interfaceorg.apache.axiom.om.OMContainer- Returns:
- Returns iterator.
-
getChildrenWithName
public Iterator getChildrenWithName(QName elementQName)
Searches for children with a given QName and returns an iterator to traverse through the OMNodes. The QName can contain any combination of prefix, localname and URI.- Specified by:
getChildrenWithNamein interfaceorg.apache.axiom.om.OMContainer- Parameters:
elementQName-- Returns:
- Returns Iterator.
- Throws:
org.apache.axiom.om.OMException
-
getChildrenWithLocalName
public Iterator getChildrenWithLocalName(String localName)
- Specified by:
getChildrenWithLocalNamein interfaceorg.apache.axiom.om.OMContainer
-
getChildrenWithNamespaceURI
public Iterator getChildrenWithNamespaceURI(String uri)
- Specified by:
getChildrenWithNamespaceURIin interfaceorg.apache.axiom.om.OMContainer
-
getFirstOMChild
public org.apache.axiom.om.OMNode getFirstOMChild()
Method getFirstOMChild.- Specified by:
getFirstOMChildin interfaceorg.apache.axiom.om.OMContainer- Returns:
- Returns first om child.
-
getFirstOMChildIfAvailable
public org.apache.axiom.om.OMNode getFirstOMChildIfAvailable()
- Specified by:
getFirstOMChildIfAvailablein interfaceorg.apache.axiom.om.impl.OMContainerEx
-
getFirstChildWithName
public org.apache.axiom.om.OMElement getFirstChildWithName(QName elementQName) throws org.apache.axiom.om.OMException
Method getFirstChildWithName.- Specified by:
getFirstChildWithNamein interfaceorg.apache.axiom.om.OMContainer- Parameters:
elementQName-- Returns:
- Returns OMElement.
- Throws:
org.apache.axiom.om.OMException
-
setFirstChild
public void setFirstChild(org.apache.axiom.om.OMNode firstChild)
Method setFirstChild.- Specified by:
setFirstChildin interfaceorg.apache.axiom.om.impl.OMContainerEx- Parameters:
firstChild-
-
setLastChild
public void setLastChild(org.apache.axiom.om.OMNode omNode)
Forcefully set the last child- Specified by:
setLastChildin interfaceorg.apache.axiom.om.impl.OMContainerEx- Parameters:
omNode-
-
getCharsetEncoding
public String getCharsetEncoding()
Returns the character set encoding scheme to be used.- Specified by:
getCharsetEncodingin interfaceorg.apache.axiom.om.OMDocument- Returns:
- Returns charset.
-
setCharsetEncoding
public void setCharsetEncoding(String charEncoding)
Sets the character set encoding scheme.- Specified by:
setCharsetEncodingin interfaceorg.apache.axiom.om.OMDocument- Parameters:
charEncoding-
-
isStandalone
public String isStandalone()
- Specified by:
isStandalonein interfaceorg.apache.axiom.om.OMDocument
-
setStandalone
public void setStandalone(String isStandalone)
- Specified by:
setStandalonein interfaceorg.apache.axiom.om.OMDocument
-
getXMLVersion
public String getXMLVersion()
- Specified by:
getXMLVersionin interfaceorg.apache.axiom.om.OMDocument
-
setXMLVersion
public void setXMLVersion(String xmlVersion)
- Specified by:
setXMLVersionin interfaceorg.apache.axiom.om.OMDocument
-
internalSerialize
public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
Description copied from class:OMSerializableImplSerializes the node.- Specified by:
internalSerializein classOMSerializableImpl- Throws:
XMLStreamException
-
internalSerialize
protected void internalSerialize(XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException
- Throws:
XMLStreamException
-
internalSerializeAndConsume
public void internalSerializeAndConsume(XMLStreamWriter writer) throws XMLStreamException
Serializes the document with the XML declaration.- Throws:
XMLStreamException
-
internalSerialize
public void internalSerialize(XMLStreamWriter writer) throws XMLStreamException
Serializes the document with cache.- Throws:
XMLStreamException
-
getXMLStreamReader
public XMLStreamReader getXMLStreamReader()
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer
-
getXMLStreamReaderWithoutCaching
public XMLStreamReader getXMLStreamReaderWithoutCaching()
- Specified by:
getXMLStreamReaderWithoutCachingin interfaceorg.apache.axiom.om.OMContainer
-
getXMLStreamReader
public XMLStreamReader getXMLStreamReader(boolean cache)
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer
-
-