DTMDefaultBase class serves as a helper base for DTMs.
It sets up structures for navigation and type, while leaving data
management and construction to the derived classes.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_BLOCKSIZE
The default block size of the node arrays |
| public static final int | DEFAULT_NUMBLOCKS
The number of blocks for the node arrays |
| public static final int | DEFAULT_NUMBLOCKS_SMALL
The number of blocks used for small documents & RTFs |
| pack-priv static final boolean | |
| protected String | m_documentBaseURI
The base URI for this document. |
| protected SuballocatedIntVector | m_dtmIdent
The document identity number(s). |
| protected int[][][] | m_elemIndexes
These hold indexes to elements based on namespace and local name. |
| protected ExpandedNameTable | m_expandedNameTable
The table for exandedNameID lookups. |
| protected SuballocatedIntVector | m_exptype
The expanded names, one array element for each node. |
| protected SuballocatedIntVector | m_firstch
First child values, one array element for each node. |
| protected boolean | m_indexing
true if indexing is turned on. |
| public DTMManager | m_mgr
The DTM manager who "owns" this DTM. |
| protected DTMManagerDefault | m_mgrDefault
m_mgr cast to DTMManagerDefault, or null if it isn't an instance (Efficiency hook) |
| protected SuballocatedIntVector | m_namespaceDeclSetElements
SuballocatedIntVector of elements at which corresponding namespaceDeclSets were defined |
| protected Vector | m_namespaceDeclSets
Vector of SuballocatedIntVectors of NS decl sets |
| protected SuballocatedIntVector | m_nextsib
Next sibling values, one array element for each node. |
| protected SuballocatedIntVector | m_parent
Previous sibling values, one array element for each node. |
| protected SuballocatedIntVector | m_prevsib
Previous sibling values, one array element for each node. |
| protected BoolStack | m_shouldStripWhitespaceStack
Stack of flags indicating whether to strip whitespace nodes |
| protected boolean | m_shouldStripWS
Flag indicating whether to strip whitespace nodes |
| protected int | m_size
The number of nodes, which is also used to determine the next node index. |
| protected DTMAxisTraverser[] | m_traversers
Stateless axis traversers, lazely built. |
| protected DTMWSFilter | m_wsfilter
The whitespace filter that enables elements to strip whitespace or not. |
| protected XMLStringFactory | m_xstrf
The XMLString factory for creating XMLStrings. |
| protected static final int | NOTPROCESSED
The value to use when the information has not been built yet. |
| public static final int | ROOTNODE
The identity of the root node. |
| Access | Constructor and Description |
|---|---|
| public | DTMDefaultBase(DTMManager
The DTMManager who owns this DTM. mgr, Source The object that is used to specify the construction source. source, int The DTM identity ID for this DTM. dtmIdentity, DTMWSFilter The white space filter for this DTM, which may
be null. whiteSpaceFilter, XMLStringFactory The factory to use for creating XMLStrings. xstringfactory, boolean true if the caller considers it worth it to use
indexing schemes. doIndexing)Construct a DTMDefaultBase object using the default block size. |
| public | DTMDefaultBase(DTMManager
The DTMManager who owns this DTM. mgr, Source The object that is used to specify the construction source. source, int The DTM identity ID for this DTM. dtmIdentity, DTMWSFilter The white space filter for this DTM, which may
be null. whiteSpaceFilter, XMLStringFactory The factory to use for creating XMLStrings. xstringfactory, boolean true if the caller considers it worth it to use
indexing schemes. doIndexing, int The block size of the DTM. blocksize, boolean true if we want to build the previous sibling node array. usePrevsib, boolean true if we want to use a new ExpandedNameTable for this DTM. newNameTable)Construct a DTMDefaultBase object from a DOM node. |
| Modifier and Type | Method and Description |
|---|---|
| protected int | Returns: The expanded type ID, or DTM.NULL.The node identity. identity)Get the expanded type ID for the given node identity. |
| protected int | Returns: The first child identity, or DTM.NULL.The node identity. identity)Get the first child for the given node identity. |
| protected int | Returns: The tree level, or DTM.NULL.The node identity. identity)Get the level in the tree for the given node identity. |
| protected int | Returns: The next sibling identity, or DTM.NULL.The node identity. identity)Get the next sibling for the given node identity. |
| protected int | Returns: The parent identity, or DTM.NULL.The node identity. identity)Get the parent for the given node identity. |
| protected int | Returns: The previous sibling identity, or DTM.NULL.The node identity. identity)Get the previous sibling for the given node identity. |
| protected short | Returns: The simple type ID, or DTM.NULL.The node identity. identity)Get the simple type ID for the given node identity. |
| public void | appendChild(int
Must be a valid new node handle. newChild, boolean true if the child should be cloned into the document. clone, boolean if the clone argument is true, specifies that the
clone should include all it's children. cloneDepth)Implements com. Append a child to the end of the document. |
| public void | appendTextChild(String
Non-null reverence to a string. str)Implements com. Append a text node child that will be constructed from a string, to the end of the document. |
| protected void | declareNamespaceInContext(int elementNodeIndex, int namespaceNodeIndex)
Build table of namespace declaration locations during DTM construction. |
| public abstract void | dispatchCharactersEvents(int
The node ID. nodeHandle, ContentHandler A non-null reference to a ContentHandler. ch, boolean true if the content should be normalized according to
the rules for the XPath
normalize-space
function. normalize)Redeclares com. Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
| public abstract void | dispatchToEvents(int
The node ID. nodeHandle, ContentHandler A non-null reference to a ContentHandler. ch)Redeclares com. Directly create SAX parser events from a subtree. |
| public void | documentRegistration()
Implements com. A dummy routine to satisify the abstract interface. |
| public void | documentRelease()
Implements com. A dummy routine to satisify the abstract interface. |
| public void | |
| public String | |
| protected void | ensureSizeOfIndex(int
Namespace ID index. namespaceID, int Local name ID. LocalNameID)Ensure that the size of the element indexes can hold the information. |
| protected void | |
| pack-priv int | Returns: The first node that is greater than or equal to the firstPotential argument, or DTM.NOTPROCESSED if not found.The namespace index lookup. nsIndex, int The local name index lookup. lnIndex, int The first potential match that is worth looking at. firstPotential)Find the first matching element from the index at or after the given node. |
| protected int | Returns: The index in the list of the slot that is higher or identical to the identity argument, or -1 if no node is higher or equal.A list of integers. list, int The start index to begin the search. start, int The number of items to search. len, int Find the slot that has a value that is greater than or
identical to this argument. value)Find the first index that occurs in the list that is greater than or equal to the given value. |
| protected int | Returns: If positive or zero, the index of the found item. If negative, index of the point at which it would have appeared, encoded as -1-index and hence reconvertable by subtracting it from -1. (Encoding because I don't want to recompare the strings but don't want to burn bytes on a datatype to hold a flagged value.)Subroutine: Locate the specified node within m_namespaceDeclSetElements, or the last element which preceeds it in document order %REVIEW% Inlne this into findNamespaceContext? |
| protected SuballocatedIntVector | findNamespaceContext(int elementNodeIndex)
Retrieve list of namespace declaration locations active at this node. |
| public abstract int | Returns: The attribute node handle with the specified name (nodeName) or DTM.NULL if there is no such
attribute.int Handle of the node upon which to look up this attribute.. nodeHandle, String The namespace URI of the attribute to
retrieve, or null. namespaceURI, String The local name of the attribute to
retrieve. name)Redeclares com. Retrieves an attribute node by by qualified name and namespace URI. |
| public int | Returns: int Node handle of document, which should always be valid.Implements com. Find the Document node handle for the document currently under construction. |
| public boolean | Returns: true if all declarations were processed;
false otherwise.Implements com. Return an indication of whether the processor has read the complete DTD. |
| public String | Returns: the document base URI String object or null if unknown.Implements com. Return the base URI of the document entity. |
| public String | Returns: the document encoding String object.The node id, which can be any valid node handle. nodeHandle)Implements com. Return the name of the character encoding scheme in which the document entity is expressed. |
| public int | Returns: int Node handle of owning document, or the nodeHandle if it is a Document.the id of the node. nodeHandle)Implements com. Given a node handle, find the owning document node. |
| public String | Returns: the document standalone String object, either "yes", "no", or null.The node id, which can be any valid node handle. nodeHandle)Implements com. Return an indication of the standalone status of the document, either "yes" or "no". |
| public String | Returns: the system identifier String object or null if unknown.The node id, which can be any valid node handle. nodeHandle)Implements com. Return the system identifier of the document entity. |
| public abstract String | Returns: the public identifier String object, or null if there is none.Redeclares com. Return the public identifier of the external subset, normalized as described in 4.2.2 External Entities [XML]. |
| public abstract String | Returns: the system identifier String object, or null if there is none.Redeclares com. A document type declaration information item has the following properties: 1. |
| public String | Returns: the document version String object.The document handle documentHandle)Implements com. Return a string representing the XML version of the document. |
| public SuballocatedIntVector | Returns: an IntVector, or null if this is a "stand-alone" DTM.Query which DTMIDs this DTM is currently using within the DTMManager. |
| public abstract int | Returns: The handle of the matching element.The unique elementId)id value for an element.Redeclares com. Returns the |
| public int | Returns: the expanded-name id of the node.The handle to the node in question. nodeHandle)Implements com. Given a node handle, return an ID that represents the node's expanded name. |
| public int | Returns: the expanded-name id of the node.The namespace URI, which may be null, may be an empty
string (which will be the same as null), or may be a
namespace URI. namespace, String The local name string, which must be a valid
NCName. localName, int The simple type, i.e. one of ELEMENT, ATTRIBUTE, etc. type)Implements com. Given an expanded name, return an ID. If the expanded-name does not exist in the internal tables, the entry will be created, and the ID will be returned. |
| public int | Returns: Handle of first attribute, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle)Implements com. Given a node handle, get the index of the node's first attribute. |
| protected int | Returns: Identity of first attribute, or DTM.NULL to indicate none exists.int identity of the node. identity)Given a node identity, get the index of the node's first attribute. |
| public int | Returns: int DTM node-number of first child, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle)Implements com. Given a node handle, get the handle of the node's first child. |
| public int | Returns: handle of first namespace, or DTM.NULL to indicate none exists.handle to node, which should probably be an element
node, but need not be. nodeHandle, boolean true if all namespaces in scope should be returned,
false if only the namespace declarations should be
returned. inScope)Implements com. Given a node handle, get the index of the node's first child. |
| public int | Returns: int Node-number of last child, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle)Implements com. Given a node handle, advance to its last child. |
| public short | Returns: the number of ancestors, plus oneThe node id. nodeHandle)Implements com. Get the depth level of this node in the tree (equals 1 for a parentless node). |
| public abstract String | Returns: String Local name of this node.the id of the node. nodeHandle)Redeclares com. Given a node handle, return its XPath-style localname. |
| public String | Returns: String Local name of this node.an ID that represents an expanded-name. expandedNameID)Implements com. Given an expanded-name ID, return the local name part. |
| public DTMManager | Returns: a DTMManager, or null if this is a "stand-alone" DTM.Query which DTMManager this DTM is currently being handled by. |
| public String | Returns: String URI value of this node's namespace, or null if no namespace was resolved.an ID that represents an expanded-name. expandedNameID)Implements com. Given an expanded-name ID, return the namespace URI part. |
| public int | Returns: the ID of the namespace.the id of the node. nodeHandle)Returns the namespace type of a specific node |
| public abstract String | Returns: String URI value of this node's namespace, or null if no namespace was resolved.the id of the node. nodeHandle)Redeclares com. Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.) %REVIEW% Null or ""? |
| public int | Returns: int DTM node-number of the resolved attr, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle)Implements com. Given a node handle, advance to the next attribute. |
| protected int | Returns: int DTM node-identity of the resolved attr, or DTM.NULL to indicate none exists.int identity of the attribute node. This
must be an attribute node. identity)Given a node identity for an attribute, advance to the next attribute. |
| public int | Returns: handle of next namespace, or DTM.NULL to indicate none exists.handle to original node from where the first namespace
was relative to (needed to return nodes in document order). baseHandle, int A namespace handle for which we will find the next node. nodeHandle, boolean true if all namespaces that are in scope should be processed,
otherwise just process the nodes in the given element handle. inScope)Implements com. Given a namespace handle, advance to the next namespace. |
| protected abstract int | Returns: identity+1, or DTM.NULL.The node identity (index). identity)Get the next node identity value in the list, and call the iterator if it hasn't been added yet. |
| public int | Returns: int Node-number of next sibling, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle)Implements com. Given a node handle, advance to its next sibling. |
| public Node | Returns: A node representation of the DTM node.The node ID. nodeHandle)Implements com. Return an DOM node for the given node. |
| public int | Returns: the node handleThe node identity. nodeId)Get the handle of this node in the tree |
| public int | Returns: the node identityThe node handle. nodeHandle)Get the identity of this node in the tree |
| public abstract String | Returns: String Name of this node, which may be an empty string. %REVIEW% Document when empty string is possible... %REVIEW-COMMENT% It should never be empty, should it?the id of the node. nodeHandle)Redeclares com. Given a node handle, return its DOM-style node name. |
| public String | Returns: String Name of this node, which may be an empty string.the id of the node. nodeHandle)Implements com. Given a node handle, return the XPath node name. |
| public short | Returns: int Node type, as per the DOM's Node._NODE constants.The node id. nodeHandle)Implements com. Given a node handle, return its DOM-style node type. |
| public abstract String | Returns: String Value of this node, or null if not meaningful for this node type.The node id. nodeHandle)Redeclares com. Given a node handle, return its node value. |
| protected abstract int | Returns: the number of nodes that have been mapped.Get the number of nodes that have been added. |
| public int | Returns: int Node handle of owning document, or -1 if the node was a Docmentthe id of the node. nodeHandle)Implements com. Given a node handle, find the owning document node. |
| public int | Returns: int Node-number of parent, or DTM.NULL to indicate none exists.the id of the node. nodeHandle)Implements com. Given a node handle, find its parent node. |
| public abstract String | Returns: String prefix of this node's name, or "" if no explicit namespace prefix was given.the id of the node. nodeHandle)Redeclares com. Given a namespace handle, return the prefix that the namespace decl is mapping. |
| public int | Returns: int Node-number of the previous sib, or DTM.NULL to indicate none exists.the id of the node. nodeHandle)Implements com. Given a node handle, find its preceeding sibling. |
| protected boolean | Returns: whether or not to strip whispace nodes.Find out whether or not to strip whispace nodes. |
| public abstract XMLString | Returns: A string object that represents the string-value of the given node.The node ID. nodeHandle)Redeclares com. Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value). |
| public char[] | Returns: The character array reference where the chunk occurs.The node ID. nodeHandle, int Which chunk to get. chunkIndex, int[] An array of 2 where the start position and length of
the chunk will be returned. startAndLen)Implements com. Get a character array chunk in the string-value of a node. |
| public int | Returns: number of character array chunks in the string-value of a node.The node ID. nodeHandle)Implements com. Get number of character array chunks in the string-value of a node. |
| protected int | Returns: Handle of attribute of the required type, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle, int int expanded type ID of the required attribute. attType)Given a node handle and an expanded type ID, get the index of the node's attribute of that type, if any. |
| public int | Returns: int DTM node-number of first child, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle, int nodeType)Given a node handle, get the handle of the node's first child. |
| public int | Returns: int Node-number of next sibling, or DTM.NULL to indicate none exists.int Handle of the node. nodeHandle, int nodeType)Given a node handle, advance to its next sibling. |
| public abstract String | Returns: String containing the URI of the Unparsed Entity, or an empty string if no such entity exists.A string containing the Entity Name of the unparsed
entity. name)Redeclares com. The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]). |
| public boolean | Returns: int true if the given node has child nodes.int Handle of the node. nodeHandle)Implements com. Given a node handle, test if it has child nodes. |
| protected void | indexNode(int
The expanded type ID of the node. expandedTypeID, int The node identity index. identity)Add a node to the element indexes. |
| public abstract boolean | Returns: true if the attribute was specified;
false if it was defaulted.The attribute handle in question. attributeHandle)Redeclares com. 5. |
| public boolean | Returns: true if the character data is whitespace;
false otherwise.the node ID. nodeHandle)Implements com. 2. |
| public boolean | Returns: true if all declarations were processed;
false otherwise.A node handle that must identify a document. documentHandle)Implements com. 10. |
| public boolean | Returns: true if node1 comes before node2, otherwise return false. You can think of this as(node1.documentOrderPosition <= node2.documentOrderPosition).Node handle to perform position comparison on. nodeHandle1, int Second Node handle to perform position comparison on . nodeHandle2)Implements com. Figure out whether nodeHandle2 should be considered as being later in the document than nodeHandle1, in Document Order as defined by the XPath model. |
| public boolean | Returns: Returnstrue if the specified feature is
supported on this node, false otherwise.The name of the feature to test. feature, String This is the version number of the feature to test.
If the version is not
specified, supporting any version of the feature will cause the
method to return version)true.Implements com. Tests whether DTM DOM implementation implements a specific feature and that feature is supported by this node. |
| public final int | Returns: NodeHandle (external representation of node)Internal offset to this node's records. nodeIdentity)Given a node identity, return a node handle. |
| public final int | Returns: nodeIdentity Internal offset to this node's records.(external representation of node) nodeHandle)Given a node handle, return a node identity. |
| public void | migrateTo(DTMManager
the DTMManager mgr)Implements com. Migrate a DTM built with an old DTMManager to a new DTMManager. |
| protected abstract boolean | Returns: The true if a next node is found or false if there are no more nodes.This method should try and build one or more nodes in the table. |
| protected void | popShouldStripWhitespace()
Set whether to strip whitespaces at this point by popping out m_shouldStripWhitespaceStack. |
| protected void | pushShouldStripWhitespace(boolean
Flag indicating whether to strip whitespace nodes shouldStrip)Set whether to strip whitespaces and push in current value of m_shouldStripWS in m_shouldStripWhitespaceStack. |
| public void | setDocumentBaseURI(String
the document base URI String object or null if unknown. baseURI)Implements com. Set the base URI of the document entity. |
| public void | setFeature(String
A feature URL. featureId, boolean true if this feature should be on, false otherwise. state)Implements com. Set an implementation dependent feature. |
| protected void | setShouldStripWhitespace(boolean
Flag indicating whether to strip whitespace nodes shouldStrip)Set whether to strip whitespaces and set the top of the stack to the current value of m_shouldStripWS. |
| public boolean | Returns: true if this DTM supports prestripping.Implements com. Return true if the xsl:strip-space or xsl:preserve-space was processed during construction of the DTM document. |