org.apache.xerces.dom
public class DeferredDocumentImpl extends DocumentImpl implements DeferredNode
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a Document, the Document interface also contains the factory methods needed to create these objects. The Node objects created have a ownerDocument attribute which associates them with the Document within whose context they were created.
Since: PR-DOM-Level-1-19980818.
Version: $Id: DeferredDocumentImpl.java,v 1.58 2005/03/07 23:28:40 mrglavas Exp $
Field Summary | |
---|---|
protected static int | CHUNK_MASK Chunk mask. |
protected static int | CHUNK_SHIFT Chunk shift. |
protected static int | CHUNK_SIZE Chunk size. |
protected int | fIdCount Identifier count. |
protected int[] | fIdElement Identifier element indexes. |
protected String[] | fIdName Identifier name indexes. |
protected boolean | fNamespacesEnabled DOM2: For namespace support in the deferred case. |
protected int | fNodeCount Node count. |
protected int[][] | fNodeExtra Extra data. |
protected int[][] | fNodeLastChild Node first children. |
protected Object[][] | fNodeName Node names. |
protected int[][] | fNodeParent Node parents. |
protected int[][] | fNodePrevSib Node prev siblings. |
protected int[][] | fNodeType Node types. |
protected Object[][] | fNodeURI Node namespace URI. |
protected Object[][] | fNodeValue Node values. |
protected static int | INITIAL_CHUNK_COUNT Initial chunk size. |
Constructor Summary | |
---|---|
DeferredDocumentImpl()
NON-DOM: Actually creating a Document is outside the DOM's spec,
since it has to operate in terms of a particular implementation. | |
DeferredDocumentImpl(boolean namespacesEnabled)
NON-DOM: Actually creating a Document is outside the DOM's spec,
since it has to operate in terms of a particular implementation. | |
DeferredDocumentImpl(boolean namespaces, boolean grammarAccess) Experimental constructor. |
Method Summary | |
---|---|
void | appendChild(int parentIndex, int childIndex) Appends a child to the specified parent in the table. |
protected static int | binarySearch(int[] values, int start, int end, int target)
Performs a binary search for a target value in an array of
values. |
int | cloneNode(int nodeIndex, boolean deep) Creates a clone of the specified node. |
int | createDeferredAttribute(String attrName, String attrValue, boolean specified) Creates an attribute in the table. |
int | createDeferredAttribute(String attrName, String attrURI, String attrValue, boolean specified) Creates an attribute with a URI in the table. |
int | createDeferredCDATASection(String data) Creates a CDATA section node in the table. |
int | createDeferredComment(String data) Creates a comment node in the table. |
int | createDeferredDocument() Creates a document node in the table. |
int | createDeferredDocumentType(String rootElementName, String publicId, String systemId) Creates a doctype. |
int | createDeferredElement(String elementURI, String elementName, Object type) Creates an element node with a URI in the table and type information. |
int | createDeferredElement(String elementName) |
int | createDeferredElement(String elementURI, String elementName) |
int | createDeferredElementDefinition(String elementName) Creates an element definition in the table. |
int | createDeferredEntity(String entityName, String publicId, String systemId, String notationName, String baseURI) Creates an entity in the table. |
int | createDeferredEntityReference(String name, String baseURI) Creates an entity reference node in the table. |
int | createDeferredNotation(String notationName, String publicId, String systemId, String baseURI) Creates a notation in the table. |
int | createDeferredProcessingInstruction(String target, String data) Creates a processing instruction node in the table. |
int | createDeferredTextNode(String data, boolean ignorableWhitespace) Creates a text node in the table. |
protected int | createNode(short nodeType) Creates a node of the specified type. |
protected void | ensureCapacity(int chunk) Ensures that the internal tables are large enough. |
String | getAttribute(int elemIndex, String name) Returns the attribute value of the given name. |
String | getDeferredEntityBaseURI(int entityIndex) |
DOMImplementation | getImplementation()
Retrieve information describing the abilities of this particular
DOM implementation. |
int | getLastChild(int nodeIndex) Returns the last child of the given node. |
int | getLastChild(int nodeIndex, boolean free)
Returns the last child of the given node. |
int | getNodeExtra(int nodeIndex)
Returns the extra info of the given node.
|
int | getNodeExtra(int nodeIndex, boolean free)
Returns the extra info of the given node. |
int | getNodeIndex() Returns the node index. |
String | getNodeName(int nodeIndex) Returns the name of the given node. |
String | getNodeName(int nodeIndex, boolean free)
Returns the name of the given node. |
DeferredNode | getNodeObject(int nodeIndex) Instantiates the requested node object. |
short | getNodeType(int nodeIndex) Returns the type of the given node. |
short | getNodeType(int nodeIndex, boolean free)
Returns the type of the given node. |
String | getNodeURI(int nodeIndex) Returns the URI of the given node. |
String | getNodeURI(int nodeIndex, boolean free)
Returns the URI of the given node. |
String | getNodeValue(int nodeIndex)
Returns the value of the given node. |
String | getNodeValue(int nodeIndex, boolean free)
Returns the value of the given node. |
String | getNodeValueString(int nodeIndex) Returns the real value of the given node. |
String | getNodeValueString(int nodeIndex, boolean free)
Returns the real value of the given node. |
int | getParentNode(int nodeIndex)
Returns the parent node of the given node.
|
int | getParentNode(int nodeIndex, boolean free)
Returns the parent node of the given node. |
int | getPrevSibling(int nodeIndex)
Returns the prev sibling of the given node.
|
int | getPrevSibling(int nodeIndex, boolean free)
Returns the prev sibling of the given node. |
int | getRealPrevSibling(int nodeIndex)
Returns the real prev sibling of the given node,
directly from the data structures. |
int | getRealPrevSibling(int nodeIndex, boolean free)
Returns the real prev sibling of the given node. |
Object | getTypeInfo(int nodeIndex)
Clears the type info that is stored in the fNodeValue array |
int | insertBefore(int parentIndex, int newChildIndex, int refChildIndex) Inserts a child before the specified node in the table. |
int | lookupElementDefinition(String elementName)
Returns the index of the element definition in the table
with the specified name index, or -1 if no such definition
exists. |
void | print() Prints out the tables. |
void | putIdentifier(String name, int elementNodeIndex) Registers an identifier name with a specified element node. |
void | setAsLastChild(int parentIndex, int childIndex) Sets the last child of the parentIndex to childIndex. |
int | setAttributeNode(int elemIndex, int attrIndex) Adds an attribute node to the specified element. |
int | setDeferredAttribute(int elementNodeIndex, String attrName, String attrURI, String attrValue, boolean specified, boolean id, Object type)
This method is used by the DOMParser to create attributes. |
int | setDeferredAttribute(int elementNodeIndex, String attrName, String attrURI, String attrValue, boolean specified) |
void | setEntityInfo(int currentEntityDecl, String version, String encoding) |
void | setIdAttribute(int attrIndex) Sets type of attribute |
void | setIdAttributeNode(int elemIndex, int attrIndex) Adds an attribute node to the specified element. |
void | setInputEncoding(int currentEntityDecl, String value)
DOM Internal
An attribute specifying the actual encoding of this document. |
void | setInternalSubset(int doctypeIndex, String subset) |
protected void | synchronizeChildren()
Synchronizes the node's children with the internal structure.
|
protected void | synchronizeChildren(AttrImpl a, int nodeIndex)
Synchronizes the node's children with the internal structure.
|
protected void | synchronizeChildren(ParentNode p, int nodeIndex)
Synchronizes the node's children with the internal structure.
|
protected void | synchronizeData() Synchronizes the node's data. |
Parameters: values The array of values to search. start The starting offset of the search. end The ending offset of the search. target The target value.
Returns: This function will return the first occurrence of the target value, or -1 if the target value cannot be found.
UNKNOWN: Creates an element node in the table.
UNKNOWN: Creates an element node with a URI in the table.
Parameters: free True to free child index.
Parameters: free True to free the value index.
Parameters: free True to free the string index.
Parameters: free True to free type index.
Parameters: free True to free URI index.
Parameters: free True to free the value index.
Parameters: free True to free the string index.
Parameters: free True to free parent node.
Parameters: free True to free sibling index.
Parameters: free True to free sibling index.
Parameters: nodeIndex
Returns: Object - type information for the attribute/element node
Parameters: elementNodeIndex attrName attrURI attrValue specified id type
Returns: int
UNKNOWN: Sets an attribute on an element node.
null
otherwise.