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

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.TreeNode
              extended byjd.xml.xpath.model.build.normal.CompositeNode
                  extended byjd.xml.xpath.model.build.normal.ElementNode
                      extended byjd.xml.xpath.model.build.normal.ComplexElementNode
All Implemented Interfaces:
XPathNode

final class ComplexElementNode
extends ElementNode

A ElementNode with attributes and/or namespace declarations.


Field Summary
protected  TreeNode firstChild_
           
protected  NodeName name_
           
protected  TreeNode next_
           
protected  CompositeNode parent_
           
protected  TreeNode previous_
           
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
ComplexElementNode(NodeName name, NamespaceContext namespaceContext)
          Create a ComplexElementNode.
 
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[] getAttributes()
          Return the Attributes of this XPathNode.
 XPathNode getCacheableNode()
          Return this.
 int getChildCount()
          Return 0.
 XPathNode getFirstChild()
          Return the first child.
(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 getLocalName()
          Return the XPath local name.
 String getName()
          Return the element name.
 NamespaceContext getNamespaceContext()
          Return the namespace context of the node.
 XPathNode[] getNamespaceNodes()
          Return the NamespaceNodes of this XPathNode.
 String getNamespaceUri()
          Return the XPath namespace uri.
 XPathNode getNextSibling()
          Return the next XPathNode sibling.
 NodeName getNodeName()
          Return the attribute node name.
 XPathNode getParent()
          Return the parent XPathNode.
 String getPrefix()
          Return the prefix of the node.
 XPathNode getPrevSibling()
          Return the previous XPathNode sibling.
 XPathRootNode getRoot()
          Return the root.
 String getTextValue()
          Return the concatenation of the value of all text node descendants.
 int getType()
          Return the type.
 String getValue()
          Return the string-value of the node.
 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 increaseChildCount()
           
(package private)  boolean isComplexElement()
           
 boolean preserveSpace()
          Return if a text child with whitespace text should be preserved.
(package private)  void setAttributes(AttributeNode[] attributes)
          Set the Attributes of this XPathNode.
(package private)  void setFirstChild(TreeNode child)
           
(package private)  void setNextSibling(TreeNode node)
           
(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, getBaseUri, getFirstSibling, getInheritedAttribute, getLanguage, getTypeName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name_

protected NodeName name_

firstChild_

protected TreeNode firstChild_

next_

protected TreeNode next_

previous_

protected TreeNode previous_

parent_

protected CompositeNode parent_

serialNumber_

protected int serialNumber_
Constructor Detail

ComplexElementNode

public ComplexElementNode(NodeName name,
                          NamespaceContext namespaceContext)
Create a ComplexElementNode.

Method Detail

isComplexElement

boolean isComplexElement()
Overrides:
isComplexElement in class CompositeNode

setAttributes

void setAttributes(AttributeNode[] attributes)
Set the Attributes of this XPathNode.


getAttributes

public XPathNode[] getAttributes()
Return the Attributes of this XPathNode.

Specified by:
getAttributes in interface XPathNode
Overrides:
getAttributes in class AbstractXPathNode
Returns:
null if the ElementNode has no attributes.

createCopy

Node createCopy()
Overrides:
createCopy in class ElementNode

getNamespaceContext

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

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

getType

public final int getType()
Return the type.

Returns:
a type constant

getValue

public final String getValue()
Return the string-value of the node.


getNodeName

public NodeName getNodeName()
Return the attribute node name.

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

getName

public final String getName()
Return the element name.

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

getPrefix

public String getPrefix()
Return the prefix of the node.

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

getLocalName

public String getLocalName()
Return the XPath local name.

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

getNamespaceUri

public String getNamespaceUri()
Return the XPath namespace uri.

Specified by:
getNamespaceUri in interface XPathNode
Overrides:
getNamespaceUri 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

getNamespaceNodes

public XPathNode[] getNamespaceNodes()
Return the NamespaceNodes of this XPathNode.

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

preserveSpace

public boolean preserveSpace()
Return if a text child with whitespace text should be preserved.

Specified by:
preserveSpace in class CompositeNode

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

getChildCount

public int getChildCount()
Return 0.

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

increaseChildCount

void increaseChildCount()

getFirstChild

public final XPathNode getFirstChild()
Return the first child.

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

getFirstChildImpl

Node getFirstChildImpl()
Return null.

Overrides:
getFirstChildImpl in class Node

setFirstChild

void setFirstChild(TreeNode child)

getTextValue

public String getTextValue()
Return the concatenation of the value of all text node descendants.


copy

Node copy(CompositeNode parent)
Overrides:
copy in class Node

getNextSibling

public final XPathNode getNextSibling()
Return the next XPathNode sibling.

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

getPrevSibling

public final XPathNode getPrevSibling()
Return the previous XPathNode sibling.

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

setNextSibling

void setNextSibling(TreeNode node)

getRoot

public XPathRootNode getRoot()
Return the root.


getParent

public XPathNode getParent()
Return the parent XPathNode.


getCacheableNode

public XPathNode getCacheableNode()
Return this.


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.


equalsNode

public boolean equalsNode(XPathNode node)
Test if the node equals the given 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)

getLineNumber

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

Returns:
the line number or -1 if not known