net.sf.saxon.tinytree

Class TinyAttributeImpl

final class TinyAttributeImpl extends TinyNodeImpl

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: Michael H. Kay

Constructor Summary
TinyAttributeImpl(TinyTree tree, int nodeNr)
Method Summary
voidcopy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter
voidgenerateId(FastStringBuffer buffer)
Generate id.
StringgetDisplayName()
Get the display name of this node.
intgetFingerprint()
Get the fingerprint of the node, used for matching names
intgetLineNumber()
Get the line number of the node within its source document entity
StringgetLocalPart()
Get the local name of this node.
intgetNameCode()
Get the name code of the node, used for finding names in the name pool
intgetNodeKind()
Return the type of node.
NodeInfogetParent()
Get the parent node
StringgetPrefix()
Get the prefix part of the name of this node.
NodeInfogetRoot()
Get the root node of the tree (not necessarily a document node)
protected longgetSequenceNumber()
Get the node sequence number (in document order).
StringgetStringValue()
Return the string value of the node.
CharSequencegetStringValueCS()
Return the string value of the node.
intgetTypeAnnotation()
Get the type annotation of this node, if any The bit IS_DTD_TYPE (1<<30) will be set in the case of an attribute node if the type annotation is one of ID, IDREF, or IDREFS and this is derived from DTD rather than schema validation.
StringgetURI()
Get the URI part of the name of this node.

Constructor Detail

TinyAttributeImpl

public TinyAttributeImpl(TinyTree tree, int nodeNr)

Method Detail

copy

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

generateId

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

Parameters: buffer Buffer to contain the generated ID value

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.

Returns: The display name of this node. For a node with no name, return an empty string.

getFingerprint

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

getLineNumber

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

getLocalPart

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

Returns: The local name of this node. For a node with no name, return an empty string.

getNameCode

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

getNodeKind

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

Returns: Node.ATTRIBUTE

getParent

public NodeInfo getParent()
Get the parent node

getPrefix

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

Returns: the prefix part of the name. For an unnamed node, return null.

getRoot

public NodeInfo getRoot()
Get the root node of the tree (not necessarily a document node)

Returns: the NodeInfo representing the root of this tree

getSequenceNumber

protected long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive. In this implementation, elements have a zero least-significant word, while attributes and namespaces use the same value in the top word as the containing element, and use the bottom word to hold a sequence number, which numbers namespaces first and then attributes.

getStringValue

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

Returns: the attribute value

getStringValueCS

public CharSequence getStringValueCS()
Return the string value of the node.

Returns: the attribute value

getTypeAnnotation

public int getTypeAnnotation()
Get the type annotation of this node, if any The bit IS_DTD_TYPE (1<<30) will be set in the case of an attribute node if the type annotation is one of ID, IDREF, or IDREFS and this is derived from DTD rather than schema validation. Returns UNTYPED_ATOMIC if there is no type annotation

getURI

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

Returns: The URI of the namespace of this node. For the default namespace, return an empty string