Package net.sf.saxon.tree.tiny
Class TinyDocumentImpl
java.lang.Object
net.sf.saxon.tree.tiny.TinyNodeImpl
net.sf.saxon.tree.tiny.TinyParentNodeImpl
net.sf.saxon.tree.tiny.TinyDocumentImpl
- All Implemented Interfaces:
Source,SourceLocator,ActiveSource,GroundedValue,Item,NodeInfo,Sequence,Location,Locator
A node in the XML parse tree representing the Document itself (or equivalently, the root
node of the Document).
-
Field Summary
Fields inherited from class net.sf.saxon.tree.tiny.TinyNodeImpl
NODE_LETTER, nodeNr, parent, tree -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatomize()Get the typed value.voidCopy this node to a given outputtervoidgenerateId(StringBuilder buffer) Get a character string that uniquely identifies this nodeGet the base URI of this root node.Get the configuration previously set using setConfigurationintGet the line number of this root node.final intReturn the type of node.Find the parent node of this node.getRoot()Get the root nodeGet the NodeInfo object representing the document node at the root of the treeGet the type annotation of this node, if any.Get the system id of this root nodegetTree()Get the tree containing this nodeinthashCode()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()booleanisTyped()Ask whether the document contains any nodes whose type annotation is anything other than UNTYPEDvoidsetBaseURI(String uri) Set the base URI of this document nodevoidsetSystemId(String uri) Set the system id of this nodevoidMethods inherited from class net.sf.saxon.tree.tiny.TinyParentNodeImpl
getStringValue, getUnicodeStringValue, hasChildNodesMethods inherited from class net.sf.saxon.tree.tiny.TinyNodeImpl
compareOrder, equals, getAllNamespaces, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getGenre, getLocalPart, getNamePool, getNamespaceUri, getNodeNumber, getParentNodeNr, getPrefix, getSequenceNumber, getTreeInfo, hasFingerprint, hasURI, head, isAncestorOrSelf, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, iterateAxis, iterateAxis, saveLocation, setParentNodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, effectiveBooleanValue, materializeMethods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.NodeInfo
asActiveSource, attributes, children, children, deliver, getAttributeValue, getPublicId, getURI, toShortStringMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
TinyDocumentImpl
-
-
Method Details
-
getTree
Get the tree containing this node- Overrides:
getTreein classTinyNodeImpl- Returns:
- the TinyTree. Note that this may also contain other unrelated trees
-
getRootNode
Get the NodeInfo object representing the document node at the root of the tree- Returns:
- the document node
-
getConfiguration
Get the configuration previously set using setConfiguration- Specified by:
getConfigurationin interfaceNodeInfo- Overrides:
getConfigurationin classTinyNodeImpl- Returns:
- the Configuration to which the tree belongs. The default implementation invokes
getTreeInfo().getConfiguration().
-
setSystemId
Set the system id of this node- Specified by:
setSystemIdin interfaceNodeInfo- Specified by:
setSystemIdin interfaceSource- Overrides:
setSystemIdin classTinyNodeImpl
-
getSystemId
Get the system id of this root node- Specified by:
getSystemIdin interfaceLocation- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceNodeInfo- Specified by:
getSystemIdin interfaceSource- Specified by:
getSystemIdin interfaceSourceLocator- Overrides:
getSystemIdin classTinyNodeImpl- Returns:
- the System Identifier of the entity in the source document containing the node, or null if not known or not applicable.
-
setBaseURI
Set the base URI of this document node- Parameters:
uri- the base URI
-
getBaseURI
Get the base URI of this root node.- Specified by:
getBaseURIin interfaceNodeInfo- Overrides:
getBaseURIin classTinyNodeImpl- Returns:
- the base URI of the node. This may be null if the base URI is unknown, including the case where the node has no parent.
-
getLineNumber
public int getLineNumber()Get the line number of this root node.- Specified by:
getLineNumberin interfaceLocation- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceNodeInfo- Specified by:
getLineNumberin interfaceSourceLocator- Overrides:
getLineNumberin classTinyNodeImpl- Returns:
- 0 always
-
isTyped
public boolean isTyped()Ask whether the document contains any nodes whose type annotation is anything other than UNTYPED- Returns:
- true if the document contains elements whose type is other than UNTYPED
-
getNodeKind
public final int getNodeKind()Return the type of node.- Returns:
- Type.DOCUMENT (always)
- See Also:
-
getParent
Find the parent node of this node.- Specified by:
getParentin interfaceNodeInfo- Overrides:
getParentin classTinyNodeImpl- Returns:
- The Node object describing the containing element or root node.
-
getRoot
Get the root node- Specified by:
getRootin interfaceNodeInfo- Overrides:
getRootin classTinyNodeImpl- Returns:
- the NodeInfo that is the root of the tree - not necessarily a document node
-
generateId
Get a character string that uniquely identifies this node- Specified by:
generateIdin interfaceNodeInfo- Overrides:
generateIdin classTinyNodeImpl- Parameters:
buffer- to contain an identifier based on the document number
-
atomize
Get the typed value.- Returns:
- the typed value. This will either be a single AtomicValue or a Value whose items are atomic values.
-
getSchemaType
Get the type annotation of this node, if any. The type annotation is represented as SchemaType object.Types derived from a DTD are not reflected in the result of this method.
- Specified by:
getSchemaTypein interfaceNodeInfo- Overrides:
getSchemaTypein classTinyNodeImpl- Returns:
- For element and attribute nodes: the type annotation derived from schema validation (defaulting to xs:untyped and xs:untypedAtomic in the absence of schema validation). For comments, text nodes, processing instructions, and namespaces: null. For document nodes, either xs:untyped if the document has not been validated, or xs:anyType if it has.
- Since:
- 9.4
-
copy
Copy this node to a given outputter- Parameters:
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 inCopyOptionslocationId- If non-null, identifies the location of the instruction that requested this copy. If null, indicates that the location information is not available- Throws:
XPathException- if any downstream error occurs
-
showSize
-
hashCode
public 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()- Specified by:
hashCodein interfaceNodeInfo- Overrides:
hashCodein classTinyNodeImpl- Since:
- 8.7 Previously, the effect of the equals() and hashCode() methods was not defined. Callers should therefore be aware that third party implementations of the NodeInfo interface may not implement the correct semantics.
-