org.apache.axiom.om.impl.llom
Class OMDocumentImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMSerializableImpl
      extended by org.apache.axiom.om.impl.llom.OMDocumentImpl
All Implemented Interfaces:
IContainer, IParentNode, OMContainerEx, OMContainer, OMDocument, OMInformationItem, OMSerializable
Direct Known Subclasses:
SOAPMessageImpl

public class OMDocumentImpl
extends OMSerializableImpl
implements OMDocument, IContainer

Class OMDocumentImpl


Field Summary
protected  OMXMLParserWrapper builder
           
protected  java.lang.String charSetEncoding
          Field charSetEncoding Default : UTF-8
protected  OMNode firstChild
          Field firstChild
protected  java.lang.String isStandalone
           
protected  OMNode lastChild
          Field lastChild
protected  int state
           
protected  java.lang.String xmlEncoding
           
protected  java.lang.String xmlVersion
          Field xmlVersion
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
factory
 
Fields inherited from interface org.apache.axiom.om.OMDocument
XML_10, XML_11
 
Fields inherited from interface org.apache.axiom.om.impl.common.IParentNode
COMPLETE, DISCARDED, INCOMPLETE
 
Constructor Summary
OMDocumentImpl(OMFactory factory)
          Create a OMDocument given the OMFactory
OMDocumentImpl(OMXMLParserWrapper parserWrapper, OMFactory factory)
          Create the OMDocument with the factory
 
Method Summary
 void addChild(OMNode child)
           
 void addChild(OMNode omNode, boolean fromBuilder)
           
 void build()
           
 OMInformationItem clone(OMCloneOptions options)
           
protected  OMDocument createClone(OMCloneOptions options)
           
 void discarded()
           
 OMXMLParserWrapper getBuilder()
           
 java.lang.String getCharsetEncoding()
           
 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)
           
 java.util.Iterator getDescendants(boolean includeSelf)
           
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Method getFirstChildWithName.
 OMNode getFirstOMChild()
          Method getFirstOMChild.
 OMNode getFirstOMChildIfAvailable()
           
 OMNode getLastKnownOMChild()
           
 OMElement getOMDocumentElement()
           
 javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
           
 int getState()
           
 java.lang.String getXMLEncoding()
           
 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()
           
 java.lang.String getXMLVersion()
           
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
          Serializes the document with cache.
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache)
          Serializes the node.
protected  void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration)
           
 void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
          Serializes the document with the XML declaration.
 boolean isComplete()
           
 java.lang.String isStandalone()
           
 void removeChildren()
           
 void setCharsetEncoding(java.lang.String charEncoding)
           
 void setComplete(boolean complete)
          Method setComplete.
 void setFirstChild(OMNode firstChild)
          Method setFirstChild.
 void setLastChild(OMNode omNode)
          Forcefully set the last child
 void setOMDocumentElement(OMElement documentElement)
           
 void setStandalone(java.lang.String isStandalone)
           
 void setXMLEncoding(java.lang.String encoding)
           
 void setXMLVersion(java.lang.String xmlVersion)
           
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
close, getOMFactory, 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
 
Methods inherited from interface org.apache.axiom.om.OMContainer
serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMSerializable
close, serialize, serialize, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMInformationItem
getOMFactory
 

Field Detail

builder

protected OMXMLParserWrapper builder

state

protected int state

firstChild

protected OMNode firstChild
Field firstChild


lastChild

protected OMNode lastChild
Field lastChild


charSetEncoding

protected java.lang.String charSetEncoding
Field charSetEncoding Default : UTF-8


xmlVersion

protected java.lang.String xmlVersion
Field xmlVersion


xmlEncoding

protected java.lang.String xmlEncoding

isStandalone

protected java.lang.String isStandalone
Constructor Detail

OMDocumentImpl

public OMDocumentImpl(OMFactory factory)
Create a OMDocument given the OMFactory

Parameters:
factory - The OMFactory that created this instace

OMDocumentImpl

public OMDocumentImpl(OMXMLParserWrapper parserWrapper,
                      OMFactory factory)
Create the OMDocument with the factory

Parameters:
parserWrapper -
factory -
Method Detail

getBuilder

public OMXMLParserWrapper getBuilder()
Specified by:
getBuilder in interface IParentNode
Specified by:
getBuilder in interface OMContainer
Specified by:
getBuilder in class OMSerializableImpl

getOMDocumentElement

public OMElement getOMDocumentElement()
Specified by:
getOMDocumentElement in interface OMDocument

setOMDocumentElement

public void setOMDocumentElement(OMElement documentElement)
Specified by:
setOMDocumentElement in interface OMDocument

getState

public int getState()
Specified by:
getState in interface IParentNode

isComplete

public boolean isComplete()
Specified by:
isComplete in interface IParentNode
Specified by:
isComplete in interface OMSerializable

