## net.sf.saxon.tinytree
Class TinyDocumentImpl

    java.lang.Object
      net.sf.saxon.tinytree.TinyNodeImpl
          net.sf.saxon.tinytree.TinyParentNodeImpl
              net.sf.saxon.tinytree.TinyDocumentImpl

All Implemented Interfaces:
  DocumentInfo, FingerprintedNode, Item, NodeInfo, javax.xml.transform.Source, javax.xml.transform.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, 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
`java.lang.String` `generateId()` Get a character string that uniquely identifies this node
`java.lang.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
`java.lang.String` `getStringValue()` Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.
`static java.lang.CharSequence` `getStringValue(TinyTree tree, int nodeNr)` Get the string value of a node.
`java.lang.CharSequence` `getStringValueCS()` Get the value of the item as a CharSequence.
`java.lang.String` `getSystemId()` Get the system id of this root node
`TinyTree` `getTree()` Get the tree containing this node
`java.lang.String[]` `getUnparsedEntity(java.lang.String name)` Get the unparsed entity with a given nameID if there is one, or null if not.
`boolean` `hasChildNodes()` Determine if the node has children.
`NodeInfo` `selectID(java.lang.String id)` Get the element with a given ID.
`void` `setConfiguration(Configuration config)` Set the Configuration that contains this document
`void` `setSystemId(java.lang.String uri)` Set the system id of this node
`void` `showSize()`

Methods inherited from class net.sf.saxon.tinytree.TinyNodeImpl
`atomize, compareOrder, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getPrefix, getPublicId, getSequenceNumber, getTypeAnnotation, getTypedValue, getURI, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations, setParentNode`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface net.sf.saxon.om.NodeInfo
`atomize, compareOrder, getAttributeValue, getDeclaredNamespaces, getDisplayName, getDocumentNumber, getFingerprint, getLocalPart, getNameCode, getNamePool, getPrefix, getStringValue, getTypeAnnotation, getURI, hasChildNodes, isSameNodeInfo, iterateAxis, iterateAxis, sendNamespaceDeclarations`

Methods inherited from interface net.sf.saxon.om.Item
`getStringValueCS, getTypedValue`

Constructor Detail

### TinyDocumentImpl

    public TinyDocumentImpl(TinyTree tree)

Method Detail

### getTree

    public TinyTree getTree()

  Get the tree containing this node

### setConfiguration

    public void setConfiguration(Configuration config)

  Set the Configuration that contains this document

### getConfiguration

    public Configuration getConfiguration()

  Get the configuration previously set using setConfiguration

  Specified by:
    `getConfiguration` in interface `NodeInfo`
  Overrides:
    `getConfiguration` in class `TinyNodeImpl`

### setSystemId

    public void setSystemId(java.lang.String uri)

  Set the system id of this node

  Specified by:
    `setSystemId` in interface `javax.xml.transform.Source`
  Overrides:
    `setSystemId` in class `TinyNodeImpl`

### getSystemId

    public java.lang.String getSystemId()

  Get the system id of this root node

  Specified by:
    `getSystemId` in interface `NodeInfo`
  Overrides:
    `getSystemId` in class `TinyNodeImpl`

### getBaseURI

    public java.lang.String getBaseURI()

  Get the base URI of this root node. For a root node the base URI is the same as the System ID.

  Specified by:
    `getBaseURI` in interface `NodeInfo`
  Overrides:
    `getBaseURI` in class `TinyNodeImpl`

### getLineNumber

    public int getLineNumber()

  Get the line number of this root node.

  Specified by:
    `getLineNumber` in interface `NodeInfo`
  Overrides:
    `getLineNumber` in class `TinyNodeImpl`
  Returns:
    0 always

### getNodeKind

    public final int getNodeKind()

  Return the type of node.

  Specified by:
    `getNodeKind` in interface `NodeInfo`
  Returns:
    Type.DOCUMENT (always)
  See Also:
    `Type`

### getParent

    public NodeInfo getParent()

  Find the parent node of this node.

  Specified by:
    `getParent` in interface `NodeInfo`
  Overrides:
    `getParent` in class `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 class `TinyNodeImpl`
  Returns:
    the NodeInfo that is the root of the tree - not necessarily a document node

### getDocumentRoot

    public DocumentInfo getDocumentRoot()

  Get the root (document) node

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

### generateId

    public java.lang.String generateId()

  Get a character string that uniquely identifies this node

  Specified by:
    `generateId` in interface `NodeInfo`
  Overrides:
    `generateId` in class `TinyNodeImpl`
  Returns:
    an identifier based on the document number

### selectID

    public NodeInfo selectID(java.lang.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.

### getUnparsedEntity

    public java.lang.String[] getUnparsedEntity(java.lang.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

### 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`
  Parameters:
    `out` - the Receiver to which the node should be copied
    `whichNamespaces` - in the case of an element, controls which namespace nodes should be copied. Values are `NodeInfo.NO_NAMESPACES`, `NodeInfo.LOCAL_NAMESPACES`, `NodeInfo.ALL_NAMESPACES`
    `copyAnnotations` - indicates whether the type annotations of element and attribute nodes should be copied
    `locationId` - 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()

### hasChildNodes

    public final boolean hasChildNodes()

  Determine if the node has children.

  Specified by:
    `hasChildNodes` in interface `NodeInfo`
  Overrides:
    `hasChildNodes` in class `TinyNodeImpl`
  Returns:
    `true` if this node has any attributes, `false` otherwise.

### getStringValue

    public final java.lang.String getStringValue()

  Return the string-value of the node, that is, the concatenation of the character content of all descendent elements and text nodes.

  Returns:
    the accumulated character content of the element, including descendant elements.

### getStringValueCS

    public java.lang.CharSequence getStringValueCS()

  Get the value of the item as a CharSequence. This is in some cases more efficient than the version of the method that returns a String.

  Specified by:
    `getStringValueCS` in interface `Item`
  Overrides:
    `getStringValueCS` in class `TinyNodeImpl`

### getStringValue

    public static final java.lang.CharSequence getStringValue(TinyTree tree,
                                                              int nodeNr)

  Get the string value of a node. This static method allows the string value of a node to be obtained without instantiating the node as a Java object. The method also returns a CharSequence rather than a string, which means it can sometimes avoid copying the data.

  Parameters:
    `tree` - The containing document
    `nodeNr` - identifies the node whose string value is required. This must be a document or element node. The caller is trusted to ensure this.
  Returns:
    the string value of the node, as a CharSequence