org.exolab.adaptx.xml.dom2xpn

Class DocumentWrapperXPathNode

Implemented Interfaces:
java.io.Serializable

public class DocumentWrapperXPathNode
extends org.exolab.adaptx.xml.dom2xpn.ParentDOMXPathNode

An XPathNode wrapper for DOM Element nodes, used by the implementation of XPathNode for the W3C DOM API

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/01 07:39:35 $

Author:
Keith Visco

See Also:
Serialized Form

Field Summary

Fields inherited from class org.exolab.adaptx.xpath.XPathNode

ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, PI, ROOT, TEXT

Constructor Summary

DocumentWrapperXPathNode(Document document)
Creates a new DocumentWrapperXPathNode

Method Summary

String
getLocalName()
Returns the local name of the node.
String
getNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this 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.
int
getNodeType()
Returns the type of this node.
String
getStringValue()
Returns the string value of the node.

Methods inherited from class org.exolab.adaptx.xml.dom2xpn.ParentDOMXPathNode

getFirstChild, hasChildNodes

Methods inherited from class org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

getAttribute, getFirstAttribute, getFirstChild, getFirstNamespace, getLocalName, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNext, getNodeType, getParentNode, getPrevious, getRootNode, getStringValue, hasChildNodes

Methods inherited from class org.exolab.adaptx.xpath.XPathNode

getAttribute, getFirstAttribute, getFirstChild, getFirstNamespace, getLocalName, getNamespacePrefix, getNamespaceURI, getNamespaceURI, getNext, getNodeType, getParentNode, getPrevious, getRootNode, getStringValue, hasChildNodes

Constructor Details

DocumentWrapperXPathNode

public DocumentWrapperXPathNode(Document document)
Creates a new DocumentWrapperXPathNode

Parameters:
document - the Document that this XPathNode wraps. This must not be null.

Method Details

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.
Overrides:
getLocalName in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Returns:
The local name of the node, or null if the node has no name


getNamespacePrefix

public String getNamespacePrefix(String uri)
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node. Returns null if no prefix is defined for this namespace URI. Returns an empty string if the default prefix is associated with this namespace URI. This method is valid only for element nodes.
Overrides:
getNamespacePrefix in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Parameters:
uri - The namespace URI

Returns:
The namespace prefix, or null


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.
Overrides:
getNamespaceURI in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Returns:
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.
Overrides:
getNamespaceURI in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Parameters:
prefix - The namespace prefix

Returns:
The namespace URI, or null


getNodeType

public int getNodeType()
Returns the type of this node.
Overrides:
getNodeType in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Returns:
The type of this node


getStringValue

public String getStringValue()
Returns the string value of the node. The string value of a text node or an attribute node is it's 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.
Overrides:
getStringValue in interface org.exolab.adaptx.xml.dom2xpn.BaseDOMXPathNode

Returns:
The string value of the node