Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.icl.saxon.om.AbstractNode
com.icl.saxon.tinytree.TinyNodeImpl
com.icl.saxon.tinytree.TinyParentNodeImpl
com.icl.saxon.tinytree.TinyDocumentImpl
public final class TinyDocumentImpl
extends com.icl.saxon.tinytree.TinyParentNodeImpl
implements DocumentInfo, Document
Field Summary | |
protected int[] | |
protected int[] | |
protected String[] | |
protected char[] | |
protected int | |
protected StringBuffer | |
protected short[] | |
protected int | |
protected int[] | |
protected int[] | |
protected int[] | |
protected int[] | |
protected int[] | |
protected byte[] | |
protected int | |
protected int | |
protected int | |
protected int[] | |
protected int[] |
Fields inherited from class com.icl.saxon.om.AbstractNode | |
NODE_LETTER |
Fields inherited from interface com.icl.saxon.om.NodeInfo | |
ATTRIBUTE , COMMENT , ELEMENT , NAMESPACE , NODE , NONE , NUMBER_OF_TYPES , PI , ROOT , TEXT |
Constructor Summary | |
Method Summary | |
protected void |
|
protected void |
|
protected void |
|
Node |
|
protected void |
|
void | |
void |
|
protected void | |
protected void | |
protected void | |
protected void |
|
String |
|
protected AxisEnumeration |
|
protected com.icl.saxon.tinytree.TinyAttributeImpl |
|
String |
|
DocumentInfo |
|
String |
|
org.w3c.dom.DOMConfiguration |
|
String |
|
Hashtable |
|
int |
|
protected int |
|
NamePool |
|
protected com.icl.saxon.tinytree.TinyNamespaceImpl |
|
com.icl.saxon.tinytree.TinyNodeImpl |
|
short |
|
NodeInfo |
|
long |
|
boolean |
|
String |
|
protected String |
|
String |
|
String |
|
boolean |
|
String |
|
protected boolean |
|
void |
|
Node |
|
NodeInfo |
|
void |
|
void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
protected void |
|
protected void |
|
void |
|
void |
|
protected void |
|
Methods inherited from class com.icl.saxon.tinytree.TinyParentNodeImpl | |
copyStringValue , getStringValue , hasChildNodes |
Methods inherited from class com.icl.saxon.tinytree.TinyNodeImpl | |
compareOrder , generateId , getAttributeValue , getAttributeValue , getBaseURI , getDisplayName , getDocumentRoot , getEnumeration , getFingerprint , getLineNumber , getLocalName , getNameCode , getOriginatingNode , getParent , getPrefix , getSequenceNumber , getSystemId , getURI , hasAttributes , hasChildNodes , isSameNodeInfo , outputNamespaceNodes , setLineNumber , setParentNode , setSystemId |
protected int[] attCode
protected int[] attParent
protected String[] attValue
protected char[] charBuffer
protected int charBufferLength
protected StringBuffer commentBuffer
protected short[] depth
protected int lastLevelOneNode
protected int[] length
protected int[] nameCode
protected int[] namespaceCode
protected int[] namespaceParent
protected int[] next
protected byte[] nodeType
protected int numberOfAttributes
protected int numberOfNamespaces
protected int numberOfNodes
protected int[] offset
protected int[] prior
protected void addAttribute(int parent0, int code0, String type0, String value0)
protected void addNamespace(int parent0, int nscode0)
protected void addNode(short type0, int depth0, int offset0, int length0, int nameCode0)
public Node adoptNode(Node source) throws DOMException
Attempts to adopt a node from another document to this document.
- Parameters:
source
- The node to move into this document.
- Returns:
- The adopted node, or
null
if this operation fails, such as when the source node comes from a different implementation.
- Since:
- DOM Level 3
protected void appendChars(char[] chars, int start, int length)
public void diagnosticDump()
Produce diagnostic print of main tree arrays
protected void ensureAttributeCapacity()
protected void ensureNamespaceCapacity()
protected void ensureNodeCapacity()
protected void ensurePriorIndex()
On demand, make an index for quick access to preceding-sibling nodes
public String generateId()
Get a character string that uniquely identifies this node within the document
- Specified by:
- generateId in interface NodeInfo
- Overrides:
- generateId in interface com.icl.saxon.tinytree.TinyNodeImpl
- Returns:
- the empty string
protected AxisEnumeration getAllElements(int fingerprint)
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.
protected com.icl.saxon.tinytree.TinyAttributeImpl getAttributeNode(int nr)
Make a (transient) attribute node from the array of attributes
public 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 interface com.icl.saxon.tinytree.TinyNodeImpl
public DocumentInfo getDocumentRoot()
Get the root (document) node
- Specified by:
- getDocumentRoot in interface NodeInfo
- Overrides:
- getDocumentRoot in interface com.icl.saxon.tinytree.TinyNodeImpl
- Returns:
- the DocumentInfo representing this document
public String getDocumentURI()
The location of the document ornull
if undefined or if theDocument
was created usingDOMImplementation.createDocument
. No lexical checking is performed when setting this attribute; this could result in anull
value returned when usingNode.baseURI
.
Beware that when theDocument
supports the feature "HTML" [DOM Level 2 HTML] , the href attribute of the HTML BASE element takes precedence over this attribute when computingNode.baseURI
.
- Since:
- DOM Level 3
public org.w3c.dom.DOMConfiguration getDomConfig()
The configuration used whenDocument.normalizeDocument()
is invoked.
- Since:
- DOM Level 3
public String getInputEncoding()
An attribute specifying the encoding used for this document at the time of the parsing. This isnull
when it is not known, such as when theDocument
was created in memory.
- Since:
- DOM Level 3
public Hashtable getKeyIndex(KeyManager keymanager, int fingerprint)
Get the index for a given key
- Specified by:
- getKeyIndex in interface DocumentInfo
- Parameters:
keymanager
- The key manager managing this keyfingerprint
- The fingerprint of the name of the key (unique with the key manager)
- Returns:
- The index, if one has been built, in the form of a Hashtable that maps the key value to a set of nodes having that key value. If no index has been built, returns null.
public int getLineNumber()
Get the line number of this root node.
- Specified by:
- getLineNumber in interface NodeInfo
- Overrides:
- getLineNumber in interface com.icl.saxon.tinytree.TinyNodeImpl
- Returns:
- 0 always
protected int getLineNumber(int sequence)
Get the line number for an element. Return -1 if line numbering is off.
public NamePool getNamePool()
Get the name pool used for the names in this document
- Specified by:
- getNamePool in interface DocumentInfo
protected com.icl.saxon.tinytree.TinyNamespaceImpl getNamespaceNode(int nr)
Make a (transient) namespace node from the array of namespace declarations
public com.icl.saxon.tinytree.TinyNodeImpl getNode(int nr)
public final short getNodeType()
Return the type of node.
- Specified by:
- getNodeType in interface NodeInfo
- Returns:
- NodeInfo.ROOT (always)
public NodeInfo getParent()
Find the parent node of this node.
- Overrides:
- getParent in interface com.icl.saxon.tinytree.TinyNodeImpl
- Returns:
- The Node object describing the containing element or root node.
public long getSequenceNumber()
Get the node sequence number (in document order). Sequence numbers are monotonic but not consecutive.
- Overrides:
- getSequenceNumber in interface com.icl.saxon.tinytree.TinyNodeImpl
public boolean getStrictErrorChecking()
An attribute specifying whether error checking is enforced or not. When set tofalse
, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException
on DOM operations or report errors while usingDocument.normalizeDocument()
. In case of error, the behavior is undefined. This attribute istrue
by default.
- Since:
- DOM Level 3
public String getSystemId()
Get the system id of this root node
- Specified by:
- getSystemId in interface NodeInfo
- Overrides:
- getSystemId in interface com.icl.saxon.tinytree.TinyNodeImpl
protected String getSystemId(int seq)
Get the system id of an element in the document
public String getUnparsedEntity(String name)
Get the unparsed entity with a given name
- Specified by:
- getUnparsedEntity in interface DocumentInfo
- Parameters:
name
- the name of the entity
- Returns:
- the URI of the entity if there is one, or empty string if not
public String getXmlEncoding()
An attribute specifying, as part of the XML declaration, the encoding of this document. This isnull
when unspecified or when it is not known, such as when theDocument
was created in memory.
- Since:
- DOM Level 3
public boolean getXmlStandalone()
An attribute specifying, as part of the XML declaration, whether this document is standalone. This isfalse
when unspecified. Note: No verification is done on the value when setting this attribute. Applications should useDocument.normalizeDocument()
with the "validate" parameter to verify if the value matches the validity constraint for standalone document declaration as defined in [XML 1.0].
- Since:
- DOM Level 3
public String getXmlVersion()
An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is"1.0"
.
- Since:
- DOM Level 3
protected boolean isUsingNamespaces()
determine whether this document uses namespaces
public void normalizeDocument()
This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form.
- Since:
- DOM Level 3
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
Rename an existing node of typeELEMENT_NODE
orATTRIBUTE_NODE
.
- Parameters:
n
- The node to rename.namespaceURI
- The new namespace URI.qualifiedName
- The new qualified name.
- Returns:
- The renamed node. This is either the specified node or the new node that was created to replace the specified node.
- Since:
- DOM Level 3
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.
public void setDocumentURI(String documentURI)
The location of the document ornull
if undefined or if theDocument
was created usingDOMImplementation.createDocument
. No lexical checking is performed when setting this attribute; this could result in anull
value returned when usingNode.baseURI
.
Beware that when theDocument
supports the feature "HTML" [DOM Level 2 HTML] , the href attribute of the HTML BASE element takes precedence over this attribute when computingNode.baseURI
.
- Since:
- DOM Level 3
public void setKeyIndex(KeyManager keymanager, int fingerprint, Hashtable keyindex)
Set the index for a given key. The method is synchronized because the same document can be used by several stylesheets at the same time.
- Specified by:
- setKeyIndex in interface DocumentInfo
- Parameters:
keymanager
- The key manager managing this keyfingerprint
- The fingerprint of the name of the key (unique with the key manager)keyindex
- the index, in the form of a Hashtable that maps the key value to a set of nodes having that key value. Or the String "under construction", indicating that the index is being built.
protected void setLineNumber(int sequence, int line)
Set the line number for an element. Ignored if line numbering is off.
public void setLineNumbering()
Set line numbering on
public void setNamePool(NamePool pool)
Set the name pool used for all names in this document
- Specified by:
- setNamePool in interface DocumentInfo
public void setStrictErrorChecking(boolean strictErrorChecking)
An attribute specifying whether error checking is enforced or not. When set tofalse
, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException
on DOM operations or report errors while usingDocument.normalizeDocument()
. In case of error, the behavior is undefined. This attribute istrue
by default.
- Since:
- DOM Level 3
public void setSystemId(String uri)
Set the system id of this node
- Overrides:
- setSystemId in interface com.icl.saxon.tinytree.TinyNodeImpl
protected void setSystemId(int seq, String uri)
Set the system id of an element in the document
protected void setUnparsedEntity(String name, String uri)
Set an unparsed entity URI associated with this document. For system use only, while building the document.
public void setXmlStandalone(boolean xmlStandalone) throws DOMException
An attribute specifying, as part of the XML declaration, whether this document is standalone. This isfalse
when unspecified. Note: No verification is done on the value when setting this attribute. Applications should useDocument.normalizeDocument()
with the "validate" parameter to verify if the value matches the validity constraint for standalone document declaration as defined in [XML 1.0].
- Since:
- DOM Level 3
public void setXmlVersion(String xmlVersion) throws DOMException
An attribute specifying, as part of the XML declaration, the version number of this document. If there is no declaration and if this document supports the "XML" feature, the value is"1.0"
. If this document does not support the "XML" feature, the value is alwaysnull
. Changing this attribute will affect methods that check for invalid characters in XML names. Application should invokeDocument.normalizeDocument()
in order to check for invalid characters in theNode
s that are already part of thisDocument
.
DOM applications may use theDOMImplementation.hasFeature(feature, version)
method with parameter values "XMLVersion" and "1.0" (respectively) to determine if an implementation supports [XML 1.0]. DOM applications may use the same method with parameter values "XMLVersion" and "1.1" (respectively) to determine if an implementation supports [XML 1.1]. In both cases, in order to support XML, an implementation must also support the "XML" feature defined in this specification.Document
objects supporting a version of the "XMLVersion" feature must not raise aNOT_SUPPORTED_ERR
exception for the same version number when usingDocument.xmlVersion
.
- Since:
- DOM Level 3
protected void truncate(int nodes)
Truncate the tree: used in preview mode to delete an element after it has been processed