public final class DocumentImpl extends ParentNodeImpl implements TreeInfo, MutableDocumentInfo
A DocumentImpl object may either represent a real document node, or it may represent an imaginary container for a parentless element.
NODE_LETTERIS_DTD_TYPE, IS_NILLED| Constructor and Description |
|---|
DocumentImpl()
Create a DocumentImpl
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNilledElement(ElementImpl element)
Add a nilled element.
|
void |
copy(Receiver out,
int copyOptions,
Location locationId)
Copy this node to a given outputter
|
void |
deIndex(NodeImpl node)
Remove a node from any indexes when it is detached from the tree
|
protected void |
deregisterID(java.lang.String id)
Remove the entry for a given ID (when nodes are deleted).
|
void |
generateId(FastStringBuffer buffer)
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
|
ElementImpl |
getDocumentElement()
Get the root (outermost) element.
|
long |
getDocumentNumber()
Get the unique document number
|
int |
getLineNumber()
Get the line number of this root node.
|
NamePool |
getNamePool()
Get the name pool used for the names in this document
|
NodeImpl |
getNextSibling()
Get next sibling - always null
|
int |
getNodeKind()
Return the type of node.
|
DocumentImpl |
getPhysicalRoot()
Get the physical root of the tree.
|
NodeImpl |
getPreviousSibling()
Get previous sibling - always null
|
NodeInfo |
getRoot()
Get the root node
|
NodeInfo |
getRootNode()
Get the NodeInfo object representing the document node at the root of the tree
|
SchemaType |
getSchemaType()
Get the type annotation
|
SpaceStrippingRule |
getSpaceStrippingRule()
Get details of space stripping action that was applied to this document during
construction.
|
java.lang.String |
getSystemId()
Get the system id of this root node
|
java.lang.String[] |
getUnparsedEntity(java.lang.String name)
Get the unparsed entity with a given name
|
java.util.Iterator<java.lang.String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
java.lang.Object |
getUserData(java.lang.String key)
Get user data held in the document node.
|
void |
graftLocationMap(DocumentImpl original)
Copy the system ID and line number map from another document
(used when grafting a simplified stylesheet)
|
boolean |
isImaginary()
Ask whether this is an imaginary document node
|
boolean |
isMutable()
Ask whether the tree is mutable.
|
boolean |
isTopWithinEntity(ElementImpl element) |
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
void |
markTopWithinEntity(ElementImpl element) |
Builder |
newBuilder()
Get a Builder suitable for building nodes that can be attached to this document.
|
protected void |
registerID(NodeInfo e,
java.lang.String id)
Register a unique element ID.
|
void |
replaceStringValue(java.lang.CharSequence stringValue)
Replace the string-value of this node
|
void |
resetIndexes()
This method is called before performing a batch of updates; it allows all cached data that
might be invalidated by such updates to be cleared
|
NodeInfo |
selectID(java.lang.String id,
boolean getParent)
Get the element with a given ID.
|
void |
setBaseURI(java.lang.String uri)
Set the base URI of this document node
|
void |
setConfiguration(Configuration config)
Set the Configuration that contains this document
|
void |
setDocumentElement(ElementImpl e)
Set the top-level element of the document (variously called the root element or the
document element).
|
void |
setImaginary(boolean imaginary)
Set whether this is an imaginary document node
|
void |
setLineNumbering()
Set line numbering on
|
void |
setMutable(boolean mutable)
Say whether the tree is mutable.
|
void |
setSpaceStrippingRule(SpaceStrippingRule rule)
Set details of space stripping action that was applied to this document during
construction.
|
void |
setSystemId(java.lang.String uri)
Set the system id (base URI) of this node
|
void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri,
java.lang.String publicId)
Set an unparsed entity URI associated with this document.
|
void |
setUserData(java.lang.String key,
java.lang.Object value)
Set user data on the document node.
|
addChild, children, compact, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getRawSequenceNumber, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, iterateChildren, removeChild, replaceChildrenAt, setChildren, setRawSequenceNumberaddAttribute, addNamespace, atomize, attributes, compareOrder, delete, effectiveBooleanValue, equals, getAllNamespaces, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getLocalPart, getNextInDocument, getNodeName, getParent, getPrefix, getPreviousInDocument, getRawParent, getSiblingPosition, getSuccessorElement, getTreeInfo, getURI, hasFingerprint, head, insertSiblings, isDeleted, iterateAxis, iterateAxis, removeAttribute, removeTypeAnnotation, rename, replace, saveLocation, setAttributes, setRawParent, setSiblingPosition, setTypeAnnotationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNamespace, removeNamespacechildren, equals, getGenre, getPublicId, hashCode, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, toShortStringgetLength, itemAt, iterate, reduce, subsequence, toGroundedValueasIterable, concatenate, containsNode, materializemakeRepeatablepublic NodeInfo getRootNode()
getRootNode in interface TreeInfopublic void setConfiguration(Configuration config)
config - the Saxon configurationpublic Configuration getConfiguration()
getConfiguration in interface NodeInfogetConfiguration in interface TreeInfogetConfiguration in class NodeImplpublic boolean isMutable()
has been called
supplying the value {@code true}public void setMutable(boolean mutable)
has been called
supplying the value {@code true}mutable - true if and only if the tree is to be marked as mutablepublic NamePool getNamePool()
getNamePool in class NodeImplpublic Builder newBuilder()
newBuilder in interface MutableNodeInfonewBuilder in class NodeImplpublic void setImaginary(boolean imaginary)
imaginary - if true, this is an imaginary node - the tree is really rooted at the topmost elementpublic boolean isImaginary()
public boolean isTyped()
public long getDocumentNumber()
getDocumentNumber in interface TreeInfopublic void setDocumentElement(ElementImpl e)
e - the top-level elementpublic void graftLocationMap(DocumentImpl original)
original - the document whose system ID and line number maps are to be grafted
onto this treepublic void setSystemId(java.lang.String uri)
setSystemId in interface javax.xml.transform.SourcesetSystemId in class NodeImplpublic java.lang.String getSystemId()
getSystemId in interface javax.xml.transform.SourcegetSystemId in interface javax.xml.transform.SourceLocatorgetSystemId in interface NodeInfogetSystemId in interface LocationgetSystemId in interface org.xml.sax.LocatorgetSystemId in class NodeImplpublic void setBaseURI(java.lang.String uri)
uri - the new base URIpublic java.lang.String getBaseURI()
getBaseURI in interface NodeInfogetBaseURI in class NodeImplpublic void setLineNumbering()
public void addNilledElement(ElementImpl element)
element - a nilled elementpublic void markTopWithinEntity(ElementImpl element)
public boolean isTopWithinEntity(ElementImpl element)
public int getLineNumber()
getLineNumber in interface javax.xml.transform.SourceLocatorgetLineNumber in interface NodeInfogetLineNumber in interface LocationgetLineNumber in interface org.xml.sax.LocatorgetLineNumber in class NodeImplpublic final int getNodeKind()
getNodeKind in interface NodeInfoTypepublic final NodeImpl getNextSibling()
getNextSibling in interface SteppingNode<NodeImpl>getNextSibling in class NodeImplpublic final NodeImpl getPreviousSibling()
getPreviousSibling in interface SteppingNode<NodeImpl>getPreviousSibling in class NodeImplpublic ElementImpl getDocumentElement()
public NodeInfo getRoot()
public DocumentImpl getPhysicalRoot()
getPhysicalRoot in class NodeImplpublic void generateId(FastStringBuffer buffer)
generateId in interface NodeInfogenerateId in class NodeImplbuffer - a buffer into which will be placed a string based on the document numberpublic void deIndex(NodeImpl node)
node - the node to be removed from all indexesprotected void registerID(NodeInfo e, java.lang.String id)
e - The Element having a particular unique ID valueid - The unique ID valuepublic NodeInfo selectID(java.lang.String id, boolean getParent)
selectID in interface TreeInfoid - The unique ID of the required element, previously registered using registerID()getParent - true if the requirement is for the parent of the node with the given ID,
not the node itself.protected void deregisterID(java.lang.String id)
id - The id valuepublic void setUnparsedEntity(java.lang.String name,
java.lang.String uri,
java.lang.String publicId)
name - the entity nameuri - the system identifier of the unparsed entitypublicId - the public identifier of the unparsed entitypublic java.util.Iterator<java.lang.String> getUnparsedEntityNames()
getUnparsedEntityNames in interface TreeInfopublic java.lang.String[] getUnparsedEntity(java.lang.String name)
getUnparsedEntity in interface TreeInfoname - the name of the entitypublic SchemaType getSchemaType()
getSchemaType in interface NodeInfogetSchemaType in class NodeImplpublic void copy(Receiver out, int copyOptions, Location locationId) throws XPathException
copy in interface NodeInfoout - 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 CopyOptionslocationId - If non-null, identifies the location of the instruction
that requested this copy. If zero, indicates that the location information
is not availableXPathException - if any downstream error occurspublic void replaceStringValue(java.lang.CharSequence stringValue)
replaceStringValue in interface MutableNodeInfostringValue - the new string valuepublic void resetIndexes()
resetIndexes in interface MutableDocumentInfopublic void setSpaceStrippingRule(SpaceStrippingRule rule)
setSpaceStrippingRule in interface TreeInforule - details of the space stripping rules that have been applied to this
document during its construction.public SpaceStrippingRule getSpaceStrippingRule()
getSpaceStrippingRule in interface TreeInfoNoElementsSpaceStrippingRule,
indicating that no space stripping has been appliedpublic void setUserData(java.lang.String key,
java.lang.Object value)
getUserData(java.lang.String)setUserData in interface TreeInfokey - 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 java.lang.Object getUserData(java.lang.String key)
setUserData(java.lang.String, java.lang.Object)getUserData in interface TreeInfokey - A string giving the name of the property to be retrieved.Copyright (c) 2004-2021 Saxonica Limited. All rights reserved.