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.
Modifier and Type | Class and Description |
---|---|
pack-priv static class | DeferredDocumentImpl.
A simple integer vector. |
pack-priv static class |
Modifier and Type | Field and Description |
---|---|
protected static final int | CHUNK_MASK
Chunk mask. |
protected static final int | CHUNK_SHIFT
Chunk shift. |
protected static final int | CHUNK_SIZE
Chunk size. |
private static final boolean | DEBUG_IDS
To debug identifiers set to true and recompile. |
private static final boolean | DEBUG_PRINT_REF_COUNTS
To include code for printing the ref count tables. |
private static final boolean | DEBUG_PRINT_TABLES
To include code for printing the internal tables. |
private final transient StringBuilder | |
protected transient int | fIdCount
Identifier count. |
protected transient int[] | fIdElement
Identifier element indexes. |
protected transient String[] | fIdName
Identifier name indexes. |
protected boolean | fNamespacesEnabled
DOM2: For namespace support in the deferred case. |
protected transient int | fNodeCount
Node count. |
protected transient int[][] | fNodeExtra
Extra data. |
protected transient int[][] | fNodeLastChild
Node first children. |
protected transient Object[][] | fNodeName
Node names. |
protected transient int[][] | fNodeParent
Node parents. |
protected transient int[][] | fNodePrevSib
Node prev siblings. |
protected transient int[][] | fNodeType
Node types. |
protected transient Object[][] | fNodeURI
Node namespace URI. |
protected transient Object[][] | fNodeValue
Node values. |
private final transient List | |
private static final int[] | |
protected static final int | INITIAL_CHUNK_COUNT
Initial chunk size. |
pack-priv static final long | serialVersionUID
Hides com. |
Access | Constructor and Description |
---|---|
public | DeferredDocumentImpl()
NON-DOM: Actually creating a Document is outside the DOM's spec, since it has to operate in terms of a particular implementation. |
public | 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. |
public |
Modifier and Type | Method and Description |
---|---|
public void | |
protected static int | Returns: This function will return the first occurrence of the target value, or -1 if the target value cannot be found.The array of values to search. values, int The starting offset of the search. start, int The ending offset of the search. end, int The target value. target)Performs a binary search for a target value in an array of values. |
private final int | Returns: Returns the old value.Clears the specified value in the given data at the chunk and index. |
private final String | |
public int | |
private final void | |
private final void | |
public int | createDeferredAttribute(String attrName, String attrValue, boolean specified)
Creates an attribute in the table. |
public int | createDeferredAttribute(String attrName, String attrURI, String attrValue, boolean specified)
Creates an attribute with a URI in the table. |
public int | |
public int | |
public int | |
public int | createDeferredDocumentType(String rootElementName, String publicId, String systemId)
Creates a doctype. |
public int | createDeferredElement(String elementURI, String elementName, Object type)
Deprecated
Creates an element node with a URI in the table and type information. |
public int | |
public int | createDeferredElement(String elementURI, String elementName)
Creates an element node with a URI in the table. |
public int | |
public int | |
public int | createDeferredEntityReference(String name, String baseURI)
Creates an entity reference node in the table. |
public int | createDeferredNotation(String notationName, String publicId, String systemId, String baseURI)
Creates a notation in the table. |
public int | createDeferredProcessingInstruction(String target, String data)
Creates a processing instruction node in the table. |
public int | |
protected int | |
protected void | |
public String | |
private final int | getChunkIndex(int[][] data, int chunk, int index)
Returns the specified value in the given data at the chunk and index. |
private final String | |
public String | |
public DOMImplementation | getImplementation()
Overrides com. Implements org. Retrieve information describing the abilities of this particular DOM implementation. |
public int | |
public int | getLastChild(int nodeIndex, boolean
True to free child index. free)Returns the last child of the given node. |
pack-priv boolean | |
public int | |
public int | getNodeExtra(int nodeIndex, boolean
True to free the value index. free)Returns the extra info of the given node. |
public int | getNodeIndex()
Implements com. Returns the node index. |
public String | |
public String | getNodeName(int nodeIndex, boolean
True to free the string index. free)Returns the name of the given node. |
public DeferredNode | |
public short | |
public short | |
public String | |
public String | |
public String | |
public String | getNodeValue(int nodeIndex, boolean
True to free the value index. free)Returns the value of the given node. |
private final String | |
public String | |
public String | getNodeValueString(int nodeIndex, boolean
True to free the string index. free)Returns the real value of the given node. |
public int | |
public int | getParentNode(int nodeIndex, boolean
True to free parent node. free)Returns the parent node of the given node. |
public int | |
public int | getPrevSibling(int nodeIndex, boolean
True to free sibling index. free)Returns the prev sibling of the given node. |
public int | getRealPrevSibling(int nodeIndex)
Returns the real prev sibling of the given node, directly from the data structures. |
public int | getRealPrevSibling(int nodeIndex, boolean
True to free sibling index. free)Returns the real prev sibling of the given node. |
public Object | Returns: Object - type information for the attribute/element nodeClears the type info that is stored in the fNodeValue array |
public int | insertBefore(int parentIndex, int newChildIndex, int refChildIndex)
Inserts a child before the specified node in the table. |
public 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. |
public void | |
private static void | |
public void | putIdentifier(String name, int elementNodeIndex)
Registers an identifier name with a specified element node. |
private final void | putIdentifier0(String idName, Element element)
This version of putIdentifier is needed to avoid fluffing all of the paths to ID attributes when a node object is created that contains an ID attribute. |
public void | setAsLastChild(int parentIndex, int childIndex)
Sets the last child of the parentIndex to childIndex. |
public int | |
private final int | Returns: Returns the old value.Sets the specified value in the given of data at the chunk and index. |
private final String | |
public int | Returns: intThis method is used by the DOMParser to create attributes. |
public void | |
public void | |
public void | |
public void | setInputEncoding(int currentEntityDecl, String value)
DOM Internal An attribute specifying the actual encoding of this document. |
public void | |
pack-priv void | |
public void | |
protected void | synchronizeChildren()
Overrides com. Synchronizes the node's children with the internal structure. |
protected final void | synchronizeChildren(AttrImpl a, int nodeIndex)
Synchronizes the node's children with the internal structure. |
protected final void | synchronizeChildren(ParentNode p, int nodeIndex)
Synchronizes the node's children with the internal structure. |
protected void | synchronizeData()
Overrides com. Synchronizes the node's data. |
CHUNK_MASK | back to summary |
---|---|
protected static final int CHUNK_MASK Chunk mask. |
CHUNK_SHIFT | back to summary |
---|---|
protected static final int CHUNK_SHIFT Chunk shift. |
CHUNK_SIZE | back to summary |
---|---|
protected static final int CHUNK_SIZE Chunk size. |
DEBUG_IDS | back to summary |
---|---|
private static final boolean DEBUG_IDS To debug identifiers set to true and recompile. |
DEBUG_PRINT_REF_COUNTS | back to summary |
---|---|
private static final boolean DEBUG_PRINT_REF_COUNTS To include code for printing the ref count tables. |
DEBUG_PRINT_TABLES | back to summary |
---|---|
private static final boolean DEBUG_PRINT_TABLES To include code for printing the internal tables. |
fBufferStr | back to summary |
---|---|
private final transient StringBuilder fBufferStr |
fIdCount | back to summary |
---|---|
protected transient int fIdCount Identifier count. |
fIdElement | back to summary |
---|---|
protected transient int[] fIdElement Identifier element indexes. |
fIdName | back to summary |
---|---|
protected transient String[] fIdName Identifier name indexes. |
fNamespacesEnabled | back to summary |
---|---|
protected boolean fNamespacesEnabled DOM2: For namespace support in the deferred case. |
fNodeCount | back to summary |
---|---|
protected transient int fNodeCount Node count. |
fNodeExtra | back to summary |
---|---|
protected transient int[][] fNodeExtra Extra data. |
fNodeLastChild | back to summary |
---|---|
protected transient int[][] fNodeLastChild Node first children. |
fNodeName | back to summary |
---|---|
protected transient Object[][] fNodeName Node names. |
fNodeParent | back to summary |
---|---|
protected transient int[][] fNodeParent Node parents. |
fNodePrevSib | back to summary |
---|---|
protected transient int[][] fNodePrevSib Node prev siblings. |
fNodeType | back to summary |
---|---|
protected transient int[][] fNodeType Node types. |
fNodeURI | back to summary |
---|---|
protected transient Object[][] fNodeURI Node namespace URI. |
fNodeValue | back to summary |
---|---|
protected transient Object[][] fNodeValue Node values. |
fStrChunks | back to summary |
---|---|
private final transient List<String> fStrChunks |
INIT_ARRAY | back to summary |
---|---|
private static final int[] INIT_ARRAY |
INITIAL_CHUNK_COUNT | back to summary |
---|---|
protected static final int INITIAL_CHUNK_COUNT Initial chunk size. |
serialVersionUID | back to summary |
---|---|
pack-priv static final long serialVersionUID Hides com. Serialization version. |
DeferredDocumentImpl | back to summary |
---|---|
public 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 | back to summary |
---|---|
public 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 | back to summary |
---|---|
public DeferredDocumentImpl(boolean namespaces, boolean grammarAccess) Experimental constructor. |
appendChild | back to summary |
---|---|
public void appendChild(int parentIndex, int childIndex) Appends a child to the specified parent in the table. |
binarySearch | back to summary |
---|---|
protected static int binarySearch(final int[] values, int start, int end, int target) Performs a binary search for a target value in an array of values. The array of values must be in ascending sorted order before calling this method and all array values must be non-negative.
|
clearChunkIndex | back to summary |
---|---|
private final int clearChunkIndex(int[][] data, int chunk, int index) Clears the specified value in the given data at the chunk and index. Note that this method will clear the given chunk if the reference count becomes zero.
|
clearChunkValue | back to summary |
---|---|
private final String clearChunkValue(Object[][] data, int chunk, int index) |
cloneNode | back to summary |
---|---|
public int cloneNode(int nodeIndex, boolean deep) Creates a clone of the specified node. |
createChunk | back to summary |
---|---|
private final void createChunk(int[][] data, int chunk) Creates the specified chunk in the given array of chunks. |
createChunk | back to summary |
---|---|
private final void createChunk(Object[][] data, int chunk) |
createDeferredAttribute | back to summary |
---|---|
public int createDeferredAttribute(String attrName, String attrValue, boolean specified) Creates an attribute in the table. |
createDeferredAttribute | back to summary |
---|---|
public int createDeferredAttribute(String attrName, String attrURI, String attrValue, boolean specified) Creates an attribute with a URI in the table. |
createDeferredCDATASection | back to summary |
---|---|
public int createDeferredCDATASection(String data) Creates a CDATA section node in the table. |
createDeferredComment | back to summary |
---|---|
public int createDeferredComment(String data) Creates a comment node in the table. |
createDeferredDocument | back to summary |
---|---|
public int createDeferredDocument() Creates a document node in the table. |
createDeferredDocumentType | back to summary |
---|---|
public int createDeferredDocumentType(String rootElementName, String publicId, String systemId) Creates a doctype. |
createDeferredElement | back to summary |
---|---|
public int createDeferredElement(String elementURI, String elementName, Object type)
Deprecated
Creates an element node with a URI in the table and type information.
|
createDeferredElement | back to summary |
---|---|
public int createDeferredElement(String elementName)
Deprecated
Creates an element node in the table.
|
createDeferredElement | back to summary |
---|---|
public int createDeferredElement(String elementURI, String elementName) Creates an element node with a URI in the table. |
createDeferredElementDefinition | back to summary |
---|---|
public int createDeferredElementDefinition(String elementName) Creates an element definition in the table. |
createDeferredEntity | back to summary |
---|---|
public int createDeferredEntity(String entityName, String publicId, String systemId, String notationName, String baseURI) Creates an entity in the table. |
createDeferredEntityReference | back to summary |
---|---|
public int createDeferredEntityReference(String name, String baseURI) Creates an entity reference node in the table. |
createDeferredNotation | back to summary |
---|---|
public int createDeferredNotation(String notationName, String publicId, String systemId, String baseURI) Creates a notation in the table. |
createDeferredProcessingInstruction | back to summary |
---|---|
public int createDeferredProcessingInstruction(String target, String data) Creates a processing instruction node in the table. |
createDeferredTextNode | back to summary |
---|---|
public int createDeferredTextNode(String data, boolean ignorableWhitespace) Creates a text node in the table. |
createNode | back to summary |
---|---|
protected int createNode(short nodeType) Creates a node of the specified type. |
ensureCapacity | back to summary |
---|---|
protected void ensureCapacity(int chunk) Ensures that the internal tables are large enough. |
getAttribute | back to summary |
---|---|
public String getAttribute(int elemIndex, String name) Returns the attribute value of the given name. |
getChunkIndex | back to summary |
---|---|
private final int getChunkIndex(int[][] data, int chunk, int index) Returns the specified value in the given data at the chunk and index. |
getChunkValue | back to summary |
---|---|
private final String getChunkValue(Object[][] data, int chunk, int index) |
getDeferredEntityBaseURI | back to summary |
---|---|
public String getDeferredEntityBaseURI(int entityIndex) |
getImplementation | back to summary |
---|---|
public DOMImplementation getImplementation() Overrides com. Implements org. Retrieve information describing the abilities of this particular DOM implementation. Intended to support applications that may be using DOMs retrieved from several different sources, potentially with different underlying representations. |
getLastChild | back to summary |
---|---|
public int getLastChild(int nodeIndex) Returns the last child of the given node. |
getLastChild | back to summary |
---|---|
public int getLastChild(int nodeIndex, boolean free) Returns the last child of the given node.
|
getNamespacesEnabled | back to summary |
---|---|
pack-priv boolean getNamespacesEnabled() Returns the cached parser.getNamespaces() value. |
getNodeExtra | back to summary |
---|---|
public int getNodeExtra(int nodeIndex) Returns the extra info of the given node. Used by AttrImpl to store specified value (1 == true). |
getNodeExtra | back to summary |
---|---|
public int getNodeExtra(int nodeIndex, boolean free) Returns the extra info of the given node.
|
getNodeIndex | back to summary |
---|---|
public int getNodeIndex() Implements com. Returns the node index. |
getNodeName | back to summary |
---|---|
public String getNodeName(int nodeIndex) Returns the name of the given node. |
getNodeName | back to summary |
---|---|
public String getNodeName(int nodeIndex, boolean free) Returns the name of the given node.
|
getNodeObject | back to summary |
---|---|
public DeferredNode getNodeObject(int nodeIndex) Instantiates the requested node object. |
getNodeType | back to summary |
---|---|
public short getNodeType(int nodeIndex) Returns the type of the given node. |
getNodeType | back to summary |
---|---|
public short getNodeType(int nodeIndex, boolean free) Returns the type of the given node.
|
getNodeURI | back to summary |
---|---|
public String getNodeURI(int nodeIndex) Returns the URI of the given node. |
getNodeURI | back to summary |
---|---|
public String getNodeURI(int nodeIndex, boolean free) Returns the URI of the given node.
|
getNodeValue | back to summary |
---|---|
public String getNodeValue(int nodeIndex) Returns the value of the given node. |
getNodeValue | back to summary |
---|---|
public String getNodeValue(int nodeIndex, boolean free) Returns the value of the given node.
|
getNodeValue | back to summary |
---|---|
private final String getNodeValue(int chunk, int index) |
getNodeValueString | back to summary |
---|---|
public String getNodeValueString(int nodeIndex) Returns the real value of the given node. |
getNodeValueString | back to summary |
---|---|
public String getNodeValueString(int nodeIndex, boolean free) Returns the real value of the given node.
|
getParentNode | back to summary |
---|---|
public int getParentNode(int nodeIndex) Returns the parent node of the given node. Calling this method does not free the parent index. |
getParentNode | back to summary |
---|---|
public int getParentNode(int nodeIndex, boolean free) Returns the parent node of the given node.
|
getPrevSibling | back to summary |
---|---|
public int getPrevSibling(int nodeIndex) Returns the prev sibling of the given node. This is post-normalization of Text Nodes. |
getPrevSibling | back to summary |
---|---|
public int getPrevSibling(int nodeIndex, boolean free) Returns the prev sibling of the given node.
|
getRealPrevSibling | back to summary |
---|---|
public int getRealPrevSibling(int nodeIndex) Returns the real prev sibling of the given node, directly from the data structures. Used by TextImpl#getNodeValue() to normalize values. |
getRealPrevSibling | back to summary |
---|---|
public int getRealPrevSibling(int nodeIndex, boolean free) Returns the real prev sibling of the given node.
|
getTypeInfo | back to summary |
---|---|
public Object getTypeInfo(int nodeIndex) Clears the type info that is stored in the fNodeValue array
|
insertBefore | back to summary |
---|---|
public int insertBefore(int parentIndex, int newChildIndex, int refChildIndex) Inserts a child before the specified node in the table. |
lookupElementDefinition | back to summary |
---|---|
public 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. |
back to summary | |
---|---|
public void print() Prints out the tables. |
back to summary | |
---|---|
private static void print(int[] values, int start, int end, int middle, int target) Prints the ID array. |
putIdentifier | back to summary |
---|---|
public void putIdentifier(String name, int elementNodeIndex) Registers an identifier name with a specified element node. |
putIdentifier0 | back to summary |
---|---|
private final void putIdentifier0(String idName, Element element) This version of putIdentifier is needed to avoid fluffing all of the paths to ID attributes when a node object is created that contains an ID attribute. |
setAsLastChild | back to summary |
---|---|
public void setAsLastChild(int parentIndex, int childIndex) Sets the last child of the parentIndex to childIndex. |
setAttributeNode | back to summary |
---|---|
public int setAttributeNode(int elemIndex, int attrIndex) Adds an attribute node to the specified element. |
setChunkIndex | back to summary |
---|---|
private final int setChunkIndex(int[][] data, int value, int chunk, int index) Sets the specified value in the given of data at the chunk and index.
|
setChunkValue | back to summary |
---|---|
private final String setChunkValue(Object[][] data, Object value, int chunk, int index) |
setDeferredAttribute | back to summary |
---|---|
public 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.
|
setEntityInfo | back to summary |
---|---|
public void setEntityInfo(int currentEntityDecl, String version, String encoding) |
setIdAttribute | back to summary |
---|---|
public void setIdAttribute(int attrIndex) Sets type of attribute |
setIdAttributeNode | back to summary |
---|---|
public void setIdAttributeNode(int elemIndex, int attrIndex) Adds an attribute node to the specified element. |
setInputEncoding | back to summary |
---|---|
public void setInputEncoding(int currentEntityDecl, String value) DOM Internal
An attribute specifying the actual encoding of this document. This is
|
setInternalSubset | back to summary |
---|---|
public void setInternalSubset(int doctypeIndex, String subset) |
setNamespacesEnabled | back to summary |
---|---|
pack-priv void setNamespacesEnabled(boolean enable) |
setTypeInfo | back to summary |
---|---|
public void setTypeInfo(int elementNodeIndex, Object type) |
synchronizeChildren | back to summary |
---|---|
protected void synchronizeChildren() Overrides com. Synchronizes the node's children with the internal structure. Fluffing the children at once solves a lot of work to keep the two structures in sync. The problem gets worse when editing the tree -- this makes it a lot easier. |
synchronizeChildren | back to summary |
---|---|
protected final void synchronizeChildren(AttrImpl a, int nodeIndex) Synchronizes the node's children with the internal structure. Fluffing the children at once solves a lot of work to keep the two structures in sync. The problem gets worse when editing the tree -- this makes it a lot easier. This is not directly used in this class but this method is here so that it can be shared by all deferred subclasses of AttrImpl. |
synchronizeChildren | back to summary |
---|---|
protected final void synchronizeChildren(ParentNode p, int nodeIndex) Synchronizes the node's children with the internal structure. Fluffing the children at once solves a lot of work to keep the two structures in sync. The problem gets worse when editing the tree -- this makes it a lot easier. This is not directly used in this class but this method is here so that it can be shared by all deferred subclasses of ParentNode. |
synchronizeData | back to summary |
---|---|
protected void synchronizeData() Overrides com. Synchronizes the node's data. |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
public void | |
public int | |
private void | |
public void | |
public int |
IntVector | back to summary |
---|---|
pack-priv IntVector() |
addElement | back to summary |
---|---|
public void addElement(int element) Appends an element to the end of the vector. |
elementAt | back to summary |
---|---|
public int elementAt(int index) Returns the element at the specified index. |
ensureCapacity | back to summary |
---|---|
private void ensureCapacity(int newsize) Makes sure that there is enough storage. |
removeAllElements | back to summary |
---|---|
public void removeAllElements() Clears the vector. |
size | back to summary |
---|---|
public int size() Returns the length of this vector. |
Modifier and Type | Field and Description |
---|---|
pack-priv int |
Access | Constructor and Description |
---|---|
pack-priv |
fCount | back to summary |
---|---|
pack-priv int fCount |
RefCount | back to summary |
---|---|
pack-priv RefCount() |