Class TinyDocumentImpl
java.lang.Object
net.sf.saxon.tinytree.TinyNodeImpl
net.sf.saxon.tinytree.TinyParentNodeImpl
net.sf.saxon.tinytree.TinyDocumentImpl
- All Implemented Interfaces:
Source, SourceLocator, DocumentInfo, ExtendedNodeInfo, FingerprintedNode, Item, NodeInfo, ValueRepresentation
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 TinyNodeImpl
NODE_LETTER, nodeNr, parent, treeFields inherited from interface NodeInfo
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACESFields inherited from interface ValueRepresentation
EMPTY_VALUE_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy this node to a given outputtervoidgenerateId(FastStringBuffer buffer) Get a character string that uniquely identifies this node(package private) AxisIteratorgetAllElements(int fingerprint) Get a list of all elements with a given name.Get the base URI of this root node.Get the configuration previously set using setConfigurationGet the root (document) node(package private) ListgetElementList(int fingerprint) Get a list containing all the elements with a given element nameintGet 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 system id of this root nodegetTree()Get the tree containing this nodeString[]getUnparsedEntity(String name) Get the unparsed entity with a given nameID if there is one, or null if not.(package private) voidregisterID(NodeInfo e, String id) Register a unique element ID.Get the element with a given ID.voidsetBaseURI(String uri) Set the base URI of this document nodevoidsetConfiguration(Configuration config) Set the Configuration that contains this documentvoidsetSystemId(String uri) Set the system id of this node(package private) voidsetUnparsedEntity(String name, String uri, String publicId) Set an unparsed entity URI associated with this document.voidshowSize()Methods inherited from class TinyParentNodeImpl
getStringValue, getStringValue, getStringValueCS, hasChildNodesMethods inherited from class TinyNodeImpl
atomize, compareOrder, equals, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getNodeNumber, getParentNodeNr, getPrefix, getPublicId, getSequenceNumber, getTypeAnnotation, getTypedValue, getURI, hashCode, isAncestorOrSelf, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations, setParentNodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Item
getStringValueCS, getTypedValueMethods inherited from interface NodeInfo
atomize, compareOrder, equals, getAttributeValue, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getPrefix, getStringValue, getTypeAnnotation, getURI, hasChildNodes, hashCode, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations
-
Constructor Details
-
TinyDocumentImpl
-
-
Method Details
-
getTree
Get the tree containing this node -
setConfiguration
Set the Configuration that contains this document -
getConfiguration
Get the configuration previously set using setConfiguration- Specified by:
getConfigurationin interfaceNodeInfo- Overrides:
getConfigurationin classTinyNodeImpl- Returns:
- the Configuration
-
setSystemId
Set the system id of this node- Specified by:
setSystemIdin interfaceSource- Overrides:
setSystemIdin classTinyNodeImpl
-
getSystemId
Get the system id of this root node- 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 -
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.
-
getLineNumber
public int getLineNumber()Get the line number of this root node.- Specified by:
getLineNumberin interfaceNodeInfo- Specified by:
getLineNumberin interfaceSourceLocator- Overrides:
getLineNumberin classTinyNodeImpl- Returns:
- 0 always
-
getNodeKind
public final int getNodeKind()Return the type of node.- Specified by:
getNodeKindin interfaceNodeInfo- 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
-
getDocumentRoot
Get the root (document) node- Specified by:
getDocumentRootin interfaceNodeInfo- Overrides:
getDocumentRootin classTinyNodeImpl- Returns:
- the DocumentInfo representing the document node, or null if the root of the tree is not 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
-
getAllElements
Get a list of all elements with a given name. This is implemented as a memo function: the first time it is called for a particular element type, it remembers the result for next time. -
getElementList
Get a list containing all the elements with a given element name- Parameters:
fingerprint- the fingerprint of the element name- Returns:
- list a List containing the TinyElementImpl objects
-
registerID
-
selectID
Get the element with a given ID.- Specified by:
selectIDin interfaceDocumentInfo- Parameters:
id- The unique ID of the required element, previously registered using registerID()- Returns:
- The NodeInfo (always an Element) for the given ID if one has been registered, otherwise null.
-
setUnparsedEntity
-
getUnparsedEntity
Get the unparsed entity with a given nameID if there is one, or null if not. If the entity does not exist, return null.- Specified by:
getUnparsedEntityin interfaceDocumentInfo- Parameters:
name- the name of the entity- Returns:
- if the entity exists, return an array of two Strings, the first holding the system ID of the entity, the second holding the public
-
copy
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException Copy this node to a given outputter- Specified by:
copyin interfaceNodeInfo- Parameters:
out- the Receiver to which the node should be copiedwhichNamespaces- in the case of an element, controls which namespace nodes should be copied. Values areNodeInfo.NO_NAMESPACES,NodeInfo.LOCAL_NAMESPACES,NodeInfo.ALL_NAMESPACEScopyAnnotations- indicates whether the type annotations of element and attribute nodes should be copiedlocationId- If non-zero, identifies the location of the instruction that requested this copy. If zero, indicates that the location information for the original node is to be copied; in this case the Receiver must be a LocationCopier- Throws:
XPathException
-
showSize
public void showSize()
-