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

java.lang.Object
  extended byorg.apache.axis2.om.impl.llom.OMNodeImpl
All Implemented Interfaces:
OMNode, OMNodeEx
Direct Known Subclasses:
OMCommentImpl, OMDocTypeImpl, OMElementImpl, OMProcessingInstructionImpl, OMTextImpl

public abstract class OMNodeImpl
extends java.lang.Object
implements OMNode, OMNodeEx

Class OMNodeImpl


Field Summary
protected  OMXMLParserWrapper builder
          Field builder
protected  boolean done
          Field done
protected  OMNodeImpl nextSibling
          Field nextSibling
protected  int nodeType
          Field nodeType
protected  OMContainerEx parent
          Field parent
protected  OMNodeImpl previousSibling
          Field previousSibling
 
Fields inherited from interface org.apache.axis2.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Constructor Summary
OMNodeImpl()
          Constructor OMNodeImpl
OMNodeImpl(OMContainer parent)
          For a node to exist there must be a parent
 
Method Summary
 void build()
          This will completely parse this node and build the object structure in the memory.
 OMNode detach()
          This will remove this information item and its children, from the model completely
 OMNode getNextSibling()
          This will give the next sibling.
 OMContainer getParent()
          This method should return the immediate parent of the node.
 OMNode getPreviousSibling()
          Method getPreviousSibling
 int getType()
          This is to get the type of node, as this is the super class of all the nodes
 void insertSiblingAfter(OMNode sibling)
          This will insert a sibling just after the current information item.
 void insertSiblingBefore(OMNode sibling)
          This will insert a sibling just before the current information item
 boolean isComplete()
          this will indicate whether parser has parsed this information item completely or not.
 void serialize(XMLStreamWriter xmlWriter)
          Serialize the node without caching
 void serializeWithCache(XMLStreamWriter xmlWriter)
          Serialize the node with caching
 void setComplete(boolean state)
          Method setComplete
 void setNextSibling(OMNode node)
          Method setNextSibling
 void setParent(OMContainer element)
          Method setParent
 void setPreviousSibling(OMNode previousSibling)
          Method setPreviousSibling
 void setType(int nodeType)
          Method setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axis2.om.OMNode
discard
 

Field Detail

parent

protected OMContainerEx parent
Field parent


nextSibling

protected OMNodeImpl nextSibling
Field nextSibling


previousSibling

protected OMNodeImpl previousSibling
Field previousSibling


builder

protected OMXMLParserWrapper builder
Field builder


done

protected boolean done
Field done


nodeType

protected int nodeType
Field nodeType

Constructor Detail

OMNodeImpl

public OMNodeImpl()
Constructor OMNodeImpl


OMNodeImpl

public OMNodeImpl(OMContainer parent)
For a node to exist there must be a parent

Parameters:
parent -
Method Detail

getParent

public OMContainer getParent()
                      throws OMException
This method should return the immediate parent of the node. Parent is always an Element

Specified by:
getParent in interface OMNode
Returns:
Throws:
OMException
OMException

setParent

public void setParent(OMContainer element)
Method setParent

Specified by:
setParent in interface OMNodeEx
Parameters:
element -

getNextSibling

public OMNode getNextSibling()
                      throws OMException
This will give the next sibling. This can be an OMAttribute for OMAttribute or OMText or OMELement for others.

Specified by:
getNextSibling in interface OMNode
Returns:
Throws:
OMException
OMException

setNextSibling

public void setNextSibling(OMNode node)
Method setNextSibling

Specified by:
setNextSibling in interface OMNodeEx
Parameters:
node -

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 OMNode
Returns:
boolean

setComplete

public void setComplete(boolean state)
Method setComplete

Specified by:
setComplete in interface OMNodeEx
Parameters:
state -

detach

public OMNode detach()
              throws OMException
This will remove this information item and its children, from the model completely

Specified by:
detach in interface OMNode
Throws:
OMException
OMException

insertSiblingAfter

public void insertSiblingAfter(OMNode sibling)
                        throws OMException
This will insert a sibling just after the current information item.

Specified by:
insertSiblingAfter in interface OMNode
Parameters:
sibling -
Throws:
OMException
OMException

insertSiblingBefore

public void insertSiblingBefore(OMNode sibling)
                         throws OMException
This will insert a sibling just before the current information item

Specified by:
insertSiblingBefore in interface OMNode
Parameters:
sibling -
Throws:
OMException
OMException

getType

public int getType()
            throws OMException
This is to get the type of node, as this is the super class of all the nodes

Specified by:
getType in interface OMNode
Returns:
Throws:
OMException
OMException

setType

public void setType(int nodeType)
             throws OMException
Method setType

Specified by:
setType in interface OMNodeEx
Parameters:
nodeType -
Throws:
OMException

getPreviousSibling

public OMNode getPreviousSibling()
Method getPreviousSibling

Specified by:
getPreviousSibling in interface OMNode
Returns:
boolean

setPreviousSibling

public void setPreviousSibling(OMNode previousSibling)
Method setPreviousSibling

Specified by:
setPreviousSibling in interface OMNodeEx
Parameters:
previousSibling -

build

public void build()
           throws OMException
This will completely parse this node and build the object structure in the memory. However a programmatically created node will have done set to true by default and will cause populateyourself not to work properly!

Specified by:
build in interface OMNode
Throws:
OMException

serializeWithCache

public void serializeWithCache(XMLStreamWriter xmlWriter)
                        throws XMLStreamException
Serialize the node with caching

Specified by:
serializeWithCache in interface OMNode
Parameters:
xmlWriter -
Throws:
javax.xml.stream.XMLStreamException
XMLStreamException
See Also:
#serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl)

serialize

public void serialize(XMLStreamWriter xmlWriter)
               throws XMLStreamException
Serialize the node without caching

Specified by:
serialize in interface OMNode
Parameters:
xmlWriter -
Throws:
javax.xml.stream.XMLStreamException
XMLStreamException
See Also:
#serialize(org.apache.axis2.om.impl.OMOutputImpl)