com.jclark.xsl.dom
Class NodeBase

java.lang.Object
  extended by com.jclark.xsl.dom.NodeBase
All Implemented Interfaces:
Node, javax.xml.transform.SourceLocator
Direct Known Subclasses:
AttributeNode, CommentNode, ContainerNode, ProcessingInstructionNode, TextNode

abstract class NodeBase
extends java.lang.Object
implements Node

Base class wrapper which presents our xt om Node interface around a W3C Level 1 DOM node


Field Summary
(package private)  org.w3c.dom.Node domNode
           
(package private)  int level
           
(package private)  ContainerNode parent
           
(package private)  RootNode root
           
 
Fields inherited from interface com.jclark.xsl.om.Node
ALLTYPES, ATTRIBUTE, COMMENT, ELEMENT, N_TYPES, NAMESPACE, PROCESSING_INSTRUCTION, ROOT, TEXT
 
Constructor Summary
NodeBase(org.w3c.dom.Node domNode)
           
NodeBase(org.w3c.dom.Node domNode, ContainerNode parent, int childIndex)
           
 
Method Summary
 int compareTo(Node node)
          also compares document order
 boolean equals(java.lang.Object obj)
           
 Node getAttribute(Name name)
          default behavior -- return null.
 SafeNodeIterator getAttributes()
          does this only work on Elements?
 java.lang.String getAttributeValue(Name name)
          default behavior -- return null.
 SafeNodeIterator getChildren()
          as the name implies ...
 int getColumnNumber()
           
 java.lang.String getData()
          default behavior -- return null.
 Node getElementWithId(java.lang.String id)
          finds an Element Node, in the this node's document, with the given ID
 SafeNodeIterator getFollowingSiblings()
          as the name implies ...
 java.lang.String getGeneratedId()
          guaranteed to be unique (and repeatable)
 int getLineNumber()
          if decorated with locator events, this returns the line number in the XML source where this node was found
 Name getName()
          default behavior -- return null.
 NamespacePrefixMap getNamespacePrefixMap()
          in-scope namespaces ??
 SafeNodeIterator getNamespaces()
          does this only work on Elements?
 Node getParent()
          as the name implies ...
 java.lang.String getPublicId()
           
 Node getRoot()
          gets the owning Document's root
 java.lang.String getSystemId()
           
 java.lang.String getUnparsedEntityURI(java.lang.String name)
           
 java.net.URL getURL()
          base URL ??
 boolean isId(java.lang.String id)
          if this is an attribute?? and it is of type ID ?
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jclark.xsl.om.Node
getType
 

Field Detail

domNode

final org.w3c.dom.Node domNode

level

int level

parent

ContainerNode parent

root

RootNode root
Constructor Detail

NodeBase

NodeBase(org.w3c.dom.Node domNode)

NodeBase

NodeBase(org.w3c.dom.Node domNode,
         ContainerNode parent,
         int childIndex)
Method Detail

getParent

public Node getParent()
Description copied from interface: Node
as the name implies ...

Specified by:
getParent in interface Node

getGeneratedId

public java.lang.String getGeneratedId()
Description copied from interface: Node
guaranteed to be unique (and repeatable)

Specified by:
getGeneratedId in interface Node

compareTo

public int compareTo(Node node)
Description copied from interface: Node
also compares document order

Specified by:
compareTo in interface Node

getData

public java.lang.String getData()
default behavior -- return null. Descendant classes override

Specified by:
getData in interface Node

getName

public Name getName()
default behavior -- return null. Descendant classes override

Specified by:
getName in interface Node

getAttributeValue

public java.lang.String getAttributeValue(Name name)
default behavior -- return null. Descendant classes override

Specified by:
getAttributeValue in interface Node

getAttribute

public Node getAttribute(Name name)
default behavior -- return null. Descendant classes override

Specified by:
getAttribute in interface Node

getElementWithId

public Node getElementWithId(java.lang.String id)
Description copied from interface: Node
finds an Element Node, in the this node's document, with the given ID

Specified by:
getElementWithId in interface Node

isId

public boolean isId(java.lang.String id)
Description copied from interface: Node
if this is an attribute?? and it is of type ID ?

Specified by:
isId in interface Node

getNamespacePrefixMap

public NamespacePrefixMap getNamespacePrefixMap()
Description copied from interface: Node
in-scope namespaces ??

Specified by:
getNamespacePrefixMap in interface Node

getUnparsedEntityURI

public java.lang.String getUnparsedEntityURI(java.lang.String name)
Specified by:
getUnparsedEntityURI in interface Node

getChildren

public SafeNodeIterator getChildren()
Description copied from interface: Node
as the name implies ...

Specified by:
getChildren in interface Node

getAttributes

public SafeNodeIterator getAttributes()
Description copied from interface: Node
does this only work on Elements?

Specified by:
getAttributes in interface Node

getNamespaces

public SafeNodeIterator getNamespaces()
Description copied from interface: Node
does this only work on Elements?

Specified by:
getNamespaces in interface Node

getURL

public java.net.URL getURL()
Description copied from interface: Node
base URL ??

Specified by:
getURL in interface Node

getSystemId

public java.lang.String getSystemId()
Specified by:
getSystemId in interface javax.xml.transform.SourceLocator

getPublicId

public java.lang.String getPublicId()
Specified by:
getPublicId in interface javax.xml.transform.SourceLocator

getLineNumber

public int getLineNumber()
Description copied from interface: Node
if decorated with locator events, this returns the line number in the XML source where this node was found

Specified by:
getLineNumber in interface Node
Specified by:
getLineNumber in interface javax.xml.transform.SourceLocator

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface javax.xml.transform.SourceLocator

getFollowingSiblings

public SafeNodeIterator getFollowingSiblings()
Description copied from interface: Node
as the name implies ...

Specified by:
getFollowingSiblings in interface Node

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getRoot

public Node getRoot()
Description copied from interface: Node
gets the owning Document's root

Specified by:
getRoot in interface Node