setComplete

public void setComplete(boolean complete)
Method setComplete.

Specified by:
setComplete in interface OMContainerEx
Specified by:
setComplete in class OMSerializableImpl
Parameters:
state -

discarded

public void discarded()
Specified by:
discarded in interface OMContainerEx

addChild

public void addChild(OMNode child)
Specified by:
addChild in interface OMContainer

addChild

public void addChild(OMNode omNode,
                     boolean fromBuilder)
Specified by:
addChild in interface OMContainerEx

getChildren

public java.util.Iterator getChildren()
Returns a collection of this element. Children can be of types OMElement, OMText.

Specified by:
getChildren in interface OMContainer
Returns:
Returns iterator.

getDescendants

public java.util.Iterator getDescendants(boolean includeSelf)
Specified by:
getDescendants in interface OMContainer

getChildrenWithName

public 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. The QName can contain any combination of prefix, localname and URI.

Specified by:
getChildrenWithName in interface OMContainer
Parameters:
elementQName -
Returns:
Returns Iterator.
Throws:
OMException

getChildrenWithLocalName

public java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
Specified by:
getChildrenWithLocalName in interface OMContainer

getChildrenWithNamespaceURI

public java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
Specified by:
getChildrenWithNamespaceURI in interface OMContainer

getFirstOMChild

public OMNode getFirstOMChild()
Method getFirstOMChild.

Specified by:
getFirstOMChild in interface OMContainer
Returns:
Returns first om child.

getFirstOMChildIfAvailable

public OMNode getFirstOMChildIfAvailable()
Specified by:
getFirstOMChildIfAvailable in interface IParentNode

getLastKnownOMChild

public OMNode getLastKnownOMChild()
Specified by:
getLastKnownOMChild in interface IContainer

getFirstChildWithName

public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
                                throws OMException
Method getFirstChildWithName.

Specified by:
getFirstChildWithName in interface OMContainer
Parameters:
elementQName -
Returns:
Returns OMElement.
Throws:
OMException

setFirstChild

public void setFirstChild(OMNode firstChild)
Method setFirstChild.

Specified by:
setFirstChild in interface IContainer
Parameters:
firstChild -

setLastChild

public void setLastChild(OMNode omNode)
Forcefully set the last child

Specified by:
setLastChild in interface IContainer
Parameters:
omNode -

getCharsetEncoding

public java.lang.String getCharsetEncoding()
Specified by:
getCharsetEncoding in interface OMDocument

setCharsetEncoding

public void setCharsetEncoding(java.lang.String charEncoding)
Specified by:
setCharsetEncoding in interface OMDocument

isStandalone

public java.lang.String isStandalone()
Specified by:
isStandalone in interface OMDocument

setStandalone

public void setStandalone(java.lang.String isStandalone)
Specified by:
setStandalone in interface OMDocument

getXMLVersion

public java.lang.String getXMLVersion()
Specified by:
getXMLVersion in interface OMDocument

setXMLVersion

public void setXMLVersion(java.lang.String xmlVersion)
Specified by:
setXMLVersion in interface OMDocument

getXMLEncoding

public java.lang.String getXMLEncoding()
Specified by:
getXMLEncoding in interface OMDocument

setXMLEncoding

public void setXMLEncoding(java.lang.String encoding)
Specified by:
setXMLEncoding in interface OMDocument

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                              boolean cache)
                       throws javax.xml.stream.XMLStreamException
Description copied from class: OMSerializableImpl
Serializes the node.

Specified by:
internalSerialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

internalSerialize

protected void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                                 boolean cache,
                                 boolean includeXMLDeclaration)
                          throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

internalSerializeAndConsume

public void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
                                 throws javax.xml.stream.XMLStreamException
Serializes the document with the XML declaration.

Throws:
javax.xml.stream.XMLStreamException

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
                       throws javax.xml.stream.XMLStreamException
Serializes the document with cache.

Throws:
javax.xml.stream.XMLStreamException

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()
Specified by:
getXMLStreamReader in interface OMContainer

getXMLStreamReaderWithoutCaching

public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
Specified by:
getXMLStreamReaderWithoutCaching in interface OMContainer

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
Specified by:
getXMLStreamReader in interface OMContainer

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache,
                                                           OMXMLStreamReaderConfiguration configuration)
Specified by:
getXMLStreamReader in interface OMContainer

getSAXSource

public javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
Specified by:
getSAXSource in interface OMContainer

build

public void build()
Specified by:
build in interface OMSerializable

removeChildren

public void removeChildren()
Specified by:
removeChildren in interface OMContainer

clone

public OMInformationItem clone(OMCloneOptions options)
Specified by:
clone in interface OMInformationItem

createClone

protected OMDocument createClone(OMCloneOptions options)


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.