org.exist.dom
Class StoredNode

java.lang.Object
  extended byorg.exist.dom.NodeImpl
      extended byorg.exist.dom.StoredNode
All Implemented Interfaces:
org.w3c.dom.Node, QNameable, Visitable
Direct Known Subclasses:
CharacterDataImpl, DocumentTypeImpl, NamedNode, ProcessingInstructionImpl

public class StoredNode
extends NodeImpl
implements Visitable

The base class for all persistent DOM nodes in the database.

Author:
Wolfgang Meier

Field Summary
static long UNKNOWN_NODE_IMPL_ADDRESS
           
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
StoredNode(NodeProxy other)
           
StoredNode(short nodeType)
           
StoredNode(short nodeType, NodeId nodeId)
           
StoredNode(StoredNode other)
          Copy constructor: creates a copy of the other node.
 
Method Summary
 boolean accept(java.util.Iterator iterator, NodeVisitor visitor)
          Visit the current node.
 boolean accept(NodeVisitor visitor)
           
 void clear()
          Reset this object to its initial state.
static StoredNode deserialize(byte[] data, int start, int len, DocumentImpl doc)
          Read a node from the specified byte array.
static StoredNode deserialize(byte[] data, int start, int len, DocumentImpl doc, boolean pooled)
          Read a node from the specified byte array.
 boolean equals(java.lang.Object obj)
           
 DBBroker getBroker()
          Return the broker instance used to create this node.
 int getDocId()
           
 long getInternalAddress()
          Get the internal storage address of this node
 org.w3c.dom.Node getNextSibling()
           
 NodeId getNodeId()
           
 short getNodeType()
           
 org.w3c.dom.Document getOwnerDocument()
           
 org.w3c.dom.Node getParentNode()
           
 NodePath getPath()
           
 org.w3c.dom.Node getPreviousSibling()
           
 QName getQName()
           
 void release()
          Release all memory resources hold by this node.
 byte[] serialize()
           
 void setInternalAddress(long internalAddress)
          Set the internal storage address of this node.
 void setNodeId(NodeId dln)
           
 void setOwnerDocument(DocumentImpl ownerDocument)
          Set the owner document.
 java.lang.String toString()
           
 java.lang.String toString(boolean top)
           
 
Methods inherited from class org.exist.dom.NodeImpl
appendChild, appendChildren, cloneNode, compareDocumentPosition, getAttributes, getAttributesCount, getBaseURI, getChildCount, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeName, getNodeValue, getPrefix, getTextContent, getUserData, hasAttributes, hasChildNodes, insertAfter, insertAfter, insertBefore, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, removeChild, replaceChild, replaceChild, setAttributes, setNodeName, setNodeValue, setPrefix, setTextContent, setUserData, supports, updateChild, updateChild
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_NODE_IMPL_ADDRESS

public static final long UNKNOWN_NODE_IMPL_ADDRESS
See Also:
Constant Field Values
Constructor Detail

StoredNode

public StoredNode(short nodeType)

StoredNode

public StoredNode(short nodeType,
                  NodeId nodeId)

StoredNode

public StoredNode(StoredNode other)
Copy constructor: creates a copy of the other node.

Parameters:
other -

StoredNode

public StoredNode(NodeProxy other)
Method Detail

clear

public void clear()
Reset this object to its initial state. Required by the parser to be able to reuse node objects.


serialize

public byte[] serialize()

deserialize

public static StoredNode deserialize(byte[] data,
                                     int start,
                                     int len,
                                     DocumentImpl doc)
Read a node from the specified byte array. <<<<<<< .working ======= This checks the node type and calls the deserialize(byte[], int, int,DocumentImpl,boolean) method of the corresponding node class. >>>>>>> .merge-right.r4159

Parameters:
data -
start -
len -
doc -

deserialize

public static StoredNode deserialize(byte[] data,
                                     int start,
                                     int len,
                                     DocumentImpl doc,
                                     boolean pooled)
Read a node from the specified byte array. <<<<<<< .working This checks the node type and calls the deserialize(byte[], int, int, DocumentImpl, boolean) ======= This checks the node type and calls the deserialize(byte[], int, int,boolean) >>>>>>> .merge-right.r4159 method of the corresponding node class. The node will be allocated in the pool and should be released once it is no longer needed.

Parameters:
data -
start -
len -
doc -

getQName

public QName getQName()
Specified by:
getQName in interface QNameable

equals

public boolean equals(java.lang.Object obj)
See Also:
Object.equals(java.lang.Object)

getBroker

public DBBroker getBroker()
Return the broker instance used to create this node.


setNodeId

public void setNodeId(NodeId dln)

getNodeId

public NodeId getNodeId()

getInternalAddress

public long getInternalAddress()
Get the internal storage address of this node

Returns:
The internalAddress value

setInternalAddress

public void setInternalAddress(long internalAddress)
Set the internal storage address of this node.

Parameters:
internalAddress - The new internalAddress value

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface org.w3c.dom.Node
See Also:
Node.getNodeType()

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Specified by:
getOwnerDocument in interface org.w3c.dom.Node
See Also:
Node.getOwnerDocument()

setOwnerDocument

public void setOwnerDocument(DocumentImpl ownerDocument)
Set the owner document.

Parameters:
ownerDocument - The new ownerDocument value

getDocId

public int getDocId()

getParentNode

public org.w3c.dom.Node getParentNode()
Specified by:
getParentNode in interface org.w3c.dom.Node
See Also:
Node.getParentNode()

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()
Specified by:
getPreviousSibling in interface org.w3c.dom.Node
See Also:
Node.getPreviousSibling()

getNextSibling

public org.w3c.dom.Node getNextSibling()
Specified by:
getNextSibling in interface org.w3c.dom.Node
See Also:
Node.getNextSibling()

getPath

public NodePath getPath()

toString

public java.lang.String toString()

toString

public java.lang.String toString(boolean top)

release

public void release()
Release all memory resources hold by this node.


accept

public boolean accept(NodeVisitor visitor)

accept

public boolean accept(java.util.Iterator iterator,
                      NodeVisitor visitor)
Description copied from interface: Visitable
Visit the current node. For element nodes, the method recursively traverses through the child nodes and calls accept on each of them.

Specified by:
accept in interface Visitable
Parameters:
iterator - an iterator positioned at the current node
visitor - the visitor to call.
Returns:
the value returned by the NodeVisitor.visit method.


Copyright (C) Wolfgang Meier. All rights reserved.