org.enhydra.xml.dom
Class DOMInfo

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

public class DOMInfo
extends 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  PrintWriter fOut
          Write for output.
protected  DOMTraversal fTraverser
          DOM traversal object and handler.
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
static int TRUNCATE_TEXT
          Truncate text, comments etc, to 16 chars.
 
Constructor Summary
protected DOMInfo(int options, DOMTraversal traverser, DOMInfoPrinter infoPrinter, PrintWriter out)
          Constructor for derived objects.
 
Method Summary
static int getTraverserOptions(int options)
          Get traverser options from DOMInfo options.
static String nodeTypeToName(short type)
          Convert a node type to a name.
static void printTree(String msg, Node root)
          Print a DOM node an its children to stderr..
static void printTree(String msg, Node root, int options, PrintWriter out)
          Print a DOM node and its children.
static void printTree(String msg, Node root, OutputStream out)
          Print a DOM node an its children.
static void printTree(String msg, Node root, 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

TRUNCATE_TEXT

public static final int TRUNCATE_TEXT
Truncate text, comments etc, to 16 chars. Implys SYM_TEXT_LINEBREAKS.

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 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,
                  PrintWriter out)
Constructor for derived objects.
Method Detail

getTraverserOptions

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

nodeTypeToName

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

printTree

public static void printTree(String msg,
                             Node root,
                             int options,
                             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(String msg,
                             Node root,
                             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(String msg,
                             Node root,
                             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(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.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.