|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.tree.NodeImpl
net.sf.saxon.tree.ParentNodeImpl
net.sf.saxon.tree.DocumentImpl
public final class DocumentImpl
A node in the XML parse tree representing the Document itself (or equivalently, the root node of the Document).
A DocumentImpl object may either represent a real document node, or it may represent an imaginary container for a parentless element.
Field Summary |
---|
Fields inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
children, sequence |
Fields inherited from class net.sf.saxon.tree.NodeImpl |
---|
index, NODE_LETTER, parent |
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 | |
---|---|
DocumentImpl()
Create a DocumentImpl |
Method Summary | |
---|---|
void |
copy(Receiver out,
int whichNamespaces,
boolean copyAnnotations,
int 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 |
(package private) AxisIterator |
getAllElements(int fingerprint)
Get a list of all elements with a given name fingerprint |
java.lang.String |
getBaseURI()
Get the base URI of this root node. |
(package private) int |
getColumnNumber(int sequence)
Get the column number for an element. |
Configuration |
getConfiguration()
Get the configuration previously set using setConfiguration |
ElementImpl |
getDocumentElement()
Get the root (outermost) element. |
long |
getDocumentNumber()
Get the unique document number |
DocumentInfo |
getDocumentRoot()
Get the root (document) node |
int |
getLineNumber()
Get the line number of this root node. |
(package private) int |
getLineNumber(int sequence)
Get the line number for an element. |
NamePool |
getNamePool()
Get the name pool used for the names in this document |
NodeInfo |
getNextSibling()
Get next sibling - always null |
int |
getNodeKind()
Return the type of node. |
DocumentImpl |
getPhysicalRoot()
Get the physical root of the tree. |
NodeInfo |
getPreviousSibling()
Get previous sibling - always null |
NodeInfo |
getRoot()
Get the root node |
java.lang.String |
getSystemId()
Get the system id of this root node |
(package private) java.lang.String |
getSystemId(int seq)
Get the system id of an element in the document |
int |
getTypeAnnotation()
Get the type annotation of this node, if any. |
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 |
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 |
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 |
(package private) 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 |
(package private) void |
setLineAndColumn(int sequence,
int line,
int column)
Set the line number for an element. |
void |
setLineNumbering()
Set line numbering on |
(package private) void |
setSystemId(int seq,
java.lang.String uri)
Set the system id of an element in the document |
void |
setSystemId(java.lang.String uri)
Set the system id (base URI) of this node |
(package private) void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri,
java.lang.String publicId)
Set an unparsed entity URI associated with this document. |
Methods inherited from class net.sf.saxon.tree.ParentNodeImpl |
---|
addChild, compact, enumerateChildren, getFirstChild, getLastChild, getNthChild, getNumberOfChildren, getSequenceNumber, getStringValue, getStringValueCS, hasChildNodes, insertChildren, insertChildrenAt, removeChild, replaceChildrenAt, useChildrenArray |
Methods inherited from class net.sf.saxon.tree.NodeImpl |
---|
addAttribute, addNamespace, atomize, compareOrder, delete, equals, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getLocalPart, getNameCode, getNextInDocument, getParent, getPrefix, getPreviousInDocument, getPublicId, getSiblingPosition, getTypedValue, getURI, insertSiblings, isDeleted, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, removeAttribute, removeTypeAnnotation, rename, replace, setTypeAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.om.NodeInfo |
---|
atomize, compareOrder, equals, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getFingerprint, getLocalPart, getNameCode, getParent, getPrefix, getStringValue, getURI, hasChildNodes, hashCode, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis |
Methods inherited from interface net.sf.saxon.om.Item |
---|
getStringValueCS, getTypedValue |
Constructor Detail |
---|
public DocumentImpl()
Method Detail |
---|
public void setConfiguration(Configuration config)
config
- the Saxon configurationpublic Configuration getConfiguration()
getConfiguration
in interface NodeInfo
getConfiguration
in class NodeImpl
public NamePool getNamePool()
getNamePool
in interface NodeInfo
getNamePool
in class NodeImpl
public Builder newBuilder()
newBuilder
in interface MutableNodeInfo
newBuilder
in class NodeImpl
public void setImaginary(boolean imaginary)
imaginary
- if true, this is an imaginary node - the tree is really rooted at the topmost elementpublic boolean isImaginary()
public long getDocumentNumber()
getDocumentNumber
in interface NodeInfo
getDocumentNumber
in class NodeImpl
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.Source
setSystemId
in class NodeImpl
public java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.Source
getSystemId
in interface javax.xml.transform.SourceLocator
getSystemId
in interface NodeInfo
getSystemId
in class NodeImpl
public void setBaseURI(java.lang.String uri)
uri
- the new base URIpublic java.lang.String getBaseURI()
getBaseURI
in interface NodeInfo
getBaseURI
in class NodeImpl
void setSystemId(int seq, java.lang.String uri)
seq
- the sequence number of the elementuri
- the system identifier (base URI) of the elementjava.lang.String getSystemId(int seq)
seq
- the sequence number of the element
public void setLineNumbering()
void setLineAndColumn(int sequence, int line, int column)
sequence
- the sequence number of the elementline
- the line number of the elementcolumn
- the column number of the elementint getLineNumber(int sequence)
sequence
- the sequence number of the element
int getColumnNumber(int sequence)
sequence
- the sequence number of the element
public int getLineNumber()
getLineNumber
in interface javax.xml.transform.SourceLocator
getLineNumber
in interface NodeInfo
getLineNumber
in class NodeImpl
public final int getNodeKind()
getNodeKind
in interface NodeInfo
Type
public final NodeInfo getNextSibling()
getNextSibling
in class NodeImpl
public final NodeInfo getPreviousSibling()
getPreviousSibling
in class NodeImpl
public ElementImpl getDocumentElement()
public NodeInfo getRoot()
getRoot
in interface NodeInfo
getRoot
in class NodeImpl
public DocumentInfo getDocumentRoot()
getDocumentRoot
in interface NodeInfo
getDocumentRoot
in class NodeImpl
public DocumentImpl getPhysicalRoot()
getPhysicalRoot
in class NodeImpl
public void generateId(FastStringBuffer buffer)
generateId
in interface NodeInfo
generateId
in class NodeImpl
buffer
- a buffer into which will be placed a string based on the document numberAxisIterator getAllElements(int fingerprint)
fingerprint
- the fingerprint of the required element name
public 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 DocumentInfo
id
- The unique ID of the required element, previously registered using registerID()getParent
-
protected void deregisterID(java.lang.String id)
id
- The id valuevoid 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 DocumentInfo
public java.lang.String[] getUnparsedEntity(java.lang.String name)
getUnparsedEntity
in interface DocumentInfo
name
- the name of the entity
public int getTypeAnnotation()
getTypeAnnotation
in interface NodeInfo
getTypeAnnotation
in class NodeImpl
public void copy(Receiver out, int whichNamespaces, boolean copyAnnotations, int locationId) throws XPathException
copy
in interface NodeInfo
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.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 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
XPathException
public void replaceStringValue(java.lang.CharSequence stringValue)
replaceStringValue
in interface MutableNodeInfo
stringValue
- the new string valuepublic void resetIndexes()
resetIndexes
in interface MutableDocumentInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |