public final class TinyDocumentImpl extends TinyParentNodeImpl implements DocumentInfo
NODE_LETTER, nodeNr, parent, tree
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
EMPTY_VALUE_ARRAY
Constructor and Description |
---|
TinyDocumentImpl(TinyTree tree) |
Modifier and Type | Method and Description |
---|---|
Value<? extends AtomicValue> |
atomize()
Get the typed value.
|
void |
copy(Receiver out,
int copyOptions,
int locationId)
Copy this node to a given outputter
|
void |
generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
|
(package private) AxisIterator |
getAllElements(int fingerprint)
Get a list of all elements with a given name.
|
String |
getBaseURI()
Get the base URI of this root node.
|
Configuration |
getConfiguration()
Get the configuration previously set using setConfiguration
|
DocumentInfo |
getDocumentRoot()
Get the root (document) node
|
(package private) List<TinyElementImpl> |
getElementList(int fingerprint)
Get a list containing all the elements with a given element name
|
int |
getLineNumber()
Get the line number of this root node.
|
int |
getNodeKind()
Return the type of node.
|
NodeInfo |
getParent()
Find the parent node of this node.
|
NodeInfo |
getRoot()
Get the root node
|
SchemaType |
getSchemaType()
Get the type annotation of this node, if any.
|
String |
getSystemId()
Get the system id of this root node
|
TinyTree |
getTree()
Get the tree containing this node
|
int |
getTypeAnnotation()
Get the type annotation of this node, if any.
|
SequenceIterator<? extends AtomicValue> |
getTypedValue()
Get the typed value of the item.
|
String[] |
getUnparsedEntity(String name)
Get the unparsed entity with a given nameID if there is one, or null if not.
|
Iterator<String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
Object |
getUserData(String key)
Get user data held in the document node.
|
int |
hashCode()
The hashCode() method obeys the contract for hashCode(): that is, if two objects are equal
(represent the same node) then they must have the same hashCode()
|
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
(package private) void |
registerID(NodeInfo e,
String id)
Register a unique element ID.
|
NodeInfo |
selectID(String id,
boolean getParent)
Get the element with a given ID.
|
void |
setBaseURI(String uri)
Set the base URI of this document node
|
void |
setSystemId(String uri)
Set the system id of this node
|
(package private) void |
setUnparsedEntity(String name,
String uri,
String publicId)
Set an unparsed entity URI associated with this document.
|
void |
setUserData(String key,
Object value)
Set user data on the document node.
|
void |
showSize() |
getStringValue, getStringValueCS, getStringValueCS, hasChildNodes
compareOrder, equals, getAttributeValue, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getNodeNumber, getParentNodeNr, getPrefix, getPublicId, getSequenceNumber, getURI, isAncestorOrSelf, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, setParentNode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compareOrder, equals, getAttributeValue, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getPrefix, getStringValue, getURI, hasChildNodes, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis
getStringValueCS
public TinyDocumentImpl(TinyTree tree)
public TinyTree getTree()
getTree
in class TinyNodeImpl
public Configuration getConfiguration()
getConfiguration
in interface NodeInfo
getConfiguration
in class TinyNodeImpl
public void setSystemId(String uri)
setSystemId
in interface Source
setSystemId
in class TinyNodeImpl
public String getSystemId()
getSystemId
in interface Source
getSystemId
in interface SourceLocator
getSystemId
in interface NodeInfo
getSystemId
in class TinyNodeImpl
public void setBaseURI(String uri)
uri
- the base URIpublic String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class TinyNodeImpl
public int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface NodeInfo
getLineNumber
in class TinyNodeImpl
public boolean isTyped()
isTyped
in interface DocumentInfo
public final int getNodeKind()
getNodeKind
in interface NodeInfo
Type
public NodeInfo getParent()
getParent
in interface NodeInfo
getParent
in class TinyNodeImpl
public NodeInfo getRoot()
getRoot
in interface NodeInfo
getRoot
in class TinyNodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class TinyNodeImpl
public void generateId(FastStringBuffer buffer)
generateId
in interface NodeInfo
generateId
in class TinyNodeImpl
buffer
- to contain an identifier based on the document numberpublic Value<? extends AtomicValue> atomize() throws XPathException
Item.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.atomize
in interface NodeInfo
XPathException
- if the node has no typed value, for example if
it is an element node with element-only contentpublic SequenceIterator<? extends AtomicValue> getTypedValue() throws XPathException
getTypedValue
in interface Item<NodeInfo>
XPathException
- where no typed value is available, for example in the case of
an element with complex contentAxisIterator getAllElements(int fingerprint)
fingerprint
- the fingerprint identifying the required element nameList<TinyElementImpl> getElementList(int fingerprint)
fingerprint
- the fingerprint of the element namevoid registerID(NodeInfo e, String id)
e
- The NodeInfo (always an element) having a particular unique ID valueid
- The unique ID value. The caller is responsible for checking that this
is a valid NCName.public NodeInfo selectID(String id, boolean getParent)
selectID
in interface DocumentInfo
id
- The unique ID of the required element, previously registered using registerID()getParent
- true if the required element is the parent of the element of type IDvoid setUnparsedEntity(String name, String uri, String publicId)
name
- the name of the unparsed entityuri
- the system identifier of the unparsed entitypublicId
- the public identifier of the unparsed entitypublic Iterator<String> getUnparsedEntityNames()
getUnparsedEntityNames
in interface DocumentInfo
public String[] getUnparsedEntity(String name)
getUnparsedEntity
in interface DocumentInfo
name
- the name of the entitypublic int getTypeAnnotation()
getTypeAnnotation
in interface NodeInfo
getTypeAnnotation
in class TinyNodeImpl
public SchemaType getSchemaType()
Types derived from a DTD are not reflected in the result of this method.
getSchemaType
in interface NodeInfo
getSchemaType
in class TinyNodeImpl
public void copy(Receiver out, int copyOptions, int locationId) throws XPathException
copy
in interface NodeInfo
out
- the Receiver to which the node should be copied. It is the caller's
responsibility to ensure that this Receiver is open before the method is called
(or that it is self-opening), and that it is closed after use.copyOptions
- a selection of the options defined in CopyOptions
locationId
- If non-zero, identifies the location of the instruction
that requested this copy. If zero, indicates that the location informationXPathException
- if any downstream error occurspublic void showSize()
public int hashCode()
hashCode
in interface NodeInfo
hashCode
in class TinyNodeImpl
public void setUserData(String key, Object value)
getUserData(java.lang.String)
setUserData
in interface DocumentInfo
key
- A string giving the name of the property to be set. Clients are responsible
for choosing a key that is likely to be unique. Must not be null. Keys used internally
by Saxon are prefixed "saxon:".value
- The value to be set for the property. May be null, which effectively
removes the existing value for the property.public Object getUserData(String key)
setUserData(java.lang.String, java.lang.Object)
getUserData
in interface DocumentInfo
key
- A string giving the name of the property to be retrieved.