jd.xml.xpath.model.build.normal
Class NamespaceNode

java.lang.Object
  extended byjd.xml.xpath.model.build.AbstractXPathNode
      extended byjd.xml.xpath.model.build.normal.Node
          extended byjd.xml.xpath.model.build.normal.NamespaceNode
All Implemented Interfaces:
XPathNode

class NamespaceNode
extends Node

NamespaceNode represents a XPath namespace node.


Field Summary
protected  CompositeNode parent_
           
protected  int serialNumber_
           
 
Fields inherited from interface jd.xml.xpath.model.XPathNode
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, PI, ROOT, TEXT, TYPE_NAMES, TYPES, UNKNOWN
 
Constructor Summary
NamespaceNode(String prefix, String uri, ElementNode parent)
           
 
Method Summary
 void accept(NodeVisitor visitor)
          Dispatch method for NodeVisitors.
 int compareToNode(XPathNode node)
          Compare to another XPathNode from the same document.
(package private)  Node copy(CompositeNode parent)
           
(package private)  Node createCopy()
           
 boolean equalsNode(XPathNode node)
          Test if the node equals the given node.
 XPathNode getCacheableNode()
          Return this.
(package private)  Node getFirstChildImpl()
          Return null.
 String getGlobalId()
          Return an unique identifier for the node.
 int getLineNumber()
          Return the line number of this node in a source document.
 int getLocalId()
          Return a number for the node that is unique within the document.
 String getName()
          Return the XPath name of the node.
 NamespaceContext getNamespaceContext()
          Return the namespace context of the node.
 XPathNode getNextSibling()
          Return the next XPathNode sibling.
 XPathNode getParent()
          Return the parent XPathNode.
 XPathNode getPrevSibling()
          Return the previous XPathNode sibling.
 XPathRootNode getRoot()
          Return the root.
 int getType()
          Return the type.
 String getValue()
          Return the namespaceUri.
 boolean hasName(NodeName name)
          Test if the node name equals the given name.
 boolean hasNamespaceUri(NodeName name)
          Test if the namespace uri of this node equals the uri of the given NodeName.
(package private)  void setSerialNumber(int serialNumber)
           
 String toString()
          Return a string representation of the node.
 
Methods inherited from class jd.xml.xpath.model.build.AbstractXPathNode
equals, getAttributes, getBaseUri, getChildCount, getFirstChild, getFirstSibling, getInheritedAttribute, getLanguage, getLocalName, getNamespaceNodes, getNamespaceUri, getNodeName, getPrefix, getTypeName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

parent_

protected CompositeNode parent_

serialNumber_

protected int serialNumber_
Constructor Detail

NamespaceNode

public NamespaceNode(String prefix,
                     String uri,
                     ElementNode parent)
Method Detail

getType

public int getType()
Return the type.

Returns:
a type constant

getName

public String getName()
Return the XPath name of the node.

Specified by:
getName in interface XPathNode
Overrides:
getName in class AbstractXPathNode

hasName

public boolean hasName(NodeName name)
Test if the node name equals the given name.

Specified by:
hasName in interface XPathNode
Overrides:
hasName in class AbstractXPathNode

hasNamespaceUri

public boolean hasNamespaceUri(NodeName name)
Test if the namespace uri of this node equals the uri of the given NodeName.

Specified by:
hasNamespaceUri in interface XPathNode
Overrides:
hasNamespaceUri in class AbstractXPathNode

getValue

public String getValue()
Return the namespaceUri.


equalsNode

public boolean equalsNode(XPathNode node)
Test if the node equals the given node.

Specified by:
equalsNode in interface XPathNode
Overrides:
equalsNode in class Node

accept

public void accept(NodeVisitor visitor)
Dispatch method for NodeVisitors.


toString

public String toString()
Return a string representation of the node.

Specified by:
toString in interface XPathNode
Specified by:
toString in class Node

getRoot

public XPathRootNode getRoot()
Return the root.


getParent

public XPathNode getParent()
Return the parent XPathNode.


getFirstChildImpl

Node getFirstChildImpl()
Return null.


getNextSibling

public XPathNode getNextSibling()
Return the next XPathNode sibling.

Returns:
the next sibling or null

getPrevSibling

public XPathNode getPrevSibling()
Return the previous XPathNode sibling.

Returns:
the previous sibling or null

getCacheableNode

public XPathNode getCacheableNode()
Return this.


getNamespaceContext

public NamespaceContext getNamespaceContext()
Return the namespace context of the node.


getLocalId

public int getLocalId()
Return a number for the node that is unique within the document.


getGlobalId

public String getGlobalId()
Return an unique identifier for the node.


compareToNode

public int compareToNode(XPathNode node)
Compare to another XPathNode from the same document. Return a negative or a positive integer as this node comes before or after the argument node in document order. Return zero if the node equal this node.


setSerialNumber

void setSerialNumber(int serialNumber)

copy

Node copy(CompositeNode parent)

createCopy

Node createCopy()

getLineNumber

public int getLineNumber()
Return the line number of this node in a source document.

Returns:
the line number or -1 if not known