Enhydra 3.1b2 API

org.enhydra.xml.dom
Class DOMInfo

java.lang.Object
  |
  +--org.enhydra.xml.dom.DOMInfo

public class DOMInfo
extends java.lang.Object

Methods to print information out about a DOM. Used for debugging, etc. Has special handling for Lazy DOMs to prevent expansion.


Field Summary
static int ALL_ATTRS
          Print all attributes, even unspecified ones.
protected  DOMInfoPrinter fInfoPrinter
           
protected  int fOptions
          Options to use.
protected  java.io.PrintWriter fOut
          Write for output.
protected  DOMTraversal fTraverser
          DOM traversal object and handler.
static int NO_RECURSION
          Don't recurse, just print the specified node.
static int PRINT_ALL
          All Print options, except NO_RECURSION.
static int PRINT_ATTR_DETAILS
          Print attributes as the Nodes that represent them.
static int PRINT_DEFAULT
          Default print options.
static int SYM_TEXT_LINEBREAKS
          Print newlines and carriage returns as \n and \r, avoiding linebreaks in text
 
Constructor Summary
protected DOMInfo(int options, DOMTraversal traverser, DOMInfoPrinter infoPrinter, java.io.PrintWriter out)
          Constructor for derived objects.
 
Method Summary
static int getTraverserOptions(int options)
          Get traverser options from DOMInfo options.
static java.lang.String nodeTypeToName(short type)
          Convert a node type to a name.
static void printTree(java.lang.String msg, Node root)
          Print a DOM node an its children to stderr..
static void printTree(java.lang.String msg, Node root, int options, java.io.PrintWriter out)
          Print a DOM node and its children.
static void printTree(java.lang.String msg, Node root, java.io.OutputStream out)
          Print a DOM node an its children.
static void printTree(java.lang.String msg, Node root, java.io.PrintWriter out)
          Print a DOM node an its children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRINT_ATTR_DETAILS

public static final int PRINT_ATTR_DETAILS
Print attributes as the Nodes that represent them.

ALL_ATTRS

public static final int ALL_ATTRS
Print all attributes, even unspecified ones.

SYM_TEXT_LINEBREAKS

public static final int SYM_TEXT_LINEBREAKS
Print newlines and carriage returns as \n and \r, avoiding linebreaks in text

NO_RECURSION

public static final int NO_RECURSION
Don't recurse, just print the specified node.

PRINT_ALL

public static final int PRINT_ALL
All Print options, except NO_RECURSION.

PRINT_DEFAULT

public static final int PRINT_DEFAULT
Default print options.

fOptions

protected int fOptions
Options to use.

fOut

protected java.io.PrintWriter fOut
Write for output.

fTraverser

protected DOMTraversal fTraverser
DOM traversal object and handler.

fInfoPrinter

protected DOMInfoPrinter fInfoPrinter
Constructor Detail

DOMInfo

protected DOMInfo(int options,
                  DOMTraversal traverser,
                  DOMInfoPrinter infoPrinter,
                  java.io.PrintWriter out)
Constructor for derived objects.
Method Detail

getTraverserOptions

public static int getTraverserOptions(int options)
Get traverser options from DOMInfo options.

nodeTypeToName

public static java.lang.String nodeTypeToName(short type)
Convert a node type to a name.

printTree

public static void printTree(java.lang.String msg,
                             Node root,
                             int options,
                             java.io.PrintWriter out)
Print a DOM node and its children.
Parameters:
msg - A message to print at the start. If null or empty, don't print a message.
root - Top of the tree.
options - Set of print options.
out - Output writer. If null, stderr will be used.

printTree

public static void printTree(java.lang.String msg,
                             Node root,
                             java.io.PrintWriter out)
Print a DOM node an its children.
Parameters:
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. If null, stderr will be used.

printTree

public static void printTree(java.lang.String msg,
                             Node root,
                             java.io.OutputStream out)
Print a DOM node an its children.
Parameters:
msg - A message to print at the start. If null or empty, don't print a message.
root - Top of the tree.
out - Output stream. If null, stderr will be used.

printTree

public static void printTree(java.lang.String msg,
                             Node root)
Print a DOM node an its children to stderr..
Parameters:
msg - A message to print at the start. If null or empty, don't print a message.
root - Top of the tree.

Enhydra 3.1b2 API