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
FieldsModifier and TypeFieldDescriptionprotected StringField charSetEncoding Default : UTF-8protected org.apache.axiom.om.OMElementField documentElementprotected org.apache.axiom.om.OMNodeField firstChildprotected Stringprotected org.apache.axiom.om.OMNodeField lastChildprotected StringField xmlVersionFields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factoryFields inherited from interface org.apache.axiom.om.OMDocument
XML_10, XML_11 -
Constructor Summary
ConstructorsConstructorDescriptionOMDocumentImpl(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
Modifier and TypeMethodDescriptionvoidaddChild(org.apache.axiom.om.OMNode child) Adds child to the element.voidForces the parser to proceed, if parser has not yet finished with the XML input.org.apache.axiom.om.OMXMLParserWrapperReturns the character set encoding scheme to be used.Returns a collection of this element.getChildrenWithLocalName(String localName) getChildrenWithName(QName elementQName) Searches for children with a given QName and returns an iterator to traverse through the OMNodes.org.apache.axiom.om.OMElementgetFirstChildWithName(QName elementQName) Method getFirstChildWithName.org.apache.axiom.om.OMNodeMethod getFirstOMChild.org.apache.axiom.om.OMNodeorg.apache.axiom.om.OMElementMethod getDocumentElement.getXMLStreamReader(boolean cache) voidinternalSerialize(XMLStreamWriter writer) Serializes the document with cache.voidinternalSerialize(XMLStreamWriter writer, boolean cache) Serializes the node.protected voidinternalSerialize(XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration) voidSerializes the document with the XML declaration.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, serializeAndConsumeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.axiom.om.OMContainer
serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsumeMethods inherited from interface org.apache.axiom.om.OMSerializable
build, close, getOMFactory, isComplete, serialize, serialize, serializeAndConsume
-
Field Details
-
documentElement
protected org.apache.axiom.om.OMElement documentElementField documentElement -
firstChild
protected org.apache.axiom.om.OMNode firstChildField firstChild -
lastChild
protected org.apache.axiom.om.OMNode lastChildField lastChild -
charSetEncoding
Field charSetEncoding Default : UTF-8 -
xmlVersion
Field xmlVersion -
isStandalone
-
-
Constructor Details
-
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 Details
-
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
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
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
- Specified by:
getChildrenWithLocalNamein interfaceorg.apache.axiom.om.OMContainer
-
getChildrenWithNamespaceURI
- 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
Returns the character set encoding scheme to be used.- Specified by:
getCharsetEncodingin interfaceorg.apache.axiom.om.OMDocument- Returns:
- Returns charset.
-
setCharsetEncoding
Sets the character set encoding scheme.- Specified by:
setCharsetEncodingin interfaceorg.apache.axiom.om.OMDocument- Parameters:
charEncoding-
-
isStandalone
- Specified by:
isStandalonein interfaceorg.apache.axiom.om.OMDocument
-
setStandalone
- Specified by:
setStandalonein interfaceorg.apache.axiom.om.OMDocument
-
getXMLVersion
- Specified by:
getXMLVersionin interfaceorg.apache.axiom.om.OMDocument
-
setXMLVersion
- Specified by:
setXMLVersionin interfaceorg.apache.axiom.om.OMDocument
-
internalSerialize
Description copied from class:OMSerializableImplSerializes the node.- Specified by:
internalSerializein classOMSerializableImpl- Parameters:
writer-- Throws:
XMLStreamException
-
internalSerialize
protected void internalSerialize(XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException - Throws:
XMLStreamException
-
internalSerializeAndConsume
Serializes the document with the XML declaration.- Throws:
XMLStreamException
-
internalSerialize
Serializes the document with cache.- Throws:
XMLStreamException
-
getXMLStreamReader
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer
-
getXMLStreamReaderWithoutCaching
- Specified by:
getXMLStreamReaderWithoutCachingin interfaceorg.apache.axiom.om.OMContainer
-
getXMLStreamReader
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer
-