|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.dom.DOMOps
Various static methods the do simple operations on the DOM.
Method Summary | |
static Node |
adoptNode(Document doc,
Node node)
Deprecated. no replacement - use DOM3 Document.adoptNode(Node) instead |
static int |
countChildren(Node node)
Count the number of children in a node has. |
static Node |
getActualNode(Node node)
Get the real DOM node, bypassing an XMLC-generated container. |
static Document |
getDocument(Node node)
Get the owner document object for a node. |
static String |
getEncoding(Document doc)
Deprecated. no replacement - use DOM3 Document.getXmlEncoding() instead |
static String |
getEncoding(Entity entity)
Deprecated. no replacement - use DOM3 Entity.getXmlEncoding() instead |
static boolean |
getStandalone(Document doc)
Deprecated. no replacement - use DOM3 Document.getXmlStandalone() instead |
static boolean |
getStrictErrorChecking(Document doc)
Deprecated. no replacement - use DOM3 Document.getStrictErrorChecking() instead |
static String |
getVersion(Document doc)
Deprecated. no replacement - use DOM3 Document.getXmlVersion() instead |
static boolean |
isLazyDOMInstance(Document doc)
Determine if a document is a LazyDOM instance document. |
static boolean |
isNodeOfType(Node node,
short ofType)
Provides null-safe, inline evaluation of the node type. |
static Node |
replaceNode(Node srcNode,
Node destNode)
Replace a node with one imported from another document. |
static void |
setEncoding(Document doc,
String enc)
Deprecated. Xerces DOM Internal - normally Read-only - corresponds to Document.getXmlEncoding() which, itself, has no corresponding public mutator (was part of early DOM3 draft, but removed in the final specification) |
static void |
setEncoding(Entity entity,
String enc)
Deprecated. no replacement - Read-only - part of early DOM3 draft but removed in final DOM3 specification |
static void |
setStandalone(Document doc,
boolean val)
Deprecated. no replacement - use DOM3 Document.setXmlStandalone(boolean) instead |
static void |
setStrictErrorChecking(Document doc,
boolean val)
Deprecated. no replacement - use DOM3 Document.setStrictErrorChecking(boolean) instead |
static void |
setVersion(Document doc,
String version)
Deprecated. no replacement - use DOM3 Document.setXmlVersion(String) instead |
Methods inherited from class java.lang.Object |
|
Method Detail |
public static Document getDocument(Node node)
public static Node getActualNode(Node node)
public static Node replaceNode(Node srcNode, Node destNode)
srcNode
- The node to clone and insertdestNode
- The node to be replacedpublic static int countChildren(Node node)
public static boolean isLazyDOMInstance(Document doc)
public static boolean getStandalone(Document doc)
Document.getXmlStandalone()
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.getStandalone()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documenttrue
if the document is standalone,
false
elseUnsupportedOperationException
- if doc
does
not support the methodpublic static void setStandalone(Document doc, boolean val)
Document.setXmlStandalone(boolean)
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.setStandalone()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentval
- the new valueUnsupportedOperationException
- if doc
does
not support the methodpublic static String getEncoding(Document doc)
Document.getXmlEncoding()
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.getEncoding()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentUnsupportedOperationException
- if doc
does
not support the methodpublic static void setEncoding(Document doc, String enc)
Document.getXmlEncoding()
which, itself, has no corresponding public mutator (was part of early DOM3 draft, but removed in the final specification)
doc
if
supported.
By using reflection, this method avoids problems when
Document.setEncoding()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentenc
- the encodingUnsupportedOperationException
- if doc
does
not support the methodpublic static boolean getStrictErrorChecking(Document doc)
Document.getStrictErrorChecking()
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.getStrictErrorChecking()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documenttrue
if the document has strict error checking,
false
elseUnsupportedOperationException
- if doc
does
not support the methodpublic static void setStrictErrorChecking(Document doc, boolean val)
Document.setStrictErrorChecking(boolean)
instead
doc
if supported. By using reflection, this
method avoids problems when
Document.setStrictErrorChecking()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentval
- the new valueUnsupportedOperationException
- if doc
does
not support the methodpublic static String getVersion(Document doc)
Document.getXmlVersion()
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.getVersion()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentUnsupportedOperationException
- if doc
does
not support the methodpublic static void setVersion(Document doc, String version)
Document.setXmlVersion(String)
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.setVersion()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentversion
- the versionUnsupportedOperationException
- if doc
does
not support the methodpublic static Node adoptNode(Document doc, Node node) throws DOMException
Document.adoptNode(Node)
instead
doc
if
supported.
By using reflection, this method avoids problems when
Document.adoptNode()
is not supported by the
given implementation of org.w3c.dom.Document
(e.g. the one provided by JDK 1.4).doc
- the documentnode
- the nodenull
if this
operation fails, such as when the source node comes from a
different implementation.UnsupportedOperationException
- if doc
does
not support the methodDOMException
- NOT_SUPPORTED_ERR: Raised if the source
node is of type DOCUMENT,
DOCUMENT_TYPE. NO_MODIFICATION_ALLOWED_ERR: Raised when the
source node is readonly.public static String getEncoding(Entity entity)
Entity.getXmlEncoding()
instead
entity
if
supported.
By using reflection, this method avoids problems when
Entity.getEncoding()
is not supported by the
given implementation of org.w3c.dom.Entity
(e.g. the one provided by JDK 1.4).entity
- the entityUnsupportedOperationException
- if entity
does
not support the methodpublic static void setEncoding(Entity entity, String enc)
entity
if
supported.
By using reflection, this method avoids problems when
Entity.setEncoding()
is not supported by the
given implementation of org.w3c.dom.Entity
(e.g. the one provided by JDK 1.4).entity
- the entityenc
- the encodingUnsupportedOperationException
- if entity
does
not support the methodpublic static boolean isNodeOfType(Node node, short ofType)
instanceof
comparisons.node
- the node for which to check the typeofType
- any one of the static short constants provided by
org.w3c.dom.Node, eg.. Node.DOCUMENT_NODE, Node.TEXT_NODE,
etc...
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |