Class XMLNode

java.lang.Object
org.castor.xmlctf.xmldiff.xml.nodes.XMLNode
Direct Known Subclasses:
Attribute, ParentNode, ProcessingInstruction, Text

public abstract class XMLNode extends Object
The base node for all XMLNode types.
Since:
Castor 1.1
Version:
$Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
Author:
Edward Kuns
  • Field Details

  • Method Details

    • getNodeType

      public final int getNodeType()
      Returns the type of this node.
      Returns:
      The type of this node
    • getLocalName

      public String getLocalName()
      Returns the local name of the node. Returns the local name of an element or attribute, the prefix of a namespace node, the target of a processing instruction, or null for all other node types.
      Returns:
      The local name of the node, or null if the node has no name
    • getNamespaceURI

      public String getNamespaceURI()
      Returns the namespace URI the node. Returns the namespace URI of an element, attribute or namespace node, or null for all other node types.
      Returns:
      The namespace URI of the node, or null if the node has no namespace URI
    • getParentNode

      public ParentNode getParentNode()
      Returns the parent node, or null if the node has no parent. This method is valid on all node types except the root node. Attribute and namespace nodes have the element as their parent node.
      Returns:
      The parent node, or null
    • getRootNode

      public XMLNode getRootNode()
      Returns the root node.
      Returns:
      The root node
    • getStringValue

      public abstract String getStringValue()
      Returns the string value of the node. The string value of a text node or an attribute node is its text value. The string value of an element or a root node is the concatenation of the string value of all its child nodes. The string value of a namespace node is its namespace URI. The string value of a processing instruction is the instruction, and the string value of a comment is the comment text.
      Returns:
      The string value of the node
    • getNamespaceURI

      public String getNamespaceURI(String prefix)
      Returns the namespace URI associated with this namespace prefix, as defined in the context of this node. Returns null if the prefix is undefined. Returns empty if the prefix is defined and associated with no namespace. This method is valid only for element nodes.
      Parameters:
      prefix - The namespace prefix
      Returns:
      The namespace URI, or null
    • setNamespace

      public void setNamespace(String namespace)
      Sets the namespace URI for this XMLNode.
      Parameters:
      namespace - the Namespace URI
    • getNodeLocation

      public String getNodeLocation()
      Finds and returns the location of this node in its root's tree.
      Returns:
      the location of this node in its root's tree.
    • getXPath

      protected String getXPath()
      Returns the XPath from the root node to this node.
      Returns:
      the XPath from the root node to this node.