|
||||||||||
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)
Call Document#adoptNode(node) on doc if
supported. |
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 |
getContentDocument(HTMLElement elem)
Call HTMLElement#getContentDocument(node) on elem if
supported. |
static Document |
getDocument(Node node)
Get the owner document object for a node. |
static String |
getEncoding(Document doc)
Call Document#getEncoding() on doc if
supported. |
static String |
getEncoding(Entity entity)
Call Entity#getEncoding on entity if
supported. |
static boolean |
getStandalone(Document doc)
Call Document#getStandalone() on doc if
supported. |
static boolean |
getStrictErrorChecking(Document doc)
Call Document#getStrictErrorChecking() on doc if
supported. |
static String |
getVersion(Document doc)
Call Document#getVersion() on doc if
supported. |
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)
Call Document#setEncoding(enc) on doc if
supported. |
static void |
setEncoding(Entity entity,
String enc)
Call Entity#setEncoding(enc) on entity if
supported. |
static void |
setStandalone(Document doc,
boolean val)
Call Document#setStandalone(val) on doc if
supported. |
static void |
setStrictErrorChecking(Document doc,
boolean val)
Call Document#setStrictErrorChecking(val) on doc if supported. |
static void |
setVersion(Document doc,
String version)
Call Document#setVersion(version) on doc if
supported. |
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)
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)
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)
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)
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)
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)
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)
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)
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
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
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 Document getContentDocument(HTMLElement elem)
elem
if
supported.
By using reflection, this method avoids problems when
HTMLElement.getContentDocument()
is not supported by the
given implementation of org.w3c.dom.HTMLElement
(e.g. the one provided by JDK 1.4).elem
- the elementnull
if this
operation fails, such as when the source node comes from a
different implementation.UnsupportedOperationException
- if elem
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 |