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

java.lang.Object
  extended byorg.apache.axis2.om.impl.llom.OMDocumentImpl
All Implemented Interfaces:
OMContainer, OMContainerEx, OMDocument
Direct Known Subclasses:
SOAPMessageImpl

public class OMDocumentImpl
extends java.lang.Object
implements OMDocument, OMContainerEx

Class OMDocumentImpl


Field Summary
protected  java.lang.String charSetEncoding
          Field charSetEncoding Dafult : UTF-8
protected  boolean done
          Field done
protected  OMNode firstChild
          Field firstChild
protected  java.lang.String isStandalone
           
protected  OMNode lastChild
          Field lastChild
protected  OMXMLParserWrapper parserWrapper
          Field parserWrapper
protected  OMElement rootElement
          Field rootElement
protected  java.lang.String xmlVersion
          Field xmlVersion
 
Fields inherited from interface org.apache.axis2.om.OMDocument
XML_10, XML_11
 
Constructor Summary
OMDocumentImpl()
          Default constructor
OMDocumentImpl(OMElement rootElement, OMXMLParserWrapper parserWrapper)
           
OMDocumentImpl(OMXMLParserWrapper parserWrapper)
           
 
Method Summary
 void addChild(OMNode child)
          This will add child to the element.
 void buildNext()
          This will force the parser to proceed, if parser has not yet finished with the XML input
 java.lang.String getCharsetEncoding()
          Returns the character set encoding scheme to be used
 java.util.Iterator getChildren()
          This returns a collection of this element.
 java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
          This will search for children with a given QName and will return an iterator to traverse through the OMNodes.
 OMElement getDocumentElement()
          Method getRootElement
 OMNode getFirstChild()
          Method getFirstChild
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Method getFirstChildWithName
 java.lang.String getXMLVersion()
          Returns the XML version
 boolean isComplete()
          this will indicate whether parser has parsed this information item completely or not.
 java.lang.String isStandalone()
          XML standalone value This will be yes, no or null (if not available)
 void serialize(OMOutputImpl omOutput)
          Serialize the document with the XML declaration
 void serialize(OMOutputImpl omOutput, boolean includeXMLDeclaration)
          Serialize the docuement with/without the XML declaration
protected  void serialize(OMOutputImpl omOutput, boolean cache, boolean includeXMLDeclaration)
           
 void serializeWithCache(OMOutputImpl omOutput)
          Serialize the document with cache
 void serializeWithCache(OMOutputImpl omOutput, boolean includeXMLDeclaration)
          Serialize the document with cache
 void setCharsetEncoding(java.lang.String charEncoding)
          Set the character set encoding scheme
 void setComplete(boolean state)
          Method setComplete
 void setDocumentElement(OMElement rootElement)
          Method setRootElement
 void setFirstChild(OMNode firstChild)
          Method setFirstChild
 void setStandalone(java.lang.String isStandalone)
           
 void setXMLVersion(java.lang.String xmlVersion)
          Sets the XML version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootElement

protected OMElement rootElement
Field rootElement


firstChild

protected OMNode firstChild
Field firstChild


lastChild

protected OMNode lastChild
Field lastChild


done

protected boolean done
Field done


parserWrapper

protected OMXMLParserWrapper parserWrapper
Field parserWrapper


charSetEncoding

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


xmlVersion

protected java.lang.String xmlVersion
Field xmlVersion


isStandalone

protected java.lang.String isStandalone
Constructor Detail

OMDocumentImpl

public OMDocumentImpl()
Default constructor


OMDocumentImpl

public OMDocumentImpl(OMElement rootElement,
                      OMXMLParserWrapper parserWrapper)
Parameters:
rootElement -
parserWrapper -

OMDocumentImpl

public OMDocumentImpl(OMXMLParserWrapper parserWrapper)
Parameters:
parserWrapper -
Method Detail

getDocumentElement

public OMElement getDocumentElement()
Method getRootElement

Specified by:
getDocumentElement in interface OMDocument
Returns:

setDocumentElement

public void setDocumentElement(OMElement rootElement)
Method setRootElement

