| java.lang.Object org.apache.xerces.dom.NodeImpl org.apache.xerces.dom.ChildNode org.apache.xerces.dom.ParentNode org.apache.xerces.dom.CoreDocumentImpl
All known Subclasses: org.apache.xerces.dom.DocumentImpl,
CoreDocumentImpl | public class CoreDocumentImpl extends ParentNode implements Document(Code) | | The Document interface represents the entire HTML or XML document.
Conceptually, it is the root of the document tree, and provides the
primary access to the document's data.
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.
The CoreDocumentImpl class only implements the DOM Core. Additional modules
are supported by the more complete DocumentImpl subclass.
Note: When any node in the document is serialized, the
entire document is serialized along with it.
author: Arnaud Le Hors, IBM author: Joe Kesselman, IBM author: Andy Clark, IBM author: Ralf Pfeiffer, IBM version: $Id: CoreDocumentImpl.java 515302 2007-03-06 21:07:10Z mrglavas $ since: PR-DOM-Level-1-19980818. |
Method Summary | |
public void | abort() DOM Level 3 WD - Experimental.
If the document is currently being loaded as a result of the method
load being invoked the loading and parsing is
immediately aborted. | protected void | addEventListener(NodeImpl node, String type, EventListener listener, boolean useCapture) | public Node | adoptNode(Node source) | protected void | callUserDataHandlers(Node n, Node c, short operation) | void | callUserDataHandlers(Node n, Node c, short operation, Hashtable userData) | protected void | changed() Denotes that this node has changed. | protected int | changes() Returns the number of changes to this node. | final protected void | checkDOMNSErr(String prefix, String namespace) | final protected void | checkNamespaceWF(String qname, int colon1, int colon2) Call user data handlers to let them know the nodes they are related to
are being deleted. | final protected void | checkQName(String prefix, String local) Checks if the given qualified name is legal with respect
to the version of XML to which this document must conform. | final protected void | clearIdentifiers() | public Object | clone() Clone. | public Node | cloneNode(boolean deep) Deep-clone a document, including fixing ownerDoc for the cloned
children. | protected void | cloneNode(CoreDocumentImpl newdoc, boolean deep) | protected void | copyEventListeners(NodeImpl src, NodeImpl tgt) | public Attr | createAttribute(String name) Factory method; creates an Attribute having this Document as its
OwnerDoc.
Parameters: name - The name of the attribute. | public Attr | createAttributeNS(String namespaceURI, String qualifiedName) Introduced in DOM Level 2. | public Attr | createAttributeNS(String namespaceURI, String qualifiedName, String localpart) NON-DOM: a factory method used by the Xerces DOM parser
to create an element.
Parameters: namespaceURI - The namespace URI of the attribute tocreate. | public CDATASection | createCDATASection(String data) Factory method; creates a CDATASection having this Document as
its OwnerDoc.
Parameters: data - The initial contents of the CDATA throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents. | public Comment | createComment(String data) Factory method; creates a Comment having this Document as its
OwnerDoc.
Parameters: data - The initial contents of the Comment. | public DocumentFragment | createDocumentFragment() Factory method; creates a DocumentFragment having this Document
as its OwnerDoc. | public DocumentType | createDocumentType(String qualifiedName, String publicID, String systemID) NON-DOM
Factory method; creates a DocumentType having this Document
as its OwnerDoc. | public Element | createElement(String tagName) Factory method; creates an Element having this Document
as its OwnerDoc.
Parameters: tagName - The name of the element type to instantiate. | public ElementDefinitionImpl | createElementDefinition(String name) NON-DOM Factory method: creates an element definition. | public Element | createElementNS(String namespaceURI, String qualifiedName) Introduced in DOM Level 2. | public Element | createElementNS(String namespaceURI, String qualifiedName, String localpart) NON-DOM: a factory method used by the Xerces DOM parser
to create an element.
Parameters: namespaceURI - The namespace URI of the element tocreate. Parameters: qualifiedName - The qualified name of the element type toinstantiate. Parameters: localpart - The local name of the attribute to instantiate. | public Entity | createEntity(String name) NON-DOM
Factory method; creates an Entity having this Document
as its OwnerDoc. | public EntityReference | createEntityReference(String name) Factory method; creates an EntityReference having this Document
as its OwnerDoc.
Parameters: name - The name of the Entity we wish to refer to throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents, wherenonstandard entities are not permitted. | public Notation | createNotation(String name) NON-DOM
Factory method; creates a Notation having this Document
as its OwnerDoc. | public ProcessingInstruction | createProcessingInstruction(String target, String data) Factory method; creates a ProcessingInstruction having this Document
as its OwnerDoc.
Parameters: target - The target "processor channel" Parameters: data - Parameter string to be passed to the target. throws: DOMException - (INVALID_NAME_ERR) if the target name is notacceptable. throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents. | public Text | createTextNode(String data) Factory method; creates a Text node having this Document as its
OwnerDoc. | void | deletedText(CharacterDataImpl node, int offset, int count) A method to be called when some text was deleted from a text node,
so that live objects can be notified. | protected boolean | dispatchEvent(NodeImpl node, Event event) | void | freeNodeListCache(NodeListCache c) Puts the given NodeListCache in the free list. | public boolean | getAsync() DOM Level 3 WD - Experimental.
Indicates whether the method load should be synchronous or
asynchronous. | public String | getBaseURI() Returns the absolute base URI of this node or null if the implementation
wasn't able to obtain an absolute URI. | public DocumentType | getDoctype() For XML, this provides access to the Document Type Definition. | public Element | getDocumentElement() Convenience method, allowing direct access to the child node
which is considered the root of the actual document content. | public String | getDocumentURI() DOM Level 3 WD - Experimental. | public DOMConfiguration | getDomConfig() DOM Level 3 CR - Experimental
The configuration used when Document.normalizeDocument is
invoked. | public Element | getElementById(String elementId) Introduced in DOM Level 2
Returns the Element whose ID is given by elementId. | public NodeList | getElementsByTagName(String tagname) Return a live collection of all descendent Elements (not just
immediate children) having the specified tag name.
Parameters: tagname - The type of Element we want to gather. | public NodeList | getElementsByTagNameNS(String namespaceURI, String localName) Introduced in DOM Level 2. | public String | getEncoding() | public boolean | getErrorChecking() Returns true if the DOM implementation performs error checking. | public Object | getFeature(String feature, String version) | public Element | getIdentifier(String idName) Returns a previously registered element with the specified
identifier name, or null if no element is registered. | public Enumeration | getIdentifiers() Returns an enumeration registered of identifier names. | public DOMImplementation | getImplementation() Retrieve information describing the abilities of this particular
DOM implementation. | public String | getInputEncoding() DOM Level 3 CR - Experimental. | boolean | getMutationEvents() Returns true if the DOM implementation generates mutation events. | NodeListCache | getNodeListCache(ParentNode owner) Returns a NodeListCache for the given node. | public String | getNodeName() Returns the node name. | protected int | getNodeNumber() NON-DOM: Get the number associated with this document. | protected int | getNodeNumber(Node node) NON-DOM: Get a number associated with a node created with respect
to this document. | public short | getNodeType() Returns the node type. | final public Document | getOwnerDocument() | public boolean | getStandalone() | public boolean | getStrictErrorChecking() | public String | getTextContent() | public Object | getUserData(Node n, String key) Retrieves the object associated to a key on a this node. | protected Object | getUserData(NodeImpl n) | protected Hashtable | getUserDataRecord(Node n) | public String | getVersion() | public String | getXmlEncoding() DOM Level 3 WD - Experimental. | public boolean | getXmlStandalone() DOM Level 3 WD - Experimental. | public String | getXmlVersion() DOM Level 3 WD - Experimental. | public Node | importNode(Node source, boolean deep) Copies a node from another document to this document. | public Node | insertBefore(Node newChild, Node refChild) Since a Document may contain at most one top-level Element child,
and at most one DocumentType declaraction, we need to subclass our
add-children methods to implement this constraint. | void | insertedNode(NodeImpl node, NodeImpl newInternal, boolean replace) A method to be called when a node has been inserted in the tree. | void | insertedText(CharacterDataImpl node, int offset, int count) A method to be called when some text was inserted into a text node,
so that live objects can be notified. | void | insertingNode(NodeImpl node, boolean replace) A method to be called when a node is about to be inserted in the tree. | protected boolean | isKidOK(Node parent, Node child) Uses the kidOK lookup table to check whether the proposed
tree structure is legal. | boolean | isNormalizeDocRequired() | final public static boolean | isValidQName(String prefix, String local, boolean xml11Version) Checks if the given qualified name is legal with respect
to the version of XML to which this document must conform. | boolean | isXML11Version() | final public static boolean | isXMLName(String s, boolean xml11Version) | boolean | isXMLVersionChanged() | public boolean | load(String uri) DOM Level 3 WD - Experimental.
Replaces the content of the document with the result of parsing the
given URI. | public boolean | loadXML(String source) DOM Level 3 WD - Experimental.
Replace the content of the document with the result of parsing the
input string, this method is always synchronous.
Parameters: source - A string containing an XML document. | void | modifiedAttrValue(AttrImpl attr, String oldvalue) | void | modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace) | void | modifyingCharacterData(NodeImpl node, boolean replace) | public void | normalizeDocument() DOM Level 3 WD - Experimental
Normalize document. | public void | putIdentifier(String idName, Element element) Registers an identifier name with a specified element node.
If the identifier is already registered, the new element
node replaces the previous node. | public Node | removeChild(Node oldChild) | protected void | removeEventListener(NodeImpl node, String type, EventListener listener, boolean useCapture) | public void | removeIdentifier(String idName) Removes a previously registered element with the specified
identifier name. | Hashtable | removeUserDataTable(Node n) Remove user data table for the given node.
Parameters: n - The node this operation applies to. | void | removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name) | void | removedNode(NodeImpl node, boolean replace) A method to be called when a node has been removed from the tree. | void | removingNode(NodeImpl node, NodeImpl oldChild, boolean replace) A method to be called when a node is about to be removed from the tree. | public Node | renameNode(Node n, String namespaceURI, String name) DOM Level 3 WD - Experimental. | void | renamedAttrNode(Attr oldAt, Attr newAt) | void | renamedElement(Element oldEl, Element newEl) | public Node | replaceChild(Node newChild, Node oldChild) | void | replacedCharacterData(NodeImpl node, String oldvalue, String value) method to be called when a character data node has been replaced. | void | replacedNode(NodeImpl node) A method to be called when a node has been replaced in the tree. | void | replacedText(CharacterDataImpl node) A method to be called when some text was changed in a text node,
so that live objects can be notified. | void | replacingData(NodeImpl node) | void | replacingNode(NodeImpl node) A method to be called when a node is about to be replaced in the tree. | public String | saveXML(Node node) DOM Level 3 WD - Experimental.
Save the document or the given node and all its descendants to a string
(i.e. | public void | setAsync(boolean async) DOM Level 3 WD - Experimental.
Indicates whether the method load should be synchronous or
asynchronous. | void | setAttrNode(AttrImpl attr, AttrImpl previous) | public void | setDocumentURI(String documentURI) DOM Level 3 WD - Experimental. | public void | setEncoding(String value) | public void | setErrorChecking(boolean check) Sets whether the DOM implementation performs error checking
upon operations. | public void | setInputEncoding(String value) DOM Internal
(Was a DOM L3 Core WD public interface method setActualEncoding )
An attribute specifying the actual encoding of this document. | void | setMutationEvents(boolean set) Sets whether the DOM implementation generates mutation events
upon operations. | public void | setStandalone(boolean value) | public void | setStrictErrorChecking(boolean check) | public void | setTextContent(String textContent) | public Object | setUserData(Node n, String key, Object data, UserDataHandler handler) Associate an object to a key on this node. | protected void | setUserData(NodeImpl n, Object data) NON-DOM: kept for backward compatibility
Store user data related to a given node
This is a place where we could use weak references! Indeed, the node
here won't be GC'ed as long as some user data is attached to it, since
the userData table will have a reference to the node. | void | setUserDataTable(Node n, Hashtable data) Set user data table for the given node. | public void | setVersion(String value) | public void | setXmlEncoding(String value) DOM Internal
(Was a DOM L3 Core WD public interface method setXMLEncoding )
An attribute specifying, as part of the XML declaration,
the encoding of this document. | public void | setXmlStandalone(boolean value) DOM Level 3 CR - Experimental. | public void | setXmlVersion(String value) DOM Level 3 CR - Experimental. | protected void | undeferChildren(Node node) Traverses the DOM Tree and expands deferred nodes and their
children. |
actualEncoding | protected String actualEncoding(Code) | | Experimental DOM Level 3 feature: Document actualEncoding
|
allowGrammarAccess | protected boolean allowGrammarAccess(Code) | | Allow grammar access.
|
changes | protected int changes(Code) | | Number of alterations made to this document since its creation.
Serves as a "dirty bit" so that live objects such as NodeList can
recognize when an alteration has been made and discard its cached
state information.
Any method that alters the tree structure MUST cause or be
accompanied by a call to changed(), to inform it that any outstanding
NodeLists may have to be updated.
(Required because NodeList is simultaneously "live" and integer-
indexed -- a bad decision in the DOM's design.)
Note that changes which do not affect the tree's structure -- changing
the node's name, for example -- do _not_ have to call changed().
Alternative implementation would be to use a cryptographic
Digest value rather than a count. This would have the advantage that
"harmless" changes (those producing equal() trees) would not force
NodeList to resynchronize. Disadvantage is that it's slightly more prone
to "false negatives", though that's the difference between "wildly
unlikely" and "absurdly unlikely". IF we start maintaining digests,
we should consider taking advantage of them.
Note: This used to be done a node basis, so that we knew what
subtree changed. But since only DeepNodeList really use this today,
the gain appears to be really small compared to the cost of having
an int on every (parent) node plus having to walk up the tree all the
way to the root to mark the branch as changed everytime a node is
changed.
So we now have a single counter global to the document. It means that
some objects may flush their cache more often than necessary, but this
makes nodes smaller and only the document needs to be marked as changed.
|
encoding | protected String encoding(Code) | | Experimental DOM Level 3 feature: Document encoding
|
errorChecking | protected boolean errorChecking(Code) | | Bypass error checking.
|
fDocumentURI | protected String fDocumentURI(Code) | | Experimental DOM Level 3 feature: documentURI
|
serialVersionUID | final static long serialVersionUID(Code) | | Serialization version.
|
standalone | protected boolean standalone(Code) | | Experimental DOM Level 3 feature: Document standalone
|
userData | protected Hashtable userData(Code) | | Table for user data attached to this document nodes.
|
version | protected String version(Code) | | Experimental DOM Level 3 feature: Document version
|
xmlVersionChanged | protected boolean xmlVersionChanged(Code) | | |
CoreDocumentImpl | public CoreDocumentImpl()(Code) | | NON-DOM: Actually creating a Document is outside the DOM's spec,
since it has to operate in terms of a particular implementation.
|
CoreDocumentImpl | public CoreDocumentImpl(boolean grammarAccess)(Code) | | Constructor.
|
CoreDocumentImpl | public CoreDocumentImpl(DocumentType doctype)(Code) | | For DOM2 support.
The createDocument factory method is in DOMImplementation.
|
CoreDocumentImpl | public CoreDocumentImpl(DocumentType doctype, boolean grammarAccess)(Code) | | For DOM2 support.
|
abort | public void abort()(Code) | | DOM Level 3 WD - Experimental.
If the document is currently being loaded as a result of the method
load being invoked the loading and parsing is
immediately aborted. The possibly partial result of parsing the
document is discarded and the document is cleared.
|
adoptNode | public Node adoptNode(Node source)(Code) | | DOM Level 3 WD - Experimental
Change the node's ownerDocument, and its subtree, to this Document
Parameters: source - The node to adopt. See Also: CoreDocumentImpl.importNode |
callUserDataHandlers | protected void callUserDataHandlers(Node n, Node c, short operation)(Code) | | Call user data handlers when a node is deleted (finalized)
Parameters: n - The node this operation applies to. Parameters: c - The copy node or null. Parameters: operation - The operation - import, clone, or delete. |
callUserDataHandlers | void callUserDataHandlers(Node n, Node c, short operation, Hashtable userData)(Code) | | Call user data handlers when a node is deleted (finalized)
Parameters: n - The node this operation applies to. Parameters: c - The copy node or null. Parameters: operation - The operation - import, clone, or delete. Parameters: handlers - Data associated with n. |
changed | protected void changed()(Code) | | Denotes that this node has changed.
|
changes | protected int changes()(Code) | | Returns the number of changes to this node.
|
checkNamespaceWF | final protected void checkNamespaceWF(String qname, int colon1, int colon2)(Code) | | Call user data handlers to let them know the nodes they are related to
are being deleted. The alternative would be to do that on Node but
because the nodes are used as the keys we have a reference to them that
prevents them from being gc'ed until the document is. At the same time,
doing it here has the advantage of avoiding a finalize() method on Node,
which would affect all nodes and not just the ones that have a user
data.
|
checkQName | final protected void checkQName(String prefix, String local)(Code) | | Checks if the given qualified name is legal with respect
to the version of XML to which this document must conform.
Parameters: prefix - prefix of qualified name Parameters: local - local part of qualified name |
clearIdentifiers | final protected void clearIdentifiers()(Code) | | Remove all identifiers from the ID table
|
cloneNode | public Node cloneNode(boolean deep)(Code) | | Deep-clone a document, including fixing ownerDoc for the cloned
children. Note that this requires bypassing the WRONG_DOCUMENT_ERR
protection. I've chosen to implement it by calling importNode
which is DOM Level 2.
org.w3c.dom.Node Parameters: deep - boolean, iff true replicate children |
cloneNode | protected void cloneNode(CoreDocumentImpl newdoc, boolean deep)(Code) | | internal method to share code with subclass
|
createAttribute | public Attr createAttribute(String name) throws DOMException(Code) | | Factory method; creates an Attribute having this Document as its
OwnerDoc.
Parameters: name - The name of the attribute. Note that the attribute's value is_not_ established at the factory; remember to set it! throws: DOMException - (INVALID_NAME_ERR)if the attribute name is not acceptable. |
createAttributeNS | public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException(Code) | | Introduced in DOM Level 2.
Creates an attribute of the given qualified name and namespace URI.
If the given namespaceURI is null or an empty string and the
qualifiedName has a prefix that is "xml", the created element
is bound to the predefined namespace
"http://www.w3.org/XML/1998/namespace" [Namespaces].
Parameters: namespaceURI - The namespace URI of the attribute tocreate. When it is null or an empty string,this method behaves like createAttribute. Parameters: qualifiedName - The qualified name of the attribute toinstantiate. Attr A new Attr object. throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specifiedname contains an invalid character. since: WD-DOM-Level-2-19990923 |
createAttributeNS | public Attr createAttributeNS(String namespaceURI, String qualifiedName, String localpart) throws DOMException(Code) | | NON-DOM: a factory method used by the Xerces DOM parser
to create an element.
Parameters: namespaceURI - The namespace URI of the attribute tocreate. When it is null or an empty string,this method behaves like createAttribute. Parameters: qualifiedName - The qualified name of the attribute toinstantiate. Parameters: localpart - The local name of the attribute to instantiate. Attr A new Attr object. throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specifiedname contains an invalid character. |
createCDATASection | public CDATASection createCDATASection(String data) throws DOMException(Code) | | Factory method; creates a CDATASection having this Document as
its OwnerDoc.
Parameters: data - The initial contents of the CDATA throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents. (HTMLnot yet implemented.) |
createComment | public Comment createComment(String data)(Code) | | Factory method; creates a Comment having this Document as its
OwnerDoc.
Parameters: data - The initial contents of the Comment. |
createDocumentFragment | public DocumentFragment createDocumentFragment()(Code) | | Factory method; creates a DocumentFragment having this Document
as its OwnerDoc.
|
createDocumentType | public DocumentType createDocumentType(String qualifiedName, String publicID, String systemID) throws DOMException(Code) | | NON-DOM
Factory method; creates a DocumentType having this Document
as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building
DTD information unspecified.)
Parameters: qualifiedName - Parameters: publicID - Parameters: systemID - throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents, whereDTDs are not permitted. (HTML not yet implemented.) |
createElement | public Element createElement(String tagName) throws DOMException(Code) | | Factory method; creates an Element having this Document
as its OwnerDoc.
Parameters: tagName - The name of the element type to instantiate. ForXML, this is case-sensitive. For HTML, the tagName parameter maybe provided in any case, but it must be mapped to the canonicaluppercase form by the DOM implementation. throws: DOMException - (INVALID_NAME_ERR) if the tag name is notacceptable. |
createElementNS | public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException(Code) | | Introduced in DOM Level 2.
Creates an element of the given qualified name and namespace URI.
If the given namespaceURI is null or an empty string and the
qualifiedName has a prefix that is "xml", the created element
is bound to the predefined namespace
"http://www.w3.org/XML/1998/namespace" [Namespaces].
Parameters: namespaceURI - The namespace URI of the element tocreate. Parameters: qualifiedName - The qualified name of the element type toinstantiate. Element A new Element object with the following attributes: throws: DOMException - INVALID_CHARACTER_ERR: Raised if the specifiedname contains an invalid character. throws: DOMException - NAMESPACE_ERR: Raised if the qualifiedName has aprefix that is "xml" and the namespaceURI isneither null nor an empty string nor"http://www.w3.org/XML/1998/namespace", orif the qualifiedName has a prefix differentfrom "xml" and the namespaceURI is null or anempty string. since: WD-DOM-Level-2-19990923 |
createElementNS | public Element createElementNS(String namespaceURI, String qualifiedName, String localpart) throws DOMException(Code) | | NON-DOM: a factory method used by the Xerces DOM parser
to create an element.
Parameters: namespaceURI - The namespace URI of the element tocreate. Parameters: qualifiedName - The qualified name of the element type toinstantiate. Parameters: localpart - The local name of the attribute to instantiate. Element A new Element object with the following attributes: exception: DOMException - INVALID_CHARACTER_ERR: Raised if the specifiedname contains an invalid character. |
createEntity | public Entity createEntity(String name) throws DOMException(Code) | | NON-DOM
Factory method; creates an Entity having this Document
as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building
DTD information unspecified.)
Parameters: name - The name of the Entity we wish to provide a value for. throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents, wherenonstandard entities are not permitted. (HTML not yetimplemented.) |
createEntityReference | public EntityReference createEntityReference(String name) throws DOMException(Code) | | Factory method; creates an EntityReference having this Document
as its OwnerDoc.
Parameters: name - The name of the Entity we wish to refer to throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents, wherenonstandard entities are not permitted. (HTML not yetimplemented.) |
createNotation | public Notation createNotation(String name) throws DOMException(Code) | | NON-DOM
Factory method; creates a Notation having this Document
as its OwnerDoc. (REC-DOM-Level-1-19981001 left the process of building
DTD information unspecified.)
Parameters: name - The name of the Notation we wish to describe throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents, wherenotations are not permitted. (HTML not yetimplemented.) |
createProcessingInstruction | public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException(Code) | | Factory method; creates a ProcessingInstruction having this Document
as its OwnerDoc.
Parameters: target - The target "processor channel" Parameters: data - Parameter string to be passed to the target. throws: DOMException - (INVALID_NAME_ERR) if the target name is notacceptable. throws: DOMException - (NOT_SUPPORTED_ERR) for HTML documents. (HTMLnot yet implemented.) |
createTextNode | public Text createTextNode(String data)(Code) | | Factory method; creates a Text node having this Document as its
OwnerDoc.
Parameters: data - The initial contents of the Text. |
deletedText | void deletedText(CharacterDataImpl node, int offset, int count)(Code) | | A method to be called when some text was deleted from a text node,
so that live objects can be notified.
|
freeNodeListCache | void freeNodeListCache(NodeListCache c)(Code) | | Puts the given NodeListCache in the free list.
Note: The owner node can keep using it until we reuse it
|
getAsync | public boolean getAsync()(Code) | | DOM Level 3 WD - Experimental.
Indicates whether the method load should be synchronous or
asynchronous. When the async attribute is set to true
the load method returns control to the caller before the document has
completed loading. The default value of this property is
false .
Setting the value of this attribute might throw NOT_SUPPORTED_ERR
if the implementation doesn't support the mode the attribute is being
set to. Should the DOM spec define the default value of this
property? What if implementing both async and sync IO is impractical
in some systems? 2001-09-14. default is false but we
need to check with Mozilla and IE.
|
getBaseURI | public String getBaseURI()(Code) | | Returns the absolute base URI of this node or null if the implementation
wasn't able to obtain an absolute URI. Note: If the URI is malformed, a
null is returned.
The absolute base URI of this node or null. since: DOM Level 3 |
getDoctype | public DocumentType getDoctype()(Code) | | For XML, this provides access to the Document Type Definition.
For HTML documents, and XML documents which don't specify a DTD,
it will be null.
|
getDocumentElement | public Element getDocumentElement()(Code) | | Convenience method, allowing direct access to the child node
which is considered the root of the actual document content. For
HTML, where it is legal to have more than one Element at the top
level of the document, we pick the one with the tagName
"HTML". For XML there should be only one top-level
(HTML not yet supported.)
|
getDocumentURI | public String getDocumentURI()(Code) | | DOM Level 3 WD - Experimental.
The location of the document or null if undefined.
Beware that when the Document supports the feature
"HTML" , the href attribute of the HTML BASE element takes precedence
over this attribute.
since: DOM Level 3 |
getDomConfig | public DOMConfiguration getDomConfig()(Code) | | DOM Level 3 CR - Experimental
The configuration used when Document.normalizeDocument is
invoked.
since: DOM Level 3 |
getElementById | public Element getElementById(String elementId)(Code) | | Introduced in DOM Level 2
Returns the Element whose ID is given by elementId. If no such element
exists, returns null. Behavior is not defined if more than one element
has this ID.
Note: The DOM implementation must have information that says which
attributes are of type ID. Attributes with the name "ID" are not of type
ID unless so defined. Implementations that do not know whether
attributes are of type ID or not are expected to return null.
See Also: CoreDocumentImpl.getIdentifier |
getElementsByTagName | public NodeList getElementsByTagName(String tagname)(Code) | | Return a live collection of all descendent Elements (not just
immediate children) having the specified tag name.
Parameters: tagname - The type of Element we want to gather. "*" will betaken as a wildcard, meaning "all elements in the document." See Also: DeepNodeListImpl |
getElementsByTagNameNS | public NodeList getElementsByTagNameNS(String namespaceURI, String localName)(Code) | | Introduced in DOM Level 2.
Returns a NodeList of all the Elements with a given local name and
namespace URI in the order in which they would be encountered in a
preorder traversal of the Document tree.
Parameters: namespaceURI - The namespace URI of the elements to matchon. The special value "*" matches allnamespaces. When it is null or an emptystring, this method behaves likegetElementsByTagName. Parameters: localName - The local name of the elements to match on.The special value "*" matches all local names. NodeList A new NodeList object containing all the matchedElements. since: WD-DOM-Level-2-19990923 |
getErrorChecking | public boolean getErrorChecking()(Code) | | Returns true if the DOM implementation performs error checking.
|
getIdentifiers | public Enumeration getIdentifiers()(Code) | | Returns an enumeration registered of identifier names.
|
getImplementation | public DOMImplementation getImplementation()(Code) | | 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.
|
getInputEncoding | public String getInputEncoding()(Code) | | DOM Level 3 CR - Experimental. (Was getActualEncoding)
An attribute specifying the encoding used for this document
at the time of the parsing. This is null when
it is not known, such as when the Document was
created in memory.
since: DOM Level 3 |
getMutationEvents | boolean getMutationEvents()(Code) | | Returns true if the DOM implementation generates mutation events.
|
getNodeName | public String getNodeName()(Code) | | Returns the node name.
|
getNodeNumber | protected int getNodeNumber()(Code) | | NON-DOM: Get the number associated with this document. Used to
order documents in the implementation.
|
getNodeNumber | protected int getNodeNumber(Node node)(Code) | | NON-DOM: Get a number associated with a node created with respect
to this document. Needed for compareDocumentPosition when nodes
are disconnected. This is only used on demand.
|
getNodeType | public short getNodeType()(Code) | | Returns the node type.
|
getStandalone | public boolean getStandalone()(Code) | | |
getStrictErrorChecking | public boolean getStrictErrorChecking()(Code) | | |
getUserData | public Object getUserData(Node n, String key)(Code) | | Retrieves the object associated to a key on a this node. The object
must first have been set to this node by calling
setUserData with the same key.
Parameters: n - The node the object is associated to. Parameters: key - The key the object is associated to. Returns the DOMObject associated to the given keyon this node, or null if there was none. since: DOM Level 3 |
getUserData | protected Object getUserData(NodeImpl n)(Code) | | NON-DOM: kept for backward compatibility
Retreive user data related to a given node
|
getXmlEncoding | public String getXmlEncoding()(Code) | | DOM Level 3 WD - Experimental.
The encoding of this document (part of XML Declaration)
|
getXmlStandalone | public boolean getXmlStandalone()(Code) | | DOM Level 3 WD - Experimental.
standalone that specifies whether this document is standalone
(part of XML Declaration)
|
getXmlVersion | public String getXmlVersion()(Code) | | DOM Level 3 WD - Experimental.
The version of this document (part of XML Declaration)
|
importNode | public Node importNode(Node source, boolean deep) throws DOMException(Code) | | Copies a node from another document to this document. The new nodes are
created using this document's factory methods and are populated with the
data from the source's accessor methods defined by the DOM interfaces.
Its behavior is otherwise similar to that of cloneNode.
According to the DOM specifications, document nodes cannot be imported
and a NOT_SUPPORTED_ERR exception is thrown if attempted.
|
insertBefore | public Node insertBefore(Node newChild, Node refChild) throws DOMException(Code) | | Since a Document may contain at most one top-level Element child,
and at most one DocumentType declaraction, we need to subclass our
add-children methods to implement this constraint.
Since appendChild() is implemented as insertBefore(,null),
altering the latter fixes both.
While I'm doing so, I've taken advantage of the opportunity to
cache documentElement and docType so we don't have to
search for them.
REVISIT: According to the spec it is not allowed to alter neither the
document element nor the document type in any way
|
insertedNode | void insertedNode(NodeImpl node, NodeImpl newInternal, boolean replace)(Code) | | A method to be called when a node has been inserted in the tree.
|
insertedText | void insertedText(CharacterDataImpl node, int offset, int count)(Code) | | A method to be called when some text was inserted into a text node,
so that live objects can be notified.
|
insertingNode | void insertingNode(NodeImpl node, boolean replace)(Code) | | A method to be called when a node is about to be inserted in the tree.
|
isKidOK | protected boolean isKidOK(Node parent, Node child)(Code) | | Uses the kidOK lookup table to check whether the proposed
tree structure is legal.
|
isNormalizeDocRequired | boolean isNormalizeDocRequired()(Code) | | |
isValidQName | final public static boolean isValidQName(String prefix, String local, boolean xml11Version)(Code) | | Checks if the given qualified name is legal with respect
to the version of XML to which this document must conform.
Parameters: prefix - prefix of qualified name Parameters: local - local part of qualified name |
isXML11Version | boolean isXML11Version()(Code) | | We could have more xml versions in future , but for now we could
do with this to handle XML 1.0 and 1.1
|
isXMLName | final public static boolean isXMLName(String s, boolean xml11Version)(Code) | | Check the string against XML's definition of acceptable names for
elements and attributes and so on using the XMLCharacterProperties
utility class
|
isXMLVersionChanged | boolean isXMLVersionChanged()(Code) | | |
load | public boolean load(String uri)(Code) | | DOM Level 3 WD - Experimental.
Replaces the content of the document with the result of parsing the
given URI. Invoking this method will either block the caller or
return to the caller immediately depending on the value of the async
attribute. Once the document is fully loaded a "load" event (as
defined in [DOM Level 3 Events]
, except that the Event.targetNode will be the document,
not an element) will be dispatched on the document. If an error
occurs, an implementation dependent "error" event will be dispatched
on the document. If this method is called on a document that is
currently loading, the current load is interrupted and the new URI
load is initiated.
When invoking this method the parameters used in the
DOMParser interface are assumed to have their default
values with the exception that the parameters "entities"
, "normalize-characters" ,
"check-character-normalization" are set to
"false" .
The result of a call to this method is the same the result of a
call to DOMParser.parseWithContext with an input stream
referencing the URI that was passed to this call, the document as the
context node, and the action ACTION_REPLACE_CHILDREN .
Parameters: uri - The URI reference for the XML file to be loaded. If this isa relative URI, the base URI used by the implementation isimplementation dependent. If async is set to true load returnstrue if the document load was successfully initiated.If an error occurred when initiating the document load,load returns false .If async is set tofalse load returns true ifthe document was successfully loaded and parsed. If an erroroccurred when either loading or parsing the URI, load returns false . |
loadXML | public boolean loadXML(String source)(Code) | | DOM Level 3 WD - Experimental.
Replace the content of the document with the result of parsing the
input string, this method is always synchronous.
Parameters: source - A string containing an XML document. true if parsing the input string succeededwithout errors, otherwise false . |
modifiedAttrValue | void modifiedAttrValue(AttrImpl attr, String oldvalue)(Code) | | A method to be called when an attribute value has been modified
|
modifiedCharacterData | void modifiedCharacterData(NodeImpl node, String oldvalue, String value, boolean replace)(Code) | | A method to be called when a character data node has been modified
|
modifyingCharacterData | void modifyingCharacterData(NodeImpl node, boolean replace)(Code) | | A method to be called when a character data node is about to be modified
|
normalizeDocument | public void normalizeDocument()(Code) | | DOM Level 3 WD - Experimental
Normalize document.
|
removeChild | public Node removeChild(Node oldChild) throws DOMException(Code) | | Since insertBefore caches the docElement (and, currently, docType),
removeChild has to know how to undo the cache
REVISIT: According to the spec it is not allowed to alter neither the
document element nor the document type in any way
|
removeUserDataTable | Hashtable removeUserDataTable(Node n)(Code) | | Remove user data table for the given node.
Parameters: n - The node this operation applies to. The removed table. |
removedAttrNode | void removedAttrNode(AttrImpl attr, NodeImpl oldOwner, String name)(Code) | | A method to be called when an attribute node has been removed
|
removedNode | void removedNode(NodeImpl node, boolean replace)(Code) | | A method to be called when a node has been removed from the tree.
|
removingNode | void removingNode(NodeImpl node, NodeImpl oldChild, boolean replace)(Code) | | A method to be called when a node is about to be removed from the tree.
|
renamedAttrNode | void renamedAttrNode(Attr oldAt, Attr newAt)(Code) | | A method to be called when an attribute node has been renamed
|
renamedElement | void renamedElement(Element oldEl, Element newEl)(Code) | | A method to be called when an element has been renamed
|
replaceChild | public Node replaceChild(Node newChild, Node oldChild) throws DOMException(Code) | | Since we cache the docElement (and, currently, docType),
replaceChild has to update the cache
REVISIT: According to the spec it is not allowed to alter neither the
document element nor the document type in any way
|
replacedCharacterData | void replacedCharacterData(NodeImpl node, String oldvalue, String value)(Code) | | method to be called when a character data node has been replaced.
|
replacedNode | void replacedNode(NodeImpl node)(Code) | | A method to be called when a node has been replaced in the tree.
|
replacedText | void replacedText(CharacterDataImpl node)(Code) | | A method to be called when some text was changed in a text node,
so that live objects can be notified.
|
replacingData | void replacingData(NodeImpl node)(Code) | | A method to be called when a character data node is about to be replaced
|
replacingNode | void replacingNode(NodeImpl node)(Code) | | A method to be called when a node is about to be replaced in the tree.
|
saveXML | public String saveXML(Node node) throws DOMException(Code) | | DOM Level 3 WD - Experimental.
Save the document or the given node and all its descendants to a string
(i.e. serialize the document or node).
The parameters used in the LSSerializer interface are
assumed to have their default values when invoking this method.
The result of a call to this method is the same the result of a
call to LSSerializer.writeToString with the document as
the node to write.
Parameters: node - Specifies what to serialize, if this parameter isnull the whole document is serialized, if it'snon-null the given node is serialized. The serialized document or null in case an erroroccurred. exception: DOMException - WRONG_DOCUMENT_ERR: Raised if the node passed in as the nodeparameter is from an other document. |
setAsync | public void setAsync(boolean async)(Code) | | DOM Level 3 WD - Experimental.
Indicates whether the method load should be synchronous or
asynchronous. When the async attribute is set to true
the load method returns control to the caller before the document has
completed loading. The default value of this property is
false .
Setting the value of this attribute might throw NOT_SUPPORTED_ERR
if the implementation doesn't support the mode the attribute is being
set to. Should the DOM spec define the default value of this
property? What if implementing both async and sync IO is impractical
in some systems? 2001-09-14. default is false but we
need to check with Mozilla and IE.
|
setAttrNode | void setAttrNode(AttrImpl attr, AttrImpl previous)(Code) | | A method to be called when an attribute node has been set
|
setDocumentURI | public void setDocumentURI(String documentURI)(Code) | | DOM Level 3 WD - Experimental.
|
setErrorChecking | public void setErrorChecking(boolean check)(Code) | | Sets whether the DOM implementation performs error checking
upon operations. Turning off error checking only affects
the following DOM checks:
- Checking strings to make sure that all characters are
legal XML characters
- Hierarchy checking such as allowed children, checks for
cycles, etc.
Turning off error checking does not turn off the
following checks:
- Read only checks
- Checks related to DOM events
|
setInputEncoding | public void setInputEncoding(String value)(Code) | | DOM Internal
(Was a DOM L3 Core WD public interface method setActualEncoding )
An attribute specifying the actual encoding of this document. This is
null otherwise.
This attribute represents the property [character encoding scheme]
defined in .
|
setMutationEvents | void setMutationEvents(boolean set)(Code) | | Sets whether the DOM implementation generates mutation events
upon operations.
|
setStandalone | public void setStandalone(boolean value)(Code) | | |
setStrictErrorChecking | public void setStrictErrorChecking(boolean check)(Code) | | |
setUserData | public Object setUserData(Node n, String key, Object data, UserDataHandler handler)(Code) | | Associate an object to a key on this node. The object can later be
retrieved from this node by calling getUserData with the
same key.
Parameters: n - The node to associate the object to. Parameters: key - The key to associate the object to. Parameters: data - The object to associate to the given key, ornull to remove any existing association to that key. Parameters: handler - The handler to associate to that key, ornull . Returns the DOMObject previously associated tothe given key on this node, or null if there was none. since: DOM Level 3 since: REVISIT: we could use a free list of UserDataRecord here |
setUserData | protected void setUserData(NodeImpl n, Object data)(Code) | | NON-DOM: kept for backward compatibility
Store user data related to a given node
This is a place where we could use weak references! Indeed, the node
here won't be GC'ed as long as some user data is attached to it, since
the userData table will have a reference to the node.
|
setUserDataTable | void setUserDataTable(Node n, Hashtable data)(Code) | | Set user data table for the given node.
Parameters: n - The node this operation applies to. Parameters: data - The user data table. |
setXmlEncoding | public void setXmlEncoding(String value)(Code) | | DOM Internal
(Was a DOM L3 Core WD public interface method setXMLEncoding )
An attribute specifying, as part of the XML declaration,
the encoding of this document. This is null when unspecified.
|
setXmlStandalone | public void setXmlStandalone(boolean value) throws DOMException(Code) | | DOM Level 3 CR - Experimental.
Xmlstandalone - An attribute specifying, as part of the XML declaration,
whether this document is standalone
exception: DOMException - NOT_SUPPORTED_ERR: Raised if this document does not support the"XML" feature. since: DOM Level 3 |
setXmlVersion | public void setXmlVersion(String value)(Code) | | DOM Level 3 CR - Experimental.
version - An attribute specifying, as part of the XML declaration,
the version number of this document.
|
undeferChildren | protected void undeferChildren(Node node)(Code) | | Traverses the DOM Tree and expands deferred nodes and their
children.
|
Methods inherited from org.apache.xerces.dom.NodeImpl | public void addEventListener(String type, EventListener listener, boolean useCapture)(Code)(Java Doc) public Node appendChild(Node newChild) throws DOMException(Code)(Java Doc) protected void changed()(Code)(Java Doc) protected int changes()(Code)(Java Doc) public Node cloneNode(boolean deep)(Code)(Java Doc) public short compareDocumentPosition(Node other) throws DOMException(Code)(Java Doc) public short compareTreePosition(Node other)(Code)(Java Doc) public boolean dispatchEvent(Event event)(Code)(Java Doc) public NamedNodeMap getAttributes()(Code)(Java Doc) public String getBaseURI()(Code)(Java Doc) public NodeList getChildNodes()(Code)(Java Doc) protected Node getContainer()(Code)(Java Doc) Node getElementAncestor(Node currentNode)(Code)(Java Doc) public Object getFeature(String feature, String version)(Code)(Java Doc) public Node getFirstChild()(Code)(Java Doc) public Node getLastChild()(Code)(Java Doc) public int getLength()(Code)(Java Doc) public String getLocalName()(Code)(Java Doc) public String getNamespaceURI()(Code)(Java Doc) public Node getNextSibling()(Code)(Java Doc) abstract public String getNodeName()(Code)(Java Doc) protected int getNodeNumber()(Code)(Java Doc) abstract public short getNodeType()(Code)(Java Doc) public String getNodeValue() throws DOMException(Code)(Java Doc) public Document getOwnerDocument()(Code)(Java Doc) public Node getParentNode()(Code)(Java Doc) public String getPrefix()(Code)(Java Doc) public Node getPreviousSibling()(Code)(Java Doc) public boolean getReadOnly()(Code)(Java Doc) public String getTextContent() throws DOMException(Code)(Java Doc) void getTextContent(StringBuffer buf) throws DOMException(Code)(Java Doc) public Object getUserData(String key)(Code)(Java Doc) public Object getUserData()(Code)(Java Doc) protected Hashtable getUserDataRecord()(Code)(Java Doc) public boolean hasAttributes()(Code)(Java Doc) public boolean hasChildNodes()(Code)(Java Doc) final boolean hasStringValue()(Code)(Java Doc) final void hasStringValue(boolean value)(Code)(Java Doc) public Node insertBefore(Node newChild, Node refChild) throws DOMException(Code)(Java Doc) final boolean internalIsIgnorableWhitespace()(Code)(Java Doc) public boolean isDefaultNamespace(String namespaceURI)(Code)(Java Doc) public boolean isEqualNode(Node arg)(Code)(Java Doc) final boolean isFirstChild()(Code)(Java Doc) final void isFirstChild(boolean value)(Code)(Java Doc) final boolean isIdAttribute()(Code)(Java Doc) final void isIdAttribute(boolean value)(Code)(Java Doc) final void isIgnorableWhitespace(boolean value)(Code)(Java Doc) final boolean isNormalized()(Code)(Java Doc) final void isNormalized(boolean value)(Code)(Java Doc) final boolean isOwned()(Code)(Java Doc) final void isOwned(boolean value)(Code)(Java Doc) final boolean isReadOnly()(Code)(Java Doc) final void isReadOnly(boolean value)(Code)(Java Doc) public boolean isSameNode(Node other)(Code)(Java Doc) final boolean isSpecified()(Code)(Java Doc) final void isSpecified(boolean value)(Code)(Java Doc) public boolean isSupported(String feature, String version)(Code)(Java Doc) public Node item(int index)(Code)(Java Doc) String lookupNamespacePrefix(String namespaceURI, ElementImpl el)(Code)(Java Doc) public String lookupNamespaceURI(String specifiedPrefix)(Code)(Java Doc) public String lookupPrefix(String namespaceURI)(Code)(Java Doc) final boolean needsSyncChildren()(Code)(Java Doc) final public void needsSyncChildren(boolean value)(Code)(Java Doc) final boolean needsSyncData()(Code)(Java Doc) final void needsSyncData(boolean value)(Code)(Java Doc) public void normalize()(Code)(Java Doc) CoreDocumentImpl ownerDocument()(Code)(Java Doc) NodeImpl parentNode()(Code)(Java Doc) ChildNode previousSibling()(Code)(Java Doc) public Node removeChild(Node oldChild) throws DOMException(Code)(Java Doc) public void removeEventListener(String type, EventListener listener, boolean useCapture)(Code)(Java Doc) public Node replaceChild(Node newChild, Node oldChild) throws DOMException(Code)(Java Doc) public void setNodeValue(String x) throws DOMException(Code)(Java Doc) protected void setOwnerDocument(CoreDocumentImpl doc)(Code)(Java Doc) public void setPrefix(String prefix) throws DOMException(Code)(Java Doc) public void setReadOnly(boolean readOnly, boolean deep)(Code)(Java Doc) public void setTextContent(String textContent) throws DOMException(Code)(Java Doc) public Object setUserData(String key, Object data, UserDataHandler handler)(Code)(Java Doc) public void setUserData(Object data)(Code)(Java Doc) protected void synchronizeData()(Code)(Java Doc) public String toString()(Code)(Java Doc)
|
|
|