|
Enhydra 3.0.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.XMLCUtil
Utility methods for dealing with DOMs.
Field Summary | |
static int |
PRINT_ALL
All Print options. |
static int |
PRINT_CDATA
Option to printNode to print the contents of Text nodes. |
static int |
PRINT_COMMENT
Option to printNode to print the contents of Comment nodes. |
static int |
PRINT_DEFAULT
Default print options. |
static int |
PRINT_DOCUMENTTYPE
Option to printNode to print the contents of DocumentType nodes. |
static int |
PRINT_TEXT
Option to printNode to print the contents of Text nodes. |
Constructor Summary | |
XMLCUtil()
|
Method Summary | |
static Node |
copyNode(Node srcNode,
Document destDocument)
Deprecated. use Document.importNode |
static java.lang.String |
dumpAttrs(Node node,
boolean all)
Generate string of attribute names and values, sorted by name. |
static Text |
findFirstText(Node node)
Find the first text descendent node of an element. |
static Attr |
getAttributeByName(Node node,
java.lang.String name)
Find an attribute of a node by name. |
static Element |
getElementById(java.lang.String id,
Node node)
Recursively search for an element by id starting at a node. |
static Text |
getFirstText(Node node)
Find the first text descendent node of an element. |
static Element |
getRequiredElementById(java.lang.String id,
Node node)
Recursively search for an required element by id starting at a node. |
static void |
printNode(java.lang.String msg,
Node node,
int options,
java.io.PrintWriter out)
Print a node and its children. |
static void |
printNode(java.lang.String msg,
Node node,
java.io.OutputStream out)
Print a node an its children. |
static void |
printNode(java.lang.String msg,
Node node,
java.io.PrintWriter out)
Print a node an its children. |
static Node |
replaceNode(Node srcNode,
Node destNode)
Replace a node with a given one from another document. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int PRINT_COMMENT
public static final int PRINT_TEXT
public static final int PRINT_CDATA
public static final int PRINT_DOCUMENTTYPE
public static final int PRINT_ALL
public static final int PRINT_DEFAULT
Constructor Detail |
public XMLCUtil()
Method Detail |
public static Attr getAttributeByName(Node node, java.lang.String name)
node
- Node who's attribute is desired.name
- The name of the desired attribute.public static Text findFirstText(Node node)
node
- The starting node for the search.public static Text getFirstText(Node node)
node
- The starting node for the search.public static Element getElementById(java.lang.String id, Node node)
id
- The element id to find. Case is ignored.node
- The node to start the search at.public static Element getRequiredElementById(java.lang.String id, Node node)
id
- The element id to find. Case is ignored.node
- The node to start the search at.getElementById(java.lang.String, org.w3c.dom.Node)
public static java.lang.String dumpAttrs(Node node, boolean all)
node
- Get the attributes of this node.all
- If true, get all attributes, otherwise get only specified
ones.public static void printNode(java.lang.String msg, Node node, int options, java.io.PrintWriter out)
msg
- A message to print at the start. If null or empty,
don't print a message.node
- Top of the tree.options
- Set of print options.out
- Output writer.public static void printNode(java.lang.String msg, Node node, java.io.PrintWriter out)
msg
- A message to print at the start. If null or empty,
don't print a message.node
- Top of the tree.out
- Output writer.public static void printNode(java.lang.String msg, Node node, java.io.OutputStream out)
msg
- A message to print at the start. If null or empty,
don't print a message.node
- Top of the tree.out
- Output stream.public static Node copyNode(Node srcNode, Document destDocument)
srcNode
- The node to copy.destDocument
- The destination document. The node will
belong to this document but will not be inserted in it.Document.importNode(org.w3c.dom.Node, boolean)
public static Node replaceNode(Node srcNode, Node destNode)
srcElement
- The node to clone and insertdestElement
- The node to be replaced
|
Enhydra 3.0.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |