jd.xml.xpath.model.build
Class AbstractXPathNode

java.lang.Object
  extended byjd.xml.xpath.model.build.AbstractXPathNode
All Implemented Interfaces:
XPathNode
Direct Known Subclasses:
Node

public abstract class AbstractXPathNode
extends Object
implements XPathNode

An incomplete implementation of XPathNode with reasonable defaults for most node types.


Field Summary
 
Fields inherited from interface jd.xml.xpath.model.XPathNode
ATTRIBUTE, COMMENT, ELEMENT, NAMESPACE, PI, ROOT, TEXT, TYPE_NAMES, TYPES, UNKNOWN
 
Constructor Summary
AbstractXPathNode()
           
 
Method Summary
 boolean equals(Object object)
          Test if an object is equal to this node.
 XPathNode[] getAttributes()
          Return null.
 String getBaseUri()
          Return the base uri of the node.
 int getChildCount()
          Return 0.
 XPathNode getFirstChild()
          Return null.
 XPathNode getFirstSibling()
          Return the first sibling.
protected  String getInheritedAttribute(String namespaceUri, String name)
          Return an attribute, that is declared for the given node or one of its ancestors.
 String getLanguage()
          Return the language of the node.
 String getLocalName()
          Returns getName().
 String getName()
          Return null.
 XPathNode[] getNamespaceNodes()
          Return null.
 String getNamespaceUri()
          Return null.
 NodeName getNodeName()
          Return null.
 String getPrefix()
          Return null.
 String getTypeName()
          Return the name of the type.
 int hashCode()
          Return a hashCode.
 boolean hasName(NodeName name)
          Return false.
 boolean hasNamespaceUri(NodeName name)
          Return false.
abstract  String toString()
          Return a string representation of the node.
 String toString(String param)
          Return a string representation of the node.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jd.xml.xpath.model.XPathNode
accept, compareToNode, equalsNode, getCacheableNode, getGlobalId, getLineNumber, getLocalId, getNamespaceContext, getNextSibling, getParent, getPrevSibling, getRoot, getType, getValue
 

Constructor Detail

AbstractXPathNode

public AbstractXPathNode()
Method Detail

getTypeName

public String getTypeName()
Return the name of the type.

Specified by:
getTypeName in interface XPathNode

getChildCount

public int getChildCount()
Return 0.

Specified by:
getChildCount in interface XPathNode

getFirstChild

public XPathNode getFirstChild()
Return null.

Specified by:
getFirstChild in interface XPathNode
Returns:
the first child or null

getFirstSibling

public XPathNode getFirstSibling()
Return the first sibling.

Specified by:
getFirstSibling in interface XPathNode

getNodeName

public NodeName getNodeName()
Return null.

Specified by:
getNodeName in interface XPathNode
Returns:
the name or null if the node has no name

getName

public String getName()
Return null.

Specified by:
getName in interface XPathNode

getLocalName

public String getLocalName()
Returns getName().

Specified by:
getLocalName in interface XPathNode

getPrefix

public String getPrefix()
Return null.

Specified by:
getPrefix in interface XPathNode

getNamespaceUri

public String getNamespaceUri()
Return null.

Specified by:
getNamespaceUri in interface XPathNode

hasName

public boolean hasName(NodeName name)
Return false.

Specified by:
hasName in interface XPathNode

hasNamespaceUri

public boolean hasNamespaceUri(NodeName name)
Return false.

Specified by:
hasNamespaceUri in interface XPathNode

getAttributes

public XPathNode[] getAttributes()
Return null.

Specified by:
getAttributes in interface XPathNode
Returns:
null if the node is not a ElementNode or has no attributes.

getLanguage

public String getLanguage()
Return the language of the node.

Specified by:
getLanguage in interface XPathNode

getBaseUri

public String getBaseUri()
Return the base uri of the node.

Specified by:
getBaseUri in interface XPathNode

getInheritedAttribute

protected String getInheritedAttribute(String namespaceUri,
                                       String name)
Return an attribute, that is declared for the given node or one of its ancestors.

Parameters:
namespaceUri - the namespace uri of the attribute or null
name - the attribute name or local name if namespaceUri is not null
Returns:
the attribute value or null if no one is defined.

getNamespaceNodes

public XPathNode[] getNamespaceNodes()
Return null.

Specified by:
getNamespaceNodes in interface XPathNode
Returns:
null if the node is not a ElementNode or has no attributes.

equals

public boolean equals(Object object)
Test if an object is equal to this node.

Specified by:
equals in interface XPathNode

hashCode

public int hashCode()
Return a hashCode.

Specified by:
hashCode in interface XPathNode

toString

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

Specified by:
toString in interface XPathNode

toString

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