net.sf.saxon.tinytree

Class TinyDocumentImpl

Implemented Interfaces:
DocumentInfo, ExtendedNodeInfo, FingerprintedNode, Item, NodeInfo, Source, NodeInfo, PullEvent, SourceLocator, ValueRepresentation

public final class TinyDocumentImpl
extends net.sf.saxon.tinytree.TinyParentNodeImpl
implements DocumentInfo

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.tinytree.TinyNodeImpl

NODE_LETTER, nodeNr, parent, tree

Fields inherited from interface net.sf.saxon.om.NodeInfo

ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES

Fields inherited from interface net.sf.saxon.om.NodeInfo

ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES

Fields inherited from interface net.sf.saxon.om.ValueRepresentation

EMPTY_VALUE_ARRAY

Constructor Summary

TinyDocumentImpl(TinyTree tree)

Method Summary

void
copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId)
Copy this node to a given outputter
void
generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
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
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
String
getSystemId()
Get the system id of this root node
TinyTree
getTree()
Get the tree containing this node
String[]
getUnparsedEntity(String name)
Get the unparsed entity with a given nameID if there is one, or null if not.
NodeInfo
selectID(String id)
Get the element with a given ID.
void
setBaseURI(String uri)
Set the base URI of this document node
void
setConfiguration(Configuration config)
Set the Configuration that contains this document
void
setSystemId(String uri)
Set the system id of this node
void
showSize()

Methods inherited from class net.sf.saxon.tinytree.TinyParentNodeImpl

getStringValue, getStringValue, getStringValueCS, hasChildNodes

Methods inherited from class net.sf.saxon.tinytree.TinyNodeImpl

atomize, compareOrder, equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNamePool, getNodeNumber, getParent, getPrefix, getPublicId, getRoot, getSequenceNumber, getStringValueCS, getSystemId, getTypeAnnotation, getTypedValue, getURI, hasChildNodes, hashCode, isAncestorOrSelf, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, setParentNode, setSystemId

Constructor Details

TinyDocumentImpl

public TinyDocumentImpl(TinyTree tree)

Method Details

copy

public void copy(Receiver out,
                 int whichNamespaces,
                 boolean copyAnnotations,
                 int locationId)
            throws XPathException
Copy this node to a given outputter
Specified by:
copy in interface NodeInfo

generateId

public void generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
Specified by:
generateId in interface NodeInfo
Overrides:
generateId in interface TinyNodeImpl
Parameters:
buffer - to contain an identifier based on the document number

getBaseURI

public String getBaseURI()
Get the base URI of this root node.
Specified by:
getBaseURI in interface NodeInfo
Overrides:
getBaseURI in interface TinyNodeImpl

getConfiguration

public Configuration getConfiguration()
Get the configuration previously set using setConfiguration
Specified by:
getConfiguration in interface NodeInfo
Overrides:
getConfiguration in interface TinyNodeImpl

getDocumentRoot

public DocumentInfo getDocumentRoot()
Get the root (document) node
Specified by:
getDocumentRoot in interface NodeInfo
Overrides:
getDocumentRoot in interface TinyNodeImpl
Returns:
the DocumentInfo representing the document node, or null if the root of the tree is not a document node

getLineNumber

public int getLineNumber()
Get the line number of this root node.
Specified by:
getLineNumber in interface NodeInfo
Overrides:
getLineNumber in interface TinyNodeImpl
Returns:
0 always

getNodeKind

public final int getNodeKind()
Return the type of node.
Specified by:
getNodeKind in interface NodeInfo
Returns:
Type.DOCUMENT (always)

getParent

public NodeInfo getParent()
Find the parent node of this node.
Specified by:
getParent in interface NodeInfo
Overrides:
getParent in interface TinyNodeImpl
Returns:
The Node object describing the containing element or root node.

getRoot

public NodeInfo getRoot()
Get the root node
Specified by:
getRoot in interface NodeInfo
Overrides:
getRoot in interface TinyNodeImpl
Returns:
the NodeInfo that is the root of the tree - not necessarily a document node

getSystemId

public String getSystemId()
Get the system id of this root node
Specified by:
getSystemId in interface NodeInfo
Overrides:
getSystemId in interface TinyNodeImpl

getTree

public TinyTree getTree()
Get the tree containing this node

getUnparsedEntity

public String[] getUnparsedEntity(String name)
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:
getUnparsedEntity in interface DocumentInfo
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

selectID

public NodeInfo selectID(String id)
Get the element with a given ID.
Specified by:
selectID in interface DocumentInfo
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.

setBaseURI

public void setBaseURI(String uri)
Set the base URI of this document node

setConfiguration

public void setConfiguration(Configuration config)
Set the Configuration that contains this document

setSystemId

public void setSystemId(String uri)
Set the system id of this node
Overrides:
setSystemId in interface TinyNodeImpl

showSize

public void showSize()