org.castor.xmlctf.xmldiff.xml.nodes
Class XMLNode
java.lang.Object
org.castor.xmlctf.xmldiff.xml.nodes.XMLNode
public abstract class XMLNode
extends java.lang.Object
The base node for all XMLNode types.
$Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
XMLNode(String namespace, String localName, int nodeType) - Creates a new XMLNode
|
String | getLocalName() - Returns the local name of the node.
|
String | getNamespaceURI() - Returns the namespace URI the node.
|
String | getNamespaceURI(String prefix) - Returns the namespace URI associated with this namespace prefix, as
defined in the context of this node.
|
String | getNodeLocation() - Finds and returns the location of this node in its root's tree.
|
int | getNodeType() - Returns the type of this node.
|
ParentNode | getParentNode() - Returns the parent node, or null if the node has no parent.
|
XMLNode | getRootNode() - Returns the root node.
|
abstract String | getStringValue() - Returns the string value of the node.
|
protected String | getXPath() - Returns the XPath from the root node to this node.
|
void | setNamespace(String namespace) - Sets the namespace URI for this XMLNode.
|
(package private) void | setParent(ParentNode node) - Sets the parent XMLNode.
|
ATTRIBUTE
public static final int ATTRIBUTE
Node is an attribute.
ELEMENT
public static final int ELEMENT
Node is an element.
PROCESSING_INSTRUCTION
public static final int PROCESSING_INSTRUCTION
Node is a processing instruction.
ROOT
public static final int ROOT
Node is a root node.
TEXT
public static final int TEXT
Node is a text node.
XMLNode
(package private) XMLNode(String namespace,
String localName,
int nodeType)
Creates a new XMLNode
namespace
- the namespace URI for this node. [May be null]localName
- the local-name of this node. [May be null]nodeType
- the node type being created
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.
- 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.
- The namespace URI of the node, or null if the node has no
namespace URI
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.
prefix
- The namespace prefix
- The namespace URI, or null
getNodeLocation
public String getNodeLocation()
Finds and returns the location of this node in its root's tree.
- the location of this node in its root's tree.
getNodeType
public final int getNodeType()
Returns the type of this node.
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.
getRootNode
public XMLNode getRootNode()
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.
- The string value of the node
getXPath
protected String getXPath()
Returns the XPath from the root node to this node.
- the XPath from the root node to this node.
setNamespace
public void setNamespace(String namespace)
Sets the namespace URI for this XMLNode.
namespace
- the Namespace URI
setParent
(package private) void setParent(ParentNode node)
Sets the parent XMLNode.
node
- the XMLNode which is the parent of this XMLNode
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com