net.sf.saxon.tinytree
Class TinyElementImpl

java.lang.Object
  extended by net.sf.saxon.om.AbstractNode
      extended by net.sf.saxon.tinytree.TinyNodeImpl
          extended by net.sf.saxon.tinytree.TinyParentNodeImpl
              extended by net.sf.saxon.tinytree.TinyElementImpl
All Implemented Interfaces:
DOMLocator, Source, SourceLocator, Item, NodeInfo, Element, Node

final class TinyElementImpl
extends TinyParentNodeImpl
implements Element

A node in the XML parse tree representing an XML element.

This class is an implementation of NodeInfo and also implements the DOM Element interface

Author:
Field Summary
 
Fields inherited from class net.sf.saxon.tinytree.TinyNodeImpl
document, nodeNr, parent
 
Fields inherited from class net.sf.saxon.om.AbstractNode
NODE_LETTER
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface net.sf.saxon.om.NodeInfo
ALL_NAMESPACES, LOCAL_NAMESPACES, NO_NAMESPACES
 
Constructor Summary
TinyElementImpl(TinyDocumentImpl doc, int nodeNr)
          Constructor
 
Method Summary
 void copy(Receiver receiver, int whichNamespaces, boolean copyAnnotations)
          Copy this node to a given outputter
 void copyRUUD(Receiver receiver, int whichNamespaces, boolean copyAnnotations)
           
 String getAttributeValue(int fingerprint)
          Get the value of a given attribute of this node
 String getBaseURI()
          Get the base URI of this element node.
 int getNodeKind()
          Return the type of node.
 int getTypeAnnotation()
          Get the type annotation of this node, if any Returns Type.UNTYPED_ANY if there is no type annotation
 boolean hasAttributes()
          Returns whether this node (if it is an element) has any attributes.
 void outputNamespaceNodes(Receiver out, boolean includeAncestors)
          Output all namespace nodes associated with this element.
 void setAttribute(String name, String value)
          Set the value of an attribute on the current element.
 
Methods inherited from class net.sf.saxon.tinytree.TinyParentNodeImpl
getStringValue, hasChildNodes
 
Methods inherited from class net.sf.saxon.tinytree.TinyNodeImpl
compareOrder, generateId, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getOriginatingNode, getParent, getPrefix, getRoot, getSequenceNumber, getSystemId, getURI, isSameNode, iterateAxis, iterateAxis, setParentNode, setSystemId
 
Methods inherited from class net.sf.saxon.om.AbstractNode
appendChild, appendData, cloneNode, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createEntityReference, createProcessingInstruction, createTextNode, deleteData, disallowUpdate, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getChildNodes, getColumnNumber, getData, getDoctype, getDocumentElement, getElementById, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getImplementation, getLastChild, getLength, getLocalName, getName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getOwnerElement, getParentNode, getPreviousSibling, getPublicId, getSpecified, getTagName, getTypedValue, getValue, hasAttribute, hasAttributeNS, importNode, insertBefore, insertData, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, replaceData, setAttributeNode, setAttributeNodeNS, setAttributeNS, setData, setNodeValue, setPrefix, setValue, splitText, substringData, supports
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

TinyElementImpl

public TinyElementImpl(TinyDocumentImpl doc,
                       int nodeNr)
Constructor

Method Detail

getNodeKind

public final int getNodeKind()
Return the type of node.

Specified by:
getNodeKind in interface NodeInfo
Returns:
Type.ELEMENT
See Also:
Type

getBaseURI

public String getBaseURI()
Get the base URI of this element node. This will be the same as the System ID unless xml:base has been used.

Specified by:
getBaseURI in interface NodeInfo
Specified by:
getBaseURI in interface Node
Overrides:
getBaseURI in class TinyNodeImpl
Returns:
the base URI of the node

getTypeAnnotation

public int getTypeAnnotation()
Get the type annotation of this node, if any Returns Type.UNTYPED_ANY if there is no type annotation

Specified by:
getTypeAnnotation in interface NodeInfo
Overrides:
getTypeAnnotation in class AbstractNode
Returns:
the type annotation of the node.
See Also:
Type

outputNamespaceNodes

public void outputNamespaceNodes(Receiver out,
                                 boolean includeAncestors)
                          throws TransformerException
Output all namespace nodes associated with this element.

Specified by:
outputNamespaceNodes in interface NodeInfo
Overrides:
outputNamespaceNodes in class TinyNodeImpl
Parameters:
out - The relevant outputter
includeAncestors - True if namespaces associated with ancestor elements must also be output; false if these are already known to be on the result tree.
Throws:
TransformerException

hasAttributes

public boolean hasAttributes()
Returns whether this node (if it is an element) has any attributes.

Specified by:
hasAttributes in interface Node
Overrides:
hasAttributes in class TinyNodeImpl
Returns:
true if this node has any attributes, false otherwise.
Since:
DOM Level 2

getAttributeValue

public String getAttributeValue(int fingerprint)
Get the value of a given attribute of this node

Specified by:
getAttributeValue in interface NodeInfo
Overrides:
getAttributeValue in class TinyNodeImpl
Parameters:
fingerprint - The fingerprint of the attribute name
Returns:
the attribute value if it exists or null if not

setAttribute

public void setAttribute(String name,
                         String value)
                  throws DOMException
Set the value of an attribute on the current element. This affects subsequent calls of getAttribute() for that element.

Specified by:
setAttribute in interface Element
Parameters:
name - The name of the attribute to be set. Any prefix is interpreted relative to the namespaces defined for this element.
value - The new value of the attribute. Set this to null to remove the attribute.
Throws:
DOMException

copy

public void copy(Receiver receiver,
                 int whichNamespaces,
                 boolean copyAnnotations)
          throws TransformerException
Copy this node to a given outputter

Specified by:
copy in interface NodeInfo
Parameters:
whichNamespaces - indicates which namespaces should be copied: all, none, or local (i.e., those not declared on a parent element)
receiver - the Receiver to which the node should be copied
copyAnnotations - indicates whether the type annotations of element and attribute nodes should be copied
Throws:
TransformerException

copyRUUD

public void copyRUUD(Receiver receiver,
                     int whichNamespaces,
                     boolean copyAnnotations)
              throws TransformerException
Throws:
TransformerException