|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxml.DOMEcho
public class DOMEcho
Program to echo a DOM tree using DOM Level 2 interfaces. Use JAXP to read in and create a DOM tree. DOM currently does not provide a method to do this. (This is planned for Level 3.) See the method main for the three basic steps. Once the application obtains a DOM Document tree, it dumps out the nodes in the tree and associated node attributes for each node. Notes: Program flags may be used to create possibly non-conformant (but useful) DOM trees. Program also shows an example of using an ErrorHandler.
| Nested Class Summary | |
|---|---|
private static class |
DOMEcho.MyErrorHandler
|
| Field Summary | |
|---|---|
private static String |
basicIndent
Indentation will be in multiples of basicIndent |
private static int |
indent
Indent level |
private static PrintWriter |
out
Output goes here |
(package private) static String |
outputEncoding
All output will be use this encoding |
| Constructor Summary | |
|---|---|
DOMEcho(PrintWriter out)
|
|
| Method Summary | |
|---|---|
static void |
echo(Node n)
Recursive routine to print out DOM tree nodes |
static void |
main(String[] args)
|
private static void |
outputIndentation()
Indent to the current level in multiples of basicIndent |
private static void |
printlnCommon(Node n)
Echo common attributes of a DOM2 Node and terminate output with an EOL character. |
private static void |
usage()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final String outputEncoding
private static PrintWriter out
private static int indent
private static final String basicIndent
| Constructor Detail |
|---|
DOMEcho(PrintWriter out)
| Method Detail |
|---|
private static void printlnCommon(Node n)
private static void outputIndentation()
public static void echo(Node n)
private static void usage()
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||