Specified by:
setDocumentElement in interface OMDocument
Parameters:
rootElement -

isComplete

public boolean isComplete()
this will indicate whether parser has parsed this information item completely or not. If somethings info are not available in the item, one has to check this attribute to make sure that, this item has been parsed completely or not.

Specified by:
isComplete in interface OMContainer
Returns:

setComplete

public void setComplete(boolean state)
Method setComplete

Specified by:
setComplete in interface OMContainerEx
Parameters:
state -

buildNext

public void buildNext()
This will force the parser to proceed, if parser has not yet finished with the XML input

Specified by:
buildNext in interface OMContainer

addChild

public void addChild(OMNode child)
This will add child to the element. One can decide whether he append the child or he adds to the front of the children list

Specified by:
addChild in interface OMContainer
Parameters:
child -

getChildren

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

Specified by:
getChildren in interface OMContainer
Returns:

getChildrenWithName

public java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
                                       throws OMException
This will search for children with a given QName and will return an iterator to traverse through the OMNodes. This QName can contain any combination of prefix, localname and URI

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

getFirstChild

public OMNode getFirstChild()
Method getFirstChild

Specified by:
getFirstChild in interface OMContainer
Returns:

getFirstChildWithName

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

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

setFirstChild

public void setFirstChild(OMNode firstChild)
Method setFirstChild

Specified by:
setFirstChild in interface OMContainerEx
Parameters:
firstChild -

getCharsetEncoding

public java.lang.String getCharsetEncoding()
Returns the character set encoding scheme to be used

Specified by:
getCharsetEncoding in interface OMDocument
Returns:

setCharsetEncoding

public void setCharsetEncoding(java.lang.String charEncoding)
Set the character set encoding scheme

Specified by:
setCharsetEncoding in interface OMDocument
Parameters:
charEncoding -

isStandalone

public java.lang.String isStandalone()
Description copied from interface: OMDocument
XML standalone value This will be yes, no or null (if not available)

Specified by:
isStandalone in interface OMDocument
Returns:

setStandalone

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

getXMLVersion

public java.lang.String getXMLVersion()
Description copied from interface: OMDocument
Returns the XML version

Specified by:
getXMLVersion in interface OMDocument
Returns:

setXMLVersion

public void setXMLVersion(java.lang.String xmlVersion)
Description copied from interface: OMDocument
Sets the XML version

Specified by:
setXMLVersion in interface OMDocument
Parameters:
xmlVersion -
See Also:
XML 1.0, XML 1.1

serialize

public void serialize(OMOutputImpl omOutput,
                      boolean includeXMLDeclaration)
               throws XMLStreamException
Serialize the docuement with/without the XML declaration

Specified by:
serialize in interface OMDocument
Parameters:
omOutput -
includeXMLDeclaration - Whether to include the XML declaration or not
Throws:
XMLStreamException

serialize

public void serialize(OMOutputImpl omOutput)
               throws XMLStreamException
Serialize the document with the XML declaration

Specified by:
serialize in interface OMDocument
Parameters:
omOutput -
Throws:
XMLStreamException
See Also:
OMDocument.serialize(org.apache.axis2.om.impl.OMOutputImpl, boolean)

serializeWithCache

public void serializeWithCache(OMOutputImpl omOutput)
                        throws XMLStreamException
Serialize the document with cache

Specified by:
serializeWithCache in interface OMDocument
Parameters:
omOutput -
Throws:
XMLStreamException
See Also:
OMDocument.serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl)

serializeWithCache

public void serializeWithCache(OMOutputImpl omOutput,
                               boolean includeXMLDeclaration)
                        throws XMLStreamException
Serialize the document with cache

Specified by:
serializeWithCache in interface OMDocument
Parameters:
omOutput -
includeXMLDeclaration -
Throws:
XMLStreamException
See Also:
OMDocument.serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl, boolean)

serialize

protected void serialize(OMOutputImpl omOutput,
                         boolean cache,
                         boolean includeXMLDeclaration)
                  throws XMLStreamException
Throws:
XMLStreamException