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
Method Summary |
Value | atomize()
Get the typed value. |
void | copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter |
void | generateId(FastStringBuffer buffer)
Generate id. |
int | getColumnNumber()
Get the column number of the node within its source document entity |
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. |
NodeInfo | getRoot()
Get the root node of the tree (not necessarily a document node)
|
protected long | getSequenceNumber()
Get the node sequence number (in document order). |
String | getStringValue()
Return the string value of the node. |
CharSequence | getStringValueCS()
Return the string value of the node. |
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.
|
SequenceIterator | getTypedValue()
Get the typed value of the item.
|
String | getURI()
Get the URI part of the name of this node. |
boolean | isId()
Determine whether this node has the is-id property
|
boolean | isIdref()
Determine whether this node has the is-idref property
|
boolean | isNilled()
Determine whether the node has the is-nilled property |
void | setSystemId(String uri) |
public TinyAttributeImpl(
TinyTree tree, int nodeNr)
Get the typed value. The result of this method will always be consistent with the method
getTypedValue. However, this method is often more convenient and may be
more efficient, especially in the common case where the value is expected to be a singleton.
Returns: the typed value. This will either be a single AtomicValue or a Value whose items are
atomic values.
Since: 8.5
public void copy(
Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter
Generate id. Returns key of owning element with the attribute namecode as a suffix
Parameters: buffer Buffer to contain the generated ID value
public int getColumnNumber()
Get the column number of the node within its source document entity
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.
public int getFingerprint()
Get the fingerprint of the node, used for matching names
public int getLineNumber()
Get the line number of the node within its source document entity
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.
public int getNameCode()
Get the name code of the node, used for finding names in the name pool
public final int getNodeKind()
Return the type of node.
Returns: Node.ATTRIBUTE
Get the parent node
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.
Get the root node of the tree (not necessarily a document node)
Returns: the NodeInfo representing the root of this tree
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.
public String getStringValue()
Return the string value of the node.
Returns: the attribute value
public CharSequence getStringValueCS()
Return the string value of the node.
Returns: the attribute value
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
Get the typed value of the item.
For a node, this is the typed value as defined in the XPath 2.0 data model. Since a node
may have a list-valued data type, the typed value is in general a sequence, and it is returned
in the form of a SequenceIterator.
If the node has not been validated against a schema, the typed value
will be the same as the string value, either as an instance of xs:string or as an instance
of xs:untypedAtomic, depending on the node kind.
For an atomic value, this method returns an iterator over a singleton sequence containing
the atomic value itself.
Returns: an iterator over the items in the typed value of the node or atomic value. The
items returned by this iterator will always be atomic values.
Throws: net.sf.saxon.trans.XPathException
where no typed value is available, for example in the case of
an element with complex content
Since: 8.4
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
public boolean isId()
Determine whether this node has the is-id property
Returns: true if the node is an ID
public boolean isIdref()
Determine whether this node has the is-idref property
Returns: true if the node is an IDREF or IDREFS element or attribute
public boolean isNilled()
Determine whether the node has the is-nilled property
Returns: true if the node has the is-nilled property
public void setSystemId(String uri)