|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.XMLObjectImpl
Base class for all compiled XML objects.
XMLObject
Field Summary |
Fields inherited from interface org.enhydra.xml.xmlc.XMLObject |
XMLC_GENERATED_CLASS_FIELD_NAME, XMLC_SOURCE_FILE_FIELD_NAME |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Constructor Summary | |
protected |
XMLObjectImpl()
Constructor. |
Method Summary | |
Node |
adoptNode(Node source)
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
Node |
appendChild(Node newChild)
Adds the node newChild to the end of the list of children
of this node. |
protected void |
cloneDeepCheck(boolean deep)
Check that cloneNode on an entire document is done with the deep option. |
abstract Node |
cloneNode(boolean deep)
Clone the entire document. |
Attr |
createAttribute(java.lang.String qualifiedName)
Creates an Attr of the given name. |
Attr |
createAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an attribute of the given qualified name and namespace URI. |
CDATASection |
createCDATASection(java.lang.String data)
Creates a CDATASection node whose value is the specified
string. |
Comment |
createComment(java.lang.String data)
Creates a Comment node given the specified string. |
DocumentFragment |
createDocumentFragment()
Creates an empty DocumentFragment object. |
Element |
createElement(java.lang.String tagName)
Creates an element of the type specified. |
Element |
createElementNS(java.lang.String namespaceURI,
java.lang.String qualifiedName)
Creates an element of the given qualified name and namespace URI. |
EntityReference |
createEntityReference(java.lang.String name)
Creates an EntityReference object. |
ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
Creates a ProcessingInstruction node given the specified
name and data strings. |
Text |
createTextNode(java.lang.String data)
Creates a Text node given the specified string. |
protected void |
doSetText(Element element,
java.lang.String text)
Used internally to implement a setTextXXX() method. |
NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if
it is an Element ) or null otherwise. |
NodeList |
getChildNodes()
A NodeList that contains all children of this node. |
XMLObject |
getDelegate()
Get the delegate. |
DocumentType |
getDoctype()
The Document Type Declaration (see DocumentType )
associated with this document. |
Document |
getDocument()
Get the actual document object. |
Element |
getDocumentElement()
This is a convenience attribute that allows direct access to the child node that is the root element of the document. |
protected abstract XMLCDomFactory |
getDomFactory()
Get the XMLC DOM Factory associated with this document type and DOM implementation. |
Element |
getElementById(java.lang.String elementId)
Returns the Element whose ID is given by
elementId . |
NodeList |
getElementsByTagName(java.lang.String tagname)
Returns a NodeList of all the Elements with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document tree. |
NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns a NodeList of all the Elements with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document tree. |
java.lang.String |
getEncoding()
Get the encoding specified in the document. |
Node |
getFirstChild()
The first child of this node. |
DOMImplementation |
getImplementation()
The DOMImplementation object that handles this document. |
Node |
getLastChild()
The last child of this node. |
java.lang.String |
getLocalName()
Returns the local part of the qualified name of this node. |
java.lang.String |
getMIMEType()
Get the MIME type associated with the document, or null if none was associated. |
java.lang.String |
getNamespaceURI()
The namespace URI of this node, or null if it is
unspecified. |
Node |
getNextSibling()
The node immediately following this node. |
java.lang.String |
getNodeName()
The name of this node, depending on its type; see the table above. |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
java.lang.String |
getNodeValue()
The value of this node, depending on its type; see the table above. |
Document |
getOwnerDocument()
The Document object associated with this node. |
Node |
getParentNode()
The parent of this node. |
java.lang.String |
getPrefix()
The namespace prefix of this node, or null if it is
unspecified. |
Node |
getPreviousSibling()
The node immediately preceding this node. |
boolean |
getStandalone()
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
boolean |
getStrictErrorChecking()
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
java.lang.String |
getVersion()
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Returns whether this node has any children. |
Node |
importNode(Node importedNode,
boolean deep)
Imports a node from another document to this document. |
void |
initFields()
Deprecated. Use syncAccessMethods() instead. |
Node |
insertBefore(Node newChild,
Node refChild)
Inserts the node newChild before the existing child node
refChild . |
boolean |
isSupported(java.lang.String feature,
java.lang.String version)
Tests whether the DOM implementation implements a specific feature and that feature is supported by this node. |
boolean |
isURLAttribute(Element element,
java.lang.String attrName)
Determine if an attribute of an element can contain a URL. |
void |
normalize()
Puts all Text nodes in the full depth of the sub-tree
underneath this Node , including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text nodes, i.e., there are neither adjacent
Text nodes nor empty Text nodes. |
Node |
removeChild(Node oldChild)
Removes the child node indicated by oldChild from the list
of children, and returns it. |
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces the child node oldChild with newChild
in the list of children, and returns the oldChild node. |
void |
setDelegate(XMLObject delegate)
Set the delegate object. |
protected void |
setDocument(Document document,
java.lang.String mimeType,
java.lang.String encoding)
Set the DOM document associated with this object and optional encoding. |
void |
setEncoding(java.lang.String encoding)
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
void |
setNodeValue(java.lang.String nodeValue)
|
void |
setPrefix(java.lang.String prefix)
|
void |
setStandalone(boolean standalone)
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
void |
setStrictErrorChecking(boolean strictErrorChecking)
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
void |
setVersion(java.lang.String version)
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.. |
void |
syncAccessMethods()
Initialize the fields used by the generated access methods from the current state of the document. |
protected abstract void |
syncWithDocument(Node node)
Generated function to synchronize the fields used by the access methods. |
java.lang.String |
toDocument()
Convert the document to a string representation of the document, that is a string containing XML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.enhydra.xml.xmlc.XMLObject |
buildDocument |
Constructor Detail |
protected XMLObjectImpl()
Method Detail |
protected void setDocument(Document document, java.lang.String mimeType, java.lang.String encoding)
protected abstract XMLCDomFactory getDomFactory()
public Document getDocument()
XMLObject
getDocument
in interface XMLObject
XMLObject.getDocument()
public java.lang.String getMIMEType()
XMLObject
getMIMEType
in interface XMLObject
XMLObject.getMIMEType()
public void setDelegate(XMLObject delegate)
XMLObject
setDelegate
in interface XMLObject
delegate
- The delegate object, or null to remove delegation.
The delegate must implement the same interface as the derived, generate
object.XMLObject.setDelegate(org.enhydra.xml.xmlc.XMLObject)
public XMLObject getDelegate()
XMLObject
getDelegate
in interface XMLObject
XMLObject.getDelegate()
protected void cloneDeepCheck(boolean deep)
public abstract Node cloneNode(boolean deep)
cloneNode
in interface Node
Node.cloneNode(boolean)
public DocumentType getDoctype()
Document
DocumentType
)
associated with this document. For HTML documents as well as XML
documents without a document type declaration this returns
null
. The DOM Level 2 does not support editing the
Document Type Declaration. docType
cannot be altered in
any way, including through the use of methods inherited from the
Node
interface, such as insertNode
or
removeNode
.
getDoctype
in interface Document
Document.getDoctype()
public DOMImplementation getImplementation()
Document
DOMImplementation
object that handles this document. A
DOM application may use objects from multiple implementations.
getImplementation
in interface Document
Document.getImplementation()
public Element getDocumentElement()
Document
getDocumentElement
in interface Document
Document.getDocumentElement()
public Node importNode(Node importedNode, boolean deep) throws DOMException
Document
parentNode
is null
).
The source node is not altered or removed from the original document;
this method creates a new copy of the source node.
nodeName
and nodeType
, plus the
attributes related to namespaces (prefix
,
localName
, and namespaceURI
). As in the
cloneNode
operation on a Node
, the source
node is not altered.
nodeType
, attempting to mirror the behavior expected if
a fragment of XML or HTML source was copied from one document to
another, recognizing that the two documents may have different DTDs
in the XML case. The following list describes the specifics for each
type of node.
ownerElement
attribute
is set to null
and the specified
flag is
set to true
on the generated Attr
. The
descendants of the source Attr
are recursively imported
and the resulting nodes reassembled to form the corresponding subtree.
Note that the deep
parameter has no effect on
Attr
nodes; they always carry their children with them
when imported.deep
option
was set to true
, the descendants of the source element
are recursively imported and the resulting nodes reassembled to form
the corresponding subtree. Otherwise, this simply generates an empty
DocumentFragment
.Document
nodes cannot be imported.DocumentType
nodes cannot be imported.Attr
nodes are attached to the generated Element
. Default
attributes are not copied, though if the document being imported into
defines default attributes for this element name, those are assigned.
If the importNode
deep
parameter was set to
true
, the descendants of the source element are
recursively imported and the resulting nodes reassembled to form the
corresponding subtree.Entity
nodes can be
imported, however in the current release of the DOM the
DocumentType
is readonly. Ability to add these imported
nodes to a DocumentType
will be considered for addition
to a future release of the DOM.On import, the publicId
,
systemId
, and notationName
attributes are
copied. If a deep
import is requested, the descendants
of the the source Entity
are recursively imported and
the resulting nodes reassembled to form the corresponding subtree.EntityReference
itself is
copied, even if a deep
import is requested, since the
source and destination documents might have defined the entity
differently. If the document being imported into provides a
definition for this entity name, its value is assigned.Notation
nodes can be imported, however in the current
release of the DOM the DocumentType
is readonly. Ability
to add these imported nodes to a DocumentType
will be
considered for addition to a future release of the DOM.On import, the
publicId
and systemId
attributes are copied.
Note that the deep
parameter has no effect on
Notation
nodes since they never have any children.target
and data
values from those of the
source node.CharacterData
copy their
data
and length
attributes from those of
the source node.
importNode
in interface Document
Document
.
DOMException
- NOT_SUPPORTED_ERR: Raised if the type of node being imported is not
supported.Document.importNode(org.w3c.dom.Node, boolean)
public Element createElement(java.lang.String tagName) throws DOMException
Document
Element
interface, so attributes
can be specified directly on the returned object.
Attr
nodes representing them are automatically created
and attached to the element.
createElementNS
method.
createElement
in interface Document
Element
object with the
nodeName
attribute set to tagName
, and
localName
, prefix
, and
namespaceURI
set to null
.
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.Document.createElement(java.lang.String)
public Element createElementNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
Document
createElementNS
in interface Document
Element
object with the following
attributes:AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted
from qualifiedName
, or null
if there is
no prefixNode.localName
local name, extracted from
qualifiedName
Element.tagName
qualifiedName
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, or if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace" .Document.createElementNS(java.lang.String, java.lang.String)
public DocumentFragment createDocumentFragment()
Document
DocumentFragment
object.
createDocumentFragment
in interface Document
DocumentFragment
.Document.createDocumentFragment()
public Text createTextNode(java.lang.String data)
Document
Text
node given the specified string.
createTextNode
in interface Document
Text
object.Document.createTextNode(java.lang.String)
public Comment createComment(java.lang.String data)
Document
Comment
node given the specified string.
createComment
in interface Document
Comment
object.Document.createComment(java.lang.String)
public CDATASection createCDATASection(java.lang.String data) throws DOMException
Document
CDATASection
node whose value is the specified
string.
createCDATASection
in interface Document
CDATASection
object.
DOMException
- NOT_SUPPORTED_ERR: Raised if this document is an HTML document.Document.createCDATASection(java.lang.String)
public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data) throws DOMException
Document
ProcessingInstruction
node given the specified
name and data strings.
createProcessingInstruction
in interface Document
ProcessingInstruction
object.
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified target contains an
illegal character.
Document.createProcessingInstruction(java.lang.String, java.lang.String)
public Attr createAttribute(java.lang.String qualifiedName) throws DOMException
Document
Attr
of the given name. Note that the
Attr
instance can then be set on an Element
using the setAttributeNode
method.
createAttributeNS
method.
createAttribute
in interface Document
Attr
object with the nodeName
attribute set to name
, and localName
,
prefix
, and namespaceURI
set to
null
. The value of the attribute is the empty string.
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.Document.createAttribute(java.lang.String)
public Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
Document
createAttributeNS
in interface Document
Attr
object with the following attributes:
AttributeValueNode.nodeName
qualifiedName
Node.namespaceURI
namespaceURI
Node.prefix
prefix, extracted from
qualifiedName
, or null
if there is no
prefixNode.localName
local name, extracted from
qualifiedName
Attr.name
qualifiedName
Node.nodeValue
the empty
string
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
, if the
qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from "
http://www.w3.org/XML/1998/namespace", or if the
qualifiedName
is "xmlns" and the
namespaceURI
is different from "
http://www.w3.org/2000/xmlns/".Document.createAttributeNS(java.lang.String, java.lang.String)
public EntityReference createEntityReference(java.lang.String name) throws DOMException
Document
EntityReference
object. In addition, if the
referenced entity is known, the child list of the
EntityReference
node is made the same as that of the
corresponding Entity
node.If any descendant of the
Entity
node has an unbound namespace prefix, the
corresponding descendant of the created EntityReference
node is also unbound; (its namespaceURI
is
null
). The DOM Level 2 does not support any mechanism to
resolve namespace prefixes.
createEntityReference
in interface Document
EntityReference
object.
DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
illegal character.
Document.createEntityReference(java.lang.String)
public NodeList getElementsByTagName(java.lang.String tagname)
Document
NodeList
of all the Elements
with a
given tag name in the order in which they are encountered in a
preorder traversal of the Document
tree.
getElementsByTagName
in interface Document
NodeList
object containing all the matched
Elements
.Document.getElementsByTagName(java.lang.String)
public NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
Document
NodeList
of all the Elements
with a
given local name and namespace URI in the order in which they are
encountered in a preorder traversal of the Document
tree.
getElementsByTagNameNS
in interface Document
NodeList
object containing all the matched
Elements
.Document.getElementsByTagNameNS(java.lang.String, java.lang.String)
public Element getElementById(java.lang.String elementId)
Document
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
. 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
Document.getElementById(java.lang.String)
public java.lang.String getEncoding()
XMLObject
getEncoding
in interface XMLObject
Document.getEncoding()
public void setEncoding(java.lang.String encoding)
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying, as part of the XML declaration, the encoding
of this document. This is null
when unspecified.
setEncoding
in interface XMLObject
Document.setEncoding(java.lang.String)
public boolean getStandalone()
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying, as part of the XML declaration, whether this document is standalone.
getStandalone
in interface XMLObject
Document.getStandalone()
public void setStandalone(boolean standalone)
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying, as part of the XML declaration, whether this document is standalone.
setStandalone
in interface XMLObject
Document.setStandalone(boolean)
public boolean getStrictErrorChecking()
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying whether errors checking is enforced or not.
When set to false
, the implementation is free to not
test every possible error case normally defined on DOM operations,
and not raise any DOMException
. In case of error, the
behavior is undefined. This attribute is true
by
defaults.
getStrictErrorChecking
in interface XMLObject
Document.getStrictErrorChecking()
public void setStrictErrorChecking(boolean strictErrorChecking)
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying whether errors checking is enforced or not.
When set to false
, the implementation is free to not
test every possible error case normally defined on DOM operations,
and not raise any DOMException
. In case of error, the
behavior is undefined. This attribute is true
by
defaults.
setStrictErrorChecking
in interface XMLObject
Document.setStrictErrorChecking(boolean)
public java.lang.String getVersion()
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying, as part of the XML declaration, the version
number of this document. This is null
when unspecified.
getVersion
in interface XMLObject
Document.getVersion()
public void setVersion(java.lang.String version)
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
An attribute specifying, as part of the XML declaration, the version
number of this document. This is null
when unspecified.
setVersion
in interface XMLObject
Document.setVersion(java.lang.String)
public Node adoptNode(Node source) throws DOMException
Document
EXPERIMENTAL! Based on the Document Object Model (DOM) Level 3 Core Working Draft of 5 June 2001..
Changes the ownerDocument
of a node, its children, as well
as the attached attribute nodes if there are any. If the node has a
parent it is first removed from its parent child list. This
effectively allows moving a subtree from one document to another. The
following list describes the specifics for each type of node.
ownerElement
attribute is set to
null
and the specified
flag is set to
true
on the adopted Attr
. The descendants
of the source Attr
are recursively adopted.Document
nodes cannot
be adopted.DocumentType
nodes cannot
be adopted.Attr
nodes.
Default attributes are discarded, though if the document being
adopted into defines default attributes for this element name, those
are assigned. The descendants of the source element are recursively
adopted.Entity
nodes cannot be adopted.EntityReference
node
itself is adopted, the descendants are discarded, since the source
and destination documents might have defined the entity differently.
If the document being imported into provides a definition for this
entity name, its value is assigned.Notation
nodes cannot be adopted.
adoptNode
in interface XMLObject
DOMException
Document.adoptNode(org.w3c.dom.Node)
public java.lang.String getNodeName()
Node
getNodeName
in interface Node
Node.getNodeName()
public java.lang.String getNodeValue() throws DOMException
Node
null
, setting it has no effect.
getNodeValue
in interface Node
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.Node.getNodeValue()
public void setNodeValue(java.lang.String nodeValue) throws DOMException
setNodeValue
in interface Node
DOMException
Node.setNodeValue(java.lang.String)
public short getNodeType()
Node
getNodeType
in interface Node
Node.getNodeType()
public Node getParentNode()
Node
Attr
,
Document
, DocumentFragment
,
Entity
, and Notation
may have a parent.
However, if a node has just been created and not yet added to the
tree, or if it has been removed from the tree, this is
null
.
getParentNode
in interface Node
Node.getParentNode()
public NodeList getChildNodes()
Node
NodeList
that contains all children of this node. If
there are no children, this is a NodeList
containing no
nodes.
getChildNodes
in interface Node
Node.getChildNodes()
public Node getFirstChild()
Node
null
.
getFirstChild
in interface Node
Node.getFirstChild()
public Node getLastChild()
Node
null
.
getLastChild
in interface Node
Node.getLastChild()
public Node getPreviousSibling()
Node
null
.
getPreviousSibling
in interface Node
Node.getPreviousSibling()
public Node getNextSibling()
Node
null
.
getNextSibling
in interface Node
Node.getNextSibling()
public NamedNodeMap getAttributes()
Node
NamedNodeMap
containing the attributes of this node (if
it is an Element
) or null
otherwise.
getAttributes
in interface Node
Node.getAttributes()
public Document getOwnerDocument()
Node
Document
object associated with this node. This is
also the Document
object used to create new nodes. When
this node is a Document
or a DocumentType
which is not used with any Document
yet, this is
null
.
getOwnerDocument
in interface Node
Node.getOwnerDocument()
public Node insertBefore(Node newChild, Node refChild) throws DOMException
Node
newChild
before the existing child node
refChild
. If refChild
is null
,
insert newChild
at the end of the list of children.
newChild
is a DocumentFragment
object,
all of its children are inserted, in the same order, before
refChild
. If the newChild
is already in the
tree, it is first removed.
insertBefore
in interface Node
DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild
node, or if
the node to insert is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
refChild
is not a child of
this node.Node.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
Node
oldChild
with newChild
in the list of children, and returns the oldChild
node.
newChild
is a DocumentFragment
object,
oldChild
is replaced by all of the
DocumentFragment
children, which are inserted in the
same order. If the newChild
is already in the tree, it
is first removed.
replaceChild
in interface Node
DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild
node, or if
the node to put in is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
oldChild
is not a child of
this node.Node.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
public Node removeChild(Node oldChild) throws DOMException
Node
oldChild
from the list
of children, and returns it.
removeChild
in interface Node
DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldChild
is not a child of
this node.Node.removeChild(org.w3c.dom.Node)
public Node appendChild(Node newChild) throws DOMException
Node
newChild
to the end of the list of children
of this node. If the newChild
is already in the tree, it
is first removed.
appendChild
in interface Node
DOMException
- HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not
allow children of the type of the newChild
node, or if
the node to append is one of this node's ancestors.
newChild
was created
from a different document than the one that created this node.
Node.appendChild(org.w3c.dom.Node)
public void normalize()
Node
Text
nodes in the full depth of the sub-tree
underneath this Node
, including attribute nodes, into a
"normal" form where only structure (e.g., elements, comments,
processing instructions, CDATA sections, and entity references)
separates Text
nodes, i.e., there are neither adjacent
Text
nodes nor empty Text
nodes. This can
be used to ensure that the DOM view of a document is the same as if
it were saved and re-loaded, and is useful when operations (such as
XPointer lookups) that depend on a particular document tree
structure are to be used.In cases where the document contains
CDATASections
, the normalize operation alone may not be
sufficient, since XPointers do not differentiate between
Text
nodes and CDATASection
nodes.
normalize
in interface Node
Node.normalize()
public boolean isSupported(java.lang.String feature, java.lang.String version)
Node
isSupported
in interface Node
true
if the specified feature is
supported on this node, false
otherwise.Node.isSupported(String, String)
public java.lang.String getNamespaceURI()
Node
null
if it is
unspecified.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.Per
the Namespaces in XML Specification an attribute does not inherit
its namespace from the element it is attached to. If an attribute is
not explicitly given a namespace, it simply has no namespace.
getNamespaceURI
in interface Node
Node.getNamespaceURI()
public java.lang.String getPrefix()
Node
null
if it is
unspecified.
nodeName
attribute, which holds the qualified name, as
well as the tagName
and name
attributes of
the Element
and Attr
interfaces, when
applicable.
namespaceURI
and localName
do not change.
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.
getPrefix
in interface Node
Node.getPrefix()
public void setPrefix(java.lang.String prefix)
setPrefix
in interface Node
Node.setPrefix(java.lang.String)
public java.lang.String getLocalName()
Node
ELEMENT_NODE
and
ATTRIBUTE_NODE
and nodes created with a DOM Level 1
method, such as createElement
from the
Document
interface, this is always null
.
getLocalName
in interface Node
Node.getLocalName()
public boolean hasChildNodes()
Node
hasChildNodes
in interface Node
true
if this node has any children,
false
otherwise.Node.hasChildNodes()
public boolean hasAttributes()
Node
hasAttributes
in interface Node
true
if this node has any attributes,
false
otherwise.Node.hasAttributes()
public java.lang.String toDocument()
XMLObject
DOMFormatter
class if
more options are required.
toDocument
in interface XMLObject
XMLObject.toDocument()
protected abstract void syncWithDocument(Node node)
public void syncAccessMethods()
XMLObject
null
.
syncAccessMethods
in interface XMLObject
XMLObject.syncAccessMethods()
public void initFields()
syncAccessMethods()
instead.
syncAccessMethods
public boolean isURLAttribute(Element element, java.lang.String attrName)
DocumentInfo
isURLAttribute
in interface DocumentInfo
DocumentInfo.isURLAttribute(org.w3c.dom.Element, java.lang.String)
protected final void doSetText(Element element, java.lang.String text)
|
Enhydra 5.1 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |