|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.barracudamvc.core.util.dom.DOMUtil
public class DOMUtil
DOM related utility functions.
Constructor Summary | |
---|---|
DOMUtil()
|
Method Summary | |
---|---|
static Text |
findFirstText(Node node)
Find the first text descendent node of an element. |
static Text |
getFirstText(Node node)
Gets the first text descendent node of an element. |
static String |
getID(Node node)
Given a Node name, return the "id" attribute if it exists. |
static String |
getID(Node node,
String nullResponse)
Given a Node, return the "id" attribute if it exists. |
protected static void |
print(OutputStream out,
String s)
|
protected static void |
printChildMarkup(Node node,
PrintWriter out,
boolean isHtml,
boolean skipComments,
int depth)
|
static void |
printMarkup(Node node)
|
static void |
printMarkup(Node node,
PrintWriter out,
boolean isHtml,
boolean skipComments,
int depth)
|
static void |
printStackTrace(Node node)
utility method to recursively print the stack trace for a DOM Node |
static void |
printStackTrace(Node node,
OutputStream out,
int depth)
utility method to recursively print the stack trace for a DOM Node Bounds: If depth < 0, the method returns immediately |
static void |
removeAllTextNodes(Node node)
Remove all text nodes below this node |
static Node |
setTextInNode(Node node,
String text,
boolean allowMarkupInText)
Automatically set text in a Node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMUtil()
Method Detail |
---|
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.
DOMException
- if the Text object is not foundpublic static Node setTextInNode(Node node, String text, boolean allowMarkupInText)
node
- the starting node for the search.text
- the text to be setallowMarkupInText
- whether to allow markup in text to pass through unparsed
DOMException
- if the Text object is not foundpublic static void removeAllTextNodes(Node node)
node
- The starting node for the search.public static String getID(Node node)
node
- the node name in question
public static String getID(Node node, String nullResponse)
node
- the node in questionnullResponse
- the response to be returned if the id attribute
does not exist
public static void printStackTrace(Node node)
utility method to recursively print the stack trace for a DOM Node
public static void printStackTrace(Node node, OutputStream out, int depth)
utility method to recursively print the stack trace for a DOM Node
Bounds:
If depth < 0, the method returns immediately
node
- the node in questionout
- OutputStream to print todepth
- inset depth at which to start printingprotected static void print(OutputStream out, String s)
public static void printMarkup(Node node)
public static void printMarkup(Node node, PrintWriter out, boolean isHtml, boolean skipComments, int depth)
protected static void printChildMarkup(Node node, PrintWriter out, boolean isHtml, boolean skipComments, int depth)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |