com.plumtree.openfoundation.xml.dom
Class XPNode

java.lang.Object
  extended bycom.plumtree.openfoundation.xml.dom.XPNode
Direct Known Subclasses:
XPAttr, XPCharacterData, XPDocument, XPDocumentFragment, XPDocumentType, XPElement, XPProcessingInstruction

public class XPNode
extends java.lang.Object

The Node class is a wrapper class for objects implementing org.w3c.dom.node interface. Please refer to Node (Java 2 Platform SE v1.4.2) for detail information.

Author:
djc

Field Summary
static short ATTRIBUTE_NODE
          The underlying object is an org.w3c.dom.Attr.
static short CDATA_SECTION_NODE
          The underlying object is an org.w3c.dom.CDATASection.
static short COMMENT_NODE
          The underlying object is an org.w3c.dom.Comment.
static short DOCUMENT_FRAGMENT_NODE
          The underlying object is an org.w3c.dom.DocumentFragment.
static short DOCUMENT_NODE
          The underlying object is an org.w3c.dom.Document.
static short DOCUMENT_TYPE_NODE
          The underlying object is an org.w3c.dom.DocumentType.
static short ELEMENT_NODE
          The underlying object is an org.w3c.dom.Element.
static short PROCESSING_INSTRUCTION_NODE
          The underlying object is an org.w3c.dom.ProcessInstrusion.
static short TEXT_NODE
          The underlying object is an org.w3c.dom.Text.
 
Constructor Summary
XPNode()
          Creates a new XPNode object.
XPNode(org.w3c.dom.Node nodePlace)
          Creates a new XPNode object with Node.
 
Method Summary
 XPNode AppendChild(XPNode newChild)
          Adds the node newChild to the end of the list of children of this node.
 XPNode CloneNode(boolean deep)
          Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.
 XPNamedNodeMap GetAttributes()
          A XPNamedNodeMap containing the attributes of this node (if it is an XPElement) or null otherwise.
 XPNodeList GetChildNodes()
          A XPNodeList that contains all children of this node.
 XPNode GetFirstChild()
          The first child of this node.
 XPNode GetLastChild()
          The last child of this node.
 java.lang.String GetLocalName()
          Returns the local part of the qualified name of this node.
 java.lang.String GetNamespaceURI()
          The namespace URI of this node, or null if it is unspecified.
 XPNode GetNextSibling()
          The node immediately following this node.
 java.lang.String GetNodeName()
          The name of this node, depending on its type.
 short GetNodeType()
          A code representing the type of the underlying object.
 java.lang.String GetNodeValue()
          The value of this node, depending on its type.
 XPDocument GetOwnerDocument()
          The XPDocument object associated with this node.
 XPNode GetParentNode()
          The parent of this node.
 java.lang.String GetPrefix()
          The namespace prefix of this node, or null if it is unspecified.
 XPNode GetPreviousSibling()
          The node immediately preceding this node.
 org.w3c.dom.Node GetUnderlyingObject()
          Retrieve the underlying org.w3c.dom.Node object.
 boolean HasAttributes()
          Returns whether this node (if it is an element) has any attributes.
 boolean HasChildNodes()
          Returns whether this node has any children.
 XPNode InsertBefore(XPNode newChild, XPNode refChild)
          Inserts the node newChild before the existing child node refChild.
 boolean IsAttributeNode()
          Whether this underlying object is an Attr node.
 boolean IsCDATASectionNode()
          Whether this underlying object is a CDATASection node.
 boolean IsCommentNode()
          Whether this underlying object is a Comment node.
 boolean IsDocumentFragmentNode()
          Whether this underlying object is a DocumentFragment node.
 boolean IsDocumentNode()
          Whether this underlying object is a Document node.
 boolean IsDocumentTypeNode()
          Whether this underlying object is a DocumentType node.
 boolean IsElementNode()
          Whether this underlying object is a Element node.
 boolean IsProcessingInstructionNode()
          Whether this underlying object is a ProcessingInstruction node.
 boolean IsSupported(java.lang.String feature, java.lang.String version)
          Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
 boolean IsTextNode()
          Whether this underlying object is a Text node.
 void Normalize()
          Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes.
 XPNode RemoveChild(XPNode oldChild)
          Removes the child node indicated by oldChild from the list of children, and returns it.
 XPNode ReplaceChild(XPNode newChild, XPNode oldChild)
          Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.
 void SetNodeValue(java.lang.String nodeValue)
          The value of this node, depending on its type.
 void SetPrefix(java.lang.String prefix)
          The namespace prefix of this node, or null if it is unspecified.
protected  void StoreNode(org.w3c.dom.Node nodePlace)
          Store/set the underlying Node object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_NODE

public static short ATTRIBUTE_NODE
The underlying object is an org.w3c.dom.Attr.


CDATA_SECTION_NODE

public static short CDATA_SECTION_NODE
The underlying object is an org.w3c.dom.CDATASection.


COMMENT_NODE

public static short COMMENT_NODE
The underlying object is an org.w3c.dom.Comment.


DOCUMENT_FRAGMENT_NODE

public static short DOCUMENT_FRAGMENT_NODE
The underlying object is an org.w3c.dom.DocumentFragment.


DOCUMENT_NODE

public static short DOCUMENT_NODE
The underlying object is an org.w3c.dom.Document.


DOCUMENT_TYPE_NODE

public static short DOCUMENT_TYPE_NODE
The underlying object is an org.w3c.dom.DocumentType.


ELEMENT_NODE

public static short ELEMENT_NODE
The underlying object is an org.w3c.dom.Element.


PROCESSING_INSTRUCTION_NODE

public static short PROCESSING_INSTRUCTION_NODE
The underlying object is an org.w3c.dom.ProcessInstrusion.


TEXT_NODE

public static short TEXT_NODE
The underlying object is an org.w3c.dom.Text.

Constructor Detail

XPNode

public XPNode()
Creates a new XPNode object.


XPNode

public XPNode(org.w3c.dom.Node nodePlace)
Creates a new XPNode object with Node.

Parameters:
nodePlace - - underlying node object
Method Detail

AppendChild

public XPNode AppendChild(XPNode newChild)
Adds the node newChild to the end of the list of children of this node.

Parameters:
newChild - - node to be appended
Returns:
the appended child

CloneNode

public XPNode CloneNode(boolean deep)
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.

Parameters:
deep - - shallow or deep clone
Returns:
the cloned node

GetAttributes

public XPNamedNodeMap GetAttributes()
A XPNamedNodeMap containing the attributes of this node (if it is an XPElement) or null otherwise.

Returns:
a map of the attributes

GetChildNodes

public XPNodeList GetChildNodes()
A XPNodeList that contains all children of this node.

Returns:
all child nodes of this node

GetFirstChild

public XPNode GetFirstChild()
The first child of this node.

Returns:
the first child of the node

GetLastChild

public XPNode GetLastChild()
The last child of this node.

Returns:
the node's last child

GetLocalName

public java.lang.String GetLocalName()
Returns the local part of the qualified name of this node.

Returns:
the name of the node

GetNamespaceURI

public java.lang.String GetNamespaceURI()
The namespace URI of this node, or null if it is unspecified.

Returns:
namespace of the node

GetNextSibling

public XPNode GetNextSibling()
The node immediately following this node.

Returns:
node's next sibling

GetNodeName

public java.lang.String GetNodeName()
The name of this node, depending on its type.

Returns:
name

GetNodeType

public short GetNodeType()
A code representing the type of the underlying object.

Returns:
nodetype

GetNodeValue

public java.lang.String GetNodeValue()
The value of this node, depending on its type.

Returns:
value

GetOwnerDocument

public XPDocument GetOwnerDocument()
The XPDocument object associated with this node.

Returns:
ownder (XPDocument object) of the node

GetParentNode

public XPNode GetParentNode()
The parent of this node.

Returns:
parent of node

GetPrefix

public java.lang.String GetPrefix()
The namespace prefix of this node, or null if it is unspecified.

Returns:
prefix

GetPreviousSibling

public XPNode GetPreviousSibling()
The node immediately preceding this node.

Returns:
previous sibling

GetUnderlyingObject

public org.w3c.dom.Node GetUnderlyingObject()
Retrieve the underlying org.w3c.dom.Node object.

Returns:
underlying node

HasAttributes

public boolean HasAttributes()
Returns whether this node (if it is an element) has any attributes.

Returns:
true if this node has any attributes, false otherwise.

HasChildNodes

public boolean HasChildNodes()
Returns whether this node has any children.

Returns:
true if this node has any children, false otherwise.

IsAttributeNode

public boolean IsAttributeNode()
Whether this underlying object is an Attr node.

Returns:
true if this is an Attr node, false otherwise.

IsCDATASectionNode

public boolean IsCDATASectionNode()
Whether this underlying object is a CDATASection node.

Returns:
true if this is a CDATASection node, false otherwise.

IsCommentNode

public boolean IsCommentNode()
Whether this underlying object is a Comment node.

Returns:
true if this is a Comment node, false otherwise.

IsDocumentFragmentNode

public boolean IsDocumentFragmentNode()
Whether this underlying object is a DocumentFragment node.

Returns:
true if this is a DocumentFragment node, false otherwise.

IsDocumentNode

public boolean IsDocumentNode()
Whether this underlying object is a Document node.

Returns:
true if this is a Documentt node, false otherwise.

IsDocumentTypeNode

public boolean IsDocumentTypeNode()
Whether this underlying object is a DocumentType node.

Returns:
true if this is a DocumentType node, false otherwise.

IsElementNode

public boolean IsElementNode()
Whether this underlying object is a Element node.

Returns:
true if this is a Element node, false otherwise.

IsProcessingInstructionNode

public boolean IsProcessingInstructionNode()
Whether this underlying object is a ProcessingInstruction node.

Returns:
true if this is a ProcessingInstruction node, false otherwise.

IsTextNode

public boolean IsTextNode()
Whether this underlying object is a Text node.

Returns:
true if this is a Text node, false otherwise.

InsertBefore

public XPNode InsertBefore(XPNode newChild,
                           XPNode refChild)
Inserts the node newChild before the existing child node refChild. If refChild is null, insert newChild at the end of the list of children.

Parameters:
newChild - - child to be inserted
refChild - - child to be inserted before
Returns:
return the inserted node

IsSupported

public boolean IsSupported(java.lang.String feature,
                           java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.

Parameters:
feature - The name of the feature to test.
version - This is the version number of the feature to test.
Returns:
Returns true if the specified feature is supported on this node, false otherwise.

Normalize

public void Normalize()
Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes.


RemoveChild

public XPNode RemoveChild(XPNode oldChild)
Removes the child node indicated by oldChild from the list of children, and returns it.

Parameters:
oldChild - - child to be removed.
Returns:
return the removed node.

ReplaceChild

public XPNode ReplaceChild(XPNode newChild,
                           XPNode oldChild)
Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node.

Parameters:
newChild - - child to do the replacing
oldChild - - child to be replaced
Returns:
return the replaced child

SetNodeValue

public void SetNodeValue(java.lang.String nodeValue)
The value of this node, depending on its type.

Parameters:
nodeValue - - node to be set

SetPrefix

public void SetPrefix(java.lang.String prefix)
The namespace prefix of this node, or null if it is unspecified.

Parameters:
prefix - namespace prefix value.

StoreNode

protected void StoreNode(org.w3c.dom.Node nodePlace)
Store/set the underlying Node object.

Parameters:
nodePlace - - node to be stored.


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.