org.apache.axiom.om.impl.dom
Class ChildNode

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.NodeImpl
      extended by org.apache.axiom.om.impl.dom.ChildNode
All Implemented Interfaces:
Cloneable, OMNodeEx, OMNode, OMSerializable, Node, NodeList
Direct Known Subclasses:
CharacterImpl, DocumentTypeImpl, ParentNode, ProcessingInstructionImpl

public abstract class ChildNode
extends NodeImpl


Field Summary
protected  ChildNode nextSibling
           
protected  ParentNode parentNode
           
protected  ChildNode previousSibling
           
 
Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMNode
DTD_NODE, PI_NODE, SPACE_NODE
 
Constructor Summary
protected ChildNode(DocumentImpl ownerDocument, OMFactory factory)
           
protected ChildNode(OMFactory factory)
           
 
Method Summary
 Node cloneNode(boolean deep)
           
 OMNode detach()
          Removes a node (and all of its children) from its containing parent.
 void discard()
          Discards a node.
 OMNode getNextOMSibling()
          Default behavior returns null, overriden in ChildNode.
 OMNode getNextOMSiblingIfAvailable()
          Get the next sibling if it is available.
 Node getNextSibling()
          Returns the next child of this node's parent, or null if none.
 OMContainer getParent()
          Returns the parent containing node.
 Node getParentNode()
           
 OMNode getPreviousOMSibling()
          Default behavior returns null, overriden in ChildNode.
 Node getPreviousSibling()
          Returns the previous child of this node's parent, or null if none.
 void insertSiblingAfter(OMNode sibling)
          Inserts the given sibling next to this item.
 void insertSiblingBefore(OMNode sibling)
          Inserts the given sibling before this item.
 void setNextOMSibling(OMNode node)
           
 void setParent(OMContainer element)
           
 void setPreviousOMSibling(OMNode node)
           
 
Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
appendChild, build, buildWithAttachments, close, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNamespaceURI, getNodeValue, getOMFactory, getOwnerDocument, getPrefix, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNodeValue, setOwnerDocument, setPrefix, setTextContent, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType
 
Methods inherited from interface org.apache.axiom.om.impl.OMNodeEx
internalSerialize, setType
 
Methods inherited from interface org.apache.axiom.om.OMNode
getType
 

Field Detail

previousSibling

protected ChildNode previousSibling

nextSibling

protected ChildNode nextSibling

parentNode

protected ParentNode parentNode
Constructor Detail

ChildNode

protected ChildNode(DocumentImpl ownerDocument,
                    OMFactory factory)
Parameters:
ownerDocument -

ChildNode

protected ChildNode(OMFactory factory)
Method Detail

getNextOMSibling

public OMNode getNextOMSibling()
                        throws OMException
Description copied from class: NodeImpl
Default behavior returns null, overriden in ChildNode.

Specified by:
getNextOMSibling in interface OMNode
Overrides:
getNextOMSibling in class NodeImpl
Returns:
Returns the next sibling in document order.
Throws:
OMException

getNextOMSiblingIfAvailable

public OMNode getNextOMSiblingIfAvailable()
Description copied from interface: OMNodeEx
Get the next sibling if it is available. The sibling is available if it is complete or if the builder has started building the node. In the latter case, OMSerializable.isComplete() may return false when called on the sibling. In contrast to OMNode.getNextOMSibling(), this method will never modify the state of the underlying parser.

Specified by:
getNextOMSiblingIfAvailable in interface OMNodeEx
Overrides:
getNextOMSiblingIfAvailable in class NodeImpl
Returns:
the next sibling or null if the node has no next sibling or the builder has not yet started to build the next sibling

getNextSibling

public Node getNextSibling()
Description copied from class: NodeImpl
Returns the next child of this node's parent, or null if none.

Specified by:
getNextSibling in interface Node
Overrides:
getNextSibling in class NodeImpl

getPreviousOMSibling

public OMNode getPreviousOMSibling()
Description copied from class: NodeImpl
Default behavior returns null, overriden in ChildNode.

Specified by:
getPreviousOMSibling in interface OMNode
Overrides:
getPreviousOMSibling in class NodeImpl
Returns:
Returns node.

getPreviousSibling

public Node getPreviousSibling()
Description copied from class: NodeImpl
Returns the previous child of this node's parent, or null if none.

Specified by:
getPreviousSibling in interface Node
Overrides:
getPreviousSibling in class NodeImpl

setNextOMSibling

public void setNextOMSibling(OMNode node)
Specified by:
setNextOMSibling in interface OMNodeEx
Overrides:
setNextOMSibling in class NodeImpl

setPreviousOMSibling

public void setPreviousOMSibling(OMNode node)
Specified by:
setPreviousOMSibling in interface OMNodeEx
Overrides:
setPreviousOMSibling in class NodeImpl

getParent

public OMContainer getParent()
                      throws OMException
Description copied from interface: OMNode
Returns the parent containing node.

Returns the parent container, which may be either an OMDocument or OMElement.

Specified by:
getParent in interface OMNode
Overrides:
getParent in class NodeImpl
Returns:
The OMContainer of the node.
Throws:
OMException

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node
Overrides:
getParentNode in class NodeImpl

setParent

public void setParent(OMContainer element)

detach

public OMNode detach()
              throws OMException
Description copied from interface: OMNode
Removes a node (and all of its children) from its containing parent.

Removes a node from its parent. Partially complete nodes will be completed before they are detached from the model. A node cannot be detached until its next sibling has been identified, so that the next sibling and parent can be updated appropriately. Please note that this will not handle the namespaces. For example, if there you have used a namespace within the detaching node and which is defined outside the detaching node, user has to handle it manually.

Specified by:
detach in interface OMNode
Overrides:
detach in class NodeImpl
Returns:
The detached node. This is always the instance on which this method is invoked.
Throws:
OMException - If a node is not complete, the detach can trigger further parsing, which may cause an exception.

discard

public void discard()
             throws OMException
Description copied from interface: OMNode
Discards a node.

Discard goes to the parser level and if the element is not completely built, then it will be completely skipped at the parser level.

Throws:
OMException

insertSiblingAfter

public void insertSiblingAfter(OMNode sibling)
                        throws OMException
Inserts the given sibling next to this item.

Specified by:
insertSiblingAfter in interface OMNode
Overrides:
insertSiblingAfter in class NodeImpl
Parameters:
sibling - The node that will be added after the current node.
Throws:
OMException - if the current node has no parent

insertSiblingBefore

public void insertSiblingBefore(OMNode sibling)
                         throws OMException
Inserts the given sibling before this item.

Specified by:
insertSiblingBefore in interface OMNode
Overrides:
insertSiblingBefore in class NodeImpl
Parameters:
sibling - The node that will be added before the current node.
Throws:
OMException - if the current node has no parent

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node
Overrides:
cloneNode in class NodeImpl


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