public class SOAPDocument extends DocumentImpl implements Document
SOAPDocument
ensures that the propper SAAJ elements are
returned when Document calls are made from a DOM client. This implementation
enscapsulates a single ThreadLocal Document object.eventListeners, iterators, mutationEvents, ranges
actualEncoding, allowGrammarAccess, changes, docElement, docType, encoding, errorChecking, fDocumentURI, identifiers, standalone, userData, version, xmlVersionChanged
firstChild, fNodeListCache, ownerDocument
nextSibling, previousSibling
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Constructor and Description |
---|
SOAPDocument() |
Modifier and Type | Method and Description |
---|---|
Node |
adoptNode(Node source)
DOM Level 3 WD - Experimental
Change the node's ownerDocument, and its subtree, to this Document
|
Node |
appendChild(Node newChild)
Adds a child node to the end of the list of children for this node.
|
Node |
cloneNode(boolean deep)
Deep-clone a document, including fixing ownerDoc for the cloned
children.
|
short |
compareDocumentPosition(Node other)
Compares a node with this node with regard to their position in the
document.
|
Attr |
createAttribute(String name)
Factory method; creates an Attribute having this Document as its
OwnerDoc.
|
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName)
Introduced in DOM Level 2.
|
CDATASection |
createCDATASection(String data)
Factory method; creates a CDATASection having this Document as
its OwnerDoc.
|
Comment |
createComment(String data)
Factory method; creates a Comment having this Document as its
OwnerDoc.
|
DocumentFragment |
createDocumentFragment()
Factory method; creates a DocumentFragment having this Document
as its OwnerDoc.
|
Element |
createElement(String tagName)
Factory method; creates an Element having this Document
as its OwnerDoc.
|
Element |
createElementNS(String namespaceURI,
String qualifiedName)
Introduced in DOM Level 2.
|
EntityReference |
createEntityReference(String name)
Factory method; creates an EntityReference having this Document
as its OwnerDoc.
|
ProcessingInstruction |
createProcessingInstruction(String target,
String data)
Factory method; creates a ProcessingInstruction having this Document
as its OwnerDoc.
|
Text |
createTextNode(String data)
Factory method; creates a Text node having this Document as its
OwnerDoc.
|
NamedNodeMap |
getAttributes()
Return the collection of attributes associated with this node,
or null if none.
|
String |
getBaseURI()
Returns the absolute base URI of this node or null if the implementation
wasn't able to obtain an absolute URI.
|
NodeList |
getChildNodes()
Obtain a NodeList enumerating all children of this node.
|
DocumentType |
getDoctype()
For XML, this provides access to the Document Type Definition.
|
Element |
getDocumentElement()
Convenience method, allowing direct access to the child node
which is considered the root of the actual document content.
|
String |
getDocumentURI()
DOM Level 3 WD - Experimental.
|
DOMConfiguration |
getDomConfig()
DOM Level 3 CR - Experimental
The configuration used when
Document.normalizeDocument is
invoked. |
Element |
getElementById(String elementId)
Introduced in DOM Level 2
Returns the Element whose ID is given by elementId.
|
NodeList |
getElementsByTagName(String tagname)
Return a live collection of all descendent Elements (not just
immediate children) having the specified tag name.
|
NodeList |
getElementsByTagNameNS(String namespaceURI,
String localName)
Introduced in DOM Level 2.
|
Object |
getFeature(String feature,
String version) |
Node |
getFirstChild()
The first child of this Node, or null if none.
|
DOMImplementation |
getImplementation()
Retrieve information describing the abilities of this particular
DOM implementation.
|
String |
getInputEncoding()
DOM Level 3 CR - Experimental.
|
Node |
getLastChild()
The last child of this Node, or null if none.
|
String |
getLocalName()
Introduced in DOM Level 2.
|
String |
getNamespaceURI()
Introduced in DOM Level 2.
|
Node |
getNextSibling()
The next child of this node's parent, or null if none
|
String |
getNodeName()
Returns the node name.
|
short |
getNodeType()
Returns the node type.
|
String |
getNodeValue()
Returns the node value.
|
Node |
getParentNode()
Returns the parent node of this node
|
String |
getPrefix()
Introduced in DOM Level 2.
|
Node |
getPreviousSibling()
The previous child of this node's parent, or null if none
|
boolean |
getStrictErrorChecking() |
String |
getTextContent()
This attribute returns the text content of this node and its
descendants.
|
Object |
getUserData(String arg0)
Retrieves the object associated to a key on a this node.
|
String |
getXmlEncoding()
DOM Level 3 WD - Experimental.
|
boolean |
getXmlStandalone()
DOM Level 3 WD - Experimental.
|
String |
getXmlVersion()
DOM Level 3 WD - Experimental.
|
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes.
|
boolean |
hasChildNodes()
Test whether this node has any children.
|
Node |
importNode(Node importedNode,
boolean deep)
Copies a node from another document to this document.
|
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.
|
boolean |
isDefaultNamespace(String namespaceURI)
DOM Level 3: Experimental
This method checks if the specified
namespaceURI is the
default namespace or not. |
boolean |
isEqualNode(Node arg)
DOM Level 3 WD- Experimental.
|
boolean |
isSameNode(Node other)
Returns whether this node is the same node as the given one.
|
boolean |
isSupported(String feature,
String version)
Introduced in DOM Level 2.
|
String |
lookupNamespaceURI(String prefix)
DOM Level 3 - Experimental:
Look up the namespace URI associated to the given prefix, starting from this node.
|
String |
lookupPrefix(String namespaceURI)
DOM Level 3 - Experimental:
Look up the prefix associated to the given namespace URI, starting from this node.
|
void |
normalize()
Override default behavior to call normalize() on this Node's
children.
|
void |
normalizeDocument()
DOM Level 3 WD - Experimental
Normalize document.
|
Node |
removeChild(Node oldChild)
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
|
Node |
renameNode(Node n,
String namespaceURI,
String qualifiedName)
DOM Level 3 WD - Experimental.
|
Node |
replaceChild(Node newChild,
Node oldChild)
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
|
void |
setDocumentURI(String documentURI)
DOM Level 3 WD - Experimental.
|
void |
setNodeValue(String nodeValue)
Sets the node value.
|
void |
setPrefix(String prefix)
Introduced in DOM Level 2.
|
void |
setStrictErrorChecking(boolean strictErrorChecking) |
void |
setTextContent(String textContent)
This attribute returns the text content of this node and its
descendants.
|
Object |
setUserData(String key,
Object data,
UserDataHandler handler)
Associate an object to a key on this node.
|
void |
setXmlStandalone(boolean xmlStandalone)
DOM Level 3 CR - Experimental.
|
void |
setXmlVersion(String xmlVersion)
DOM Level 3 CR - Experimental.
|
addEventListener, copyEventListeners, createEvent, createNodeIterator, createNodeIterator, createRange, createTreeWalker, createTreeWalker, dispatchAggregateEvents, dispatchAggregateEvents, dispatchEvent, dispatchEventToSubtree, dispatchingEventToSubtree, getEventListeners, removeEventListener, saveEnclosingAttr, setEventListeners
abort, callUserDataHandlers, changed, changes, checkDOMNSErr, checkNamespaceWF, checkQName, clearIdentifiers, clone, cloneNode, createAttributeNS, createDocumentType, createElementDefinition, createElementNS, createEntity, createNotation, getAsync, getEncoding, getErrorChecking, getIdentifier, getIdentifiers, getNodeNumber, getNodeNumber, getOwnerDocument, getStandalone, getUserData, getUserData, getUserDataRecord, getVersion, isKidOK, isValidQName, isXMLName, load, loadXML, putIdentifier, removeIdentifier, saveXML, setAsync, setEncoding, setErrorChecking, setInputEncoding, setStandalone, setUserData, setUserData, setVersion, setXmlEncoding, undeferChildren
getChildNodesUnoptimized, getLength, item, setOwnerDocument, setReadOnly, synchronizeChildren
addEventListener, compareTreePosition, dispatchEvent, getContainer, getReadOnly, getUserData, getUserDataRecord, needsSyncChildren, removeEventListener, setUserData, synchronizeData, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOwnerDocument
public DocumentType getDoctype()
CoreDocumentImpl
getDoctype
in interface Document
getDoctype
in class CoreDocumentImpl
public DOMImplementation getImplementation()
DocumentImpl
getImplementation
in interface Document
getImplementation
in class DocumentImpl
public Element getDocumentElement()
CoreDocumentImpl
getDocumentElement
in interface Document
getDocumentElement
in class CoreDocumentImpl
public Element createElement(String tagName) throws DOMException
CoreDocumentImpl
createElement
in interface Document
createElement
in class CoreDocumentImpl
tagName
- The name of the element type to instantiate. For
XML, this is case-sensitive. For HTML, the tagName parameter may
be provided in any case, but it must be mapped to the canonical
uppercase form by the DOM implementation.DOMException
public DocumentFragment createDocumentFragment()
CoreDocumentImpl
createDocumentFragment
in interface Document
createDocumentFragment
in class CoreDocumentImpl
public Text createTextNode(String data)
CoreDocumentImpl
createTextNode
in interface Document
createTextNode
in class CoreDocumentImpl
data
- The initial contents of the Text.public Comment createComment(String data)
CoreDocumentImpl
createComment
in interface Document
createComment
in class CoreDocumentImpl
data
- The initial contents of the Comment.public CDATASection createCDATASection(String data) throws DOMException
CoreDocumentImpl
createCDATASection
in interface Document
createCDATASection
in class CoreDocumentImpl
data
- The initial contents of the CDATADOMException
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
CoreDocumentImpl
createProcessingInstruction
in interface Document
createProcessingInstruction
in class CoreDocumentImpl
target
- The target "processor channel"data
- Parameter string to be passed to the target.DOMException
public Attr createAttribute(String name) throws DOMException
CoreDocumentImpl
createAttribute
in interface Document
createAttribute
in class CoreDocumentImpl
name
- The name of the attribute. Note that the attribute's value is
_not_ established at the factory; remember to set it!DOMException
public EntityReference createEntityReference(String name) throws DOMException
CoreDocumentImpl
createEntityReference
in interface Document
createEntityReference
in class CoreDocumentImpl
name
- The name of the Entity we wish to refer toDOMException
public NodeList getElementsByTagName(String tagname)
CoreDocumentImpl
getElementsByTagName
in interface Document
getElementsByTagName
in class CoreDocumentImpl
tagname
- The type of Element we want to gather. "*" will be
taken as a wildcard, meaning "all elements in the document."DeepNodeListImpl
public Node importNode(Node importedNode, boolean deep) throws DOMException
CoreDocumentImpl
According to the DOM specifications, document nodes cannot be imported and a NOT_SUPPORTED_ERR exception is thrown if attempted.
importNode
in interface Document
importNode
in class CoreDocumentImpl
DOMException
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException
CoreDocumentImpl
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].
createElementNS
in interface Document
createElementNS
in class CoreDocumentImpl
namespaceURI
- The namespace URI of the element to
create.qualifiedName
- The qualified name of the element type to
instantiate.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException
CoreDocumentImpl
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].
createAttributeNS
in interface Document
createAttributeNS
in class CoreDocumentImpl
namespaceURI
- The namespace URI of the attribute to
create. When it is null or an empty string,
this method behaves like createAttribute.qualifiedName
- The qualified name of the attribute to
instantiate.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified
name contains an invalid character.public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
CoreDocumentImpl
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.
getElementsByTagNameNS
in interface Document
getElementsByTagNameNS
in class CoreDocumentImpl
namespaceURI
- The namespace URI of the elements to match
on. The special value "*" matches all
namespaces. When it is null or an empty
string, this method behaves like
getElementsByTagName.localName
- The local name of the elements to match on.
The special value "*" matches all local names.public String getNodeName()
CoreDocumentImpl
getNodeName
in interface Node
getNodeName
in class CoreDocumentImpl
public String getNodeValue() throws DOMException
NodeImpl
getNodeValue
in interface Node
getNodeValue
in class NodeImpl
DOMException
public void setNodeValue(String nodeValue) throws DOMException
NodeImpl
setNodeValue
in interface Node
setNodeValue
in class NodeImpl
DOMException
public short getNodeType()
CoreDocumentImpl
getNodeType
in interface Node
getNodeType
in class CoreDocumentImpl
public Node getParentNode()
ChildNode
getParentNode
in interface Node
getParentNode
in class ChildNode
public NodeList getChildNodes()
ParentNode
NodeLists are "live"; as children are added/removed the NodeList will immediately reflect those changes. Also, the NodeList refers to the actual nodes, so changes to those nodes made via the DOM tree will be reflected in the NodeList and vice versa.
In this implementation, Nodes implement the NodeList interface and provide their own getChildNodes() support. Other DOMs may solve this differently.
getChildNodes
in interface Node
getChildNodes
in class ParentNode
public Node getFirstChild()
ParentNode
getFirstChild
in interface Node
getFirstChild
in class ParentNode
ParentNode
public Node getLastChild()
ParentNode
getLastChild
in interface Node
getLastChild
in class ParentNode
ParentNode
public Node getPreviousSibling()
ChildNode
getPreviousSibling
in interface Node
getPreviousSibling
in class ChildNode
public Node getNextSibling()
ChildNode
getNextSibling
in interface Node
getNextSibling
in class ChildNode
public NamedNodeMap getAttributes()
NodeImpl
getAttributes
in interface Node
getAttributes
in class NodeImpl
ElementImpl
public Node insertBefore(Node newChild, Node refChild) throws DOMException
CoreDocumentImpl
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
insertBefore
in interface Node
insertBefore
in class CoreDocumentImpl
newChild
- The Node to be moved to our subtree. As a
convenience feature, inserting a DocumentNode will instead insert
all its children.refChild
- Current child which newChild should be placed
immediately before. If refChild is null, the insertion occurs
after all existing Nodes, like appendChild().DOMException
ParentNode
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
CoreDocumentImpl
replaceChild
in interface Node
replaceChild
in class CoreDocumentImpl
DOMException
ParentNode
public Node removeChild(Node oldChild) throws DOMException
CoreDocumentImpl
removeChild
in interface Node
removeChild
in class CoreDocumentImpl
DOMException
ParentNode
public Node appendChild(Node newChild) throws DOMException
NodeImpl
appendChild
in interface Node
appendChild
in class NodeImpl
DOMException
By default we do not accept any children, ParentNode overrides this.
,
ParentNode
public boolean hasChildNodes()
ParentNode
hasChildNodes
in interface Node
hasChildNodes
in class ParentNode
ParentNode
public Node cloneNode(boolean deep)
DocumentImpl
cloneNode
in interface Node
cloneNode
in class DocumentImpl
deep
- boolean, iff true replicate children
Example: Cloning a Text node will copy both the node and the text it
contains.
Example: Cloning something that has children -- Element or Attr, for
example -- will _not_ clone those children unless a "deep clone"
has been requested. A shallow clone of an Attr node will yield an
empty Attr of the same name.
NOTE: Clones will always be read/write, even if the node being cloned
is read-only, to permit applications using only the DOM API to obtain
editable copies of locked portions of the tree.
public void normalize()
ParentNode
normalize
in interface Node
normalize
in class ParentNode
public boolean isSupported(String feature, String version)
NodeImpl
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.
isSupported
in interface Node
isSupported
in class NodeImpl
feature
- The package name of the feature to test. This is the same
name as what can be passed to the method hasFeature on
DOMImplementation.version
- This is the version number of the package name to
test. In Level 2, version 1, this is the string "2.0". If the version is
not specified, supporting any version of the feature will cause the
method to return true.public String getNamespaceURI()
NodeImpl
The namespace URI of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE, this is always null and setting it has no effect.
This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.
getNamespaceURI
in interface Node
getNamespaceURI
in class NodeImpl
AttrNSImpl
,
ElementNSImpl
public String getPrefix()
NodeImpl
The namespace prefix of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is always null and setting it has no effect.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.
getPrefix
in interface Node
getPrefix
in class NodeImpl
AttrNSImpl
,
ElementNSImpl
public void setPrefix(String prefix) throws DOMException
NodeImpl
The namespace prefix of this node, or null if it is unspecified. When this node is of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is always null and setting it has no effect.
For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.
Note that setting this attribute changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.
setPrefix
in interface Node
setPrefix
in class NodeImpl
DOMException
AttrNSImpl
,
ElementNSImpl
public String getLocalName()
NodeImpl
Returns the local part of the qualified name of this node. For nodes created with a DOM Level 1 method, such as createElement from the Document interface, and for nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE this is the same as the nodeName attribute.
getLocalName
in interface Node
getLocalName
in class NodeImpl
AttrNSImpl
,
ElementNSImpl
public boolean hasAttributes()
NodeImpl
hasAttributes
in interface Node
hasAttributes
in class NodeImpl
true
if this node has any attributes,
false
otherwise.ElementImpl
public String getInputEncoding()
CoreDocumentImpl
null
when
it is not known, such as when the Document
was
created in memory.getInputEncoding
in interface Document
getInputEncoding
in class CoreDocumentImpl
public String getXmlEncoding()
CoreDocumentImpl
getXmlEncoding
in interface Document
getXmlEncoding
in class CoreDocumentImpl
public boolean getXmlStandalone()
CoreDocumentImpl
getXmlStandalone
in interface Document
getXmlStandalone
in class CoreDocumentImpl
public void setXmlStandalone(boolean xmlStandalone) throws DOMException
CoreDocumentImpl
setXmlStandalone
in interface Document
setXmlStandalone
in class CoreDocumentImpl
DOMException
- NOT_SUPPORTED_ERR: Raised if this document does not support the
"XML" feature.public String getXmlVersion()
CoreDocumentImpl
getXmlVersion
in interface Document
getXmlVersion
in class CoreDocumentImpl
public void setXmlVersion(String xmlVersion) throws DOMException
CoreDocumentImpl
setXmlVersion
in interface Document
setXmlVersion
in class CoreDocumentImpl
DOMException
public boolean getStrictErrorChecking()
getStrictErrorChecking
in interface Document
getStrictErrorChecking
in class CoreDocumentImpl
public void setStrictErrorChecking(boolean strictErrorChecking)
setStrictErrorChecking
in interface Document
setStrictErrorChecking
in class CoreDocumentImpl
public String getDocumentURI()
CoreDocumentImpl
null
if undefined.
Document
supports the feature
"HTML" , the href attribute of the HTML BASE element takes precedence
over this attribute.getDocumentURI
in interface Document
getDocumentURI
in class CoreDocumentImpl
public void setDocumentURI(String documentURI)
CoreDocumentImpl
setDocumentURI
in interface Document
setDocumentURI
in class CoreDocumentImpl
public Node adoptNode(Node source) throws DOMException
CoreDocumentImpl
adoptNode
in interface Document
adoptNode
in class CoreDocumentImpl
source
- The node to adopt.DOMException
CoreDocumentImpl.importNode(org.w3c.dom.Node, boolean)
public DOMConfiguration getDomConfig()
CoreDocumentImpl
Document.normalizeDocument
is
invoked.getDomConfig
in interface Document
getDomConfig
in class CoreDocumentImpl
public void normalizeDocument()
CoreDocumentImpl
normalizeDocument
in interface Document
normalizeDocument
in class CoreDocumentImpl
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
CoreDocumentImpl
renameNode
in interface Document
renameNode
in class CoreDocumentImpl
DOMException
public String getBaseURI()
CoreDocumentImpl
getBaseURI
in interface Node
getBaseURI
in class CoreDocumentImpl
public short compareDocumentPosition(Node other) throws DOMException
NodeImpl
compareDocumentPosition
in interface Node
compareDocumentPosition
in class NodeImpl
other
- The node to compare against this node.DOMException
public String getTextContent() throws DOMException
NodeImpl
Text
node containing the string
this attribute is set to. On getting, no serialization is performed,
the returned string does not contain any markup. No whitespace
normalization is performed, the returned string does not contain the
element content whitespaces . Similarly, on setting, no parsing is
performed either, the input string is taken as pure textual content.
Node type | Content |
---|
Node type | Content |
---|---|
ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE | concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and
PROCESSING_INSTRUCTION_NODE nodes |
ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE |
nodeValue |
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE | null |
getTextContent
in interface Node
getTextContent
in class CoreDocumentImpl
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.public void setTextContent(String textContent) throws DOMException
NodeImpl
Text
node containing the string
this attribute is set to. On getting, no serialization is performed,
the returned string does not contain any markup. No whitespace
normalization is performed, the returned string does not contain the
element content whitespaces . Similarly, on setting, no parsing is
performed either, the input string is taken as pure textual content.
Node type | Content |
---|---|
ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE | concatenation of the textContent
attribute value of every child node, excluding COMMENT_NODE and
PROCESSING_INSTRUCTION_NODE nodes |
ATTRIBUTE_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE |
nodeValue |
DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE | null |
setTextContent
in interface Node
setTextContent
in class CoreDocumentImpl
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.public boolean isSameNode(Node other)
NodeImpl
Node
references returned by the implementation reference
the same object. When two Node
references are references
to the same object, even if through a proxy, the references may be
used completely interchangably, such that all attributes have the
same values and calling the same DOM method on either reference
always has exactly the same effect.isSameNode
in interface Node
isSameNode
in class NodeImpl
other
- The node to test against.true
if the nodes are the same,
false
otherwise.public String lookupPrefix(String namespaceURI)
NodeImpl
lookupPrefix
in interface Node
lookupPrefix
in class NodeImpl
public boolean isDefaultNamespace(String namespaceURI)
NodeImpl
namespaceURI
is the
default namespace or not.isDefaultNamespace
in interface Node
isDefaultNamespace
in class NodeImpl
namespaceURI
- The namespace URI to look for.true
if the specified namespaceURI
is the default namespace, false
otherwise.public String lookupNamespaceURI(String prefix)
NodeImpl
lookupNamespaceURI
in interface Node
lookupNamespaceURI
in class NodeImpl
public boolean isEqualNode(Node arg)
ParentNode
isEqualNode
in interface Node
isEqualNode
in class ParentNode
arg
- The node to compare equality with.true
otherwise false
.public Object getFeature(String feature, String version)
getFeature
in interface Node
getFeature
in class CoreDocumentImpl
public Object setUserData(String key, Object data, UserDataHandler handler)
NodeImpl
getUserData
with the
same key.setUserData
in interface Node
setUserData
in class NodeImpl
key
- The key to associate the object to.data
- The object to associate to the given key, or
null
to remove any existing association to that key.handler
- The handler to associate to that key, or
null
.DOMObject
previously associated to
the given key on this node, or null
if there was none.public Object getUserData(String arg0)
NodeImpl
setUserData
with the same key.getUserData
in interface Node
getUserData
in class NodeImpl
arg0
- The key the object is associated to.DOMObject
associated to the given key
on this node, or null
if there was none.public Element getElementById(String elementId)
CoreDocumentImpl
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.
getElementById
in interface Document
getElementById
in class CoreDocumentImpl
CoreDocumentImpl.getIdentifier(java.lang.String)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.