net.sf.saxon.tinytree
Class TinyAttributeImpl

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

final class TinyAttributeImpl
extends TinyNodeImpl
implements Attr

A node in the XML parse tree representing an attribute. Note that this is generated only "on demand", when the attribute is selected by a select pattern.

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
TinyAttributeImpl(TinyDocumentImpl doc, int nodeNr)
           
 
Method Summary
 void copy(Receiver out, int whichNamespaces, boolean copyAnnotations)
          Copy this node to a given outputter
 String generateId()
          Generate id.
 String getDisplayName()
          Get the display name of this node.
 int getFingerprint()
          Get the fingerprint of the node, used for matching names
 int getLineNumber()
          Get the line number of the node within its source document entity
 String getLocalPart()
          Get the local name of this node.
 int getNameCode()
          Get the name code of the node, used for finding names in the name pool
 int getNodeKind()
          Return the type of node.
 NodeInfo getParent()
          Get the parent node
 String getPrefix()
          Get the prefix part of the name of this node.
protected  long getSequenceNumber()
          Get the node sequence number (in document order).
 String getStringValue()
          Return the character value of the node.
 int getTypeAnnotation()
          Get the type annotation of this node, if any Returns 0 if there is no type annotation
 String getURI()
          Get the URI part of the name of this node.
 
Methods inherited from class net.sf.saxon.tinytree.TinyNodeImpl
compareOrder, getAttributeValue, getBaseURI, getDocumentNumber, getDocumentRoot, getNamePool, getOriginatingNode, getRoot, getSystemId, hasAttributes, hasChildNodes, isSameNode, iterateAxis, iterateAxis, outputNamespaceNodes, 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.Attr
getName, getOwnerElement, getSchemaTypeInfo, getSpecified, getValue, isId, setValue
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

TinyAttributeImpl

public TinyAttributeImpl(TinyDocumentImpl doc,
                         int nodeNr)
Method Detail

getParent

public NodeInfo getParent()
Get the parent node

Specified by:
getParent in interface NodeInfo
Overrides:
getParent in class TinyNodeImpl
Returns:
The Node object describing the containing element or root node.

getSequenceNumber

protected long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive. In the current implementation, parent nodes (elements and roots) have a zero least-significant word, while namespaces, attributes, text nodes, comments, and PIs have the top word the same as their owner and the bottom half reflecting their relative position.

Overrides:
getSequenceNumber in class TinyNodeImpl

getNodeKind

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

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

getStringValue

public String getStringValue()
Return the character value of the node.

Specified by:
getStringValue in interface Item
Specified by:
getStringValue in interface NodeInfo
Specified by:
getStringValue in class AbstractNode
Returns:
the attribute value

getFingerprint

public int getFingerprint()
Get the fingerprint of the node, used for matching names

Specified by:
getFingerprint in interface NodeInfo
Overrides:
getFingerprint in class TinyNodeImpl
Returns:
an integer fingerprint; two nodes with the same fingerprint have the same expanded QName

getNameCode

public int getNameCode()
Get the name code of the node, used for finding names in the name pool

Specified by:
getNameCode in interface NodeInfo
Overrides:
getNameCode in class TinyNodeImpl
Returns:
an integer name code, which may be used to obtain the actual node name from the name pool
See Also:
allocate, getFingerprint

getPrefix

public String getPrefix()
Get the prefix part of the name of this node. This is the name before the ":" if any.

Specified by:
getPrefix in interface Node
Overrides:
getPrefix in class TinyNodeImpl
Returns:
the prefix part of the name. For an unnamed node, return null.

getDisplayName

public String getDisplayName()
Get the display name of this node. For elements and attributes this is [prefix:]localname. For unnamed nodes, it is an empty string.

Specified by:
getDisplayName in interface NodeInfo
Overrides:
getDisplayName in class TinyNodeImpl
Returns:
The display name of this node. For a node with no name, return an empty string.

getLocalPart

public String getLocalPart()
Get the local name of this node.

Specified by:
getLocalPart in interface NodeInfo
Overrides:
getLocalPart in class TinyNodeImpl
Returns:
The local name of this node. For a node with no name, return an empty string.

getURI

public final String getURI()
Get the URI part of the name of this node.

Specified by:
getURI in interface NodeInfo
Overrides:
getURI in class TinyNodeImpl
Returns:
The URI of the namespace of this node. For the default namespace, return an empty string

getTypeAnnotation

public int getTypeAnnotation()
Get the type annotation of this node, if any Returns 0 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

generateId

public String generateId()
Generate id. Returns key of owning element with the attribute namecode as a suffix

Specified by:
generateId in interface NodeInfo
Overrides:
generateId in class TinyNodeImpl
Returns:
a string.

copy

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

Specified by:
copy in interface NodeInfo
Parameters:
out - the Receiver to which the node should be copied
whichNamespaces - in the case of an element, controls which namespace nodes should be copied. Values are NO_NAMESPACES, LOCAL_NAMESPACES, ALL_NAMESPACES
copyAnnotations - indicates whether the type annotations of element and attribute nodes should be copied
Throws:
TransformerException

getLineNumber

public int getLineNumber()
Get the line number of the node within its source document entity

Specified by:
getLineNumber in interface SourceLocator
Specified by:
getLineNumber in interface NodeInfo
Overrides:
getLineNumber in class TinyNodeImpl
Returns:
the line number of the node in its original source document; or -1 if not available