org.enhydra.xml.dom
Class DOMInfoPrinter

java.lang.Object
  |
  +--org.enhydra.xml.dom.DOMInfoPrinter
All Implemented Interfaces:
DOMTraversal.Handler
Direct Known Subclasses:
LazyDOMInfoPrinter

public class DOMInfoPrinter
extends Object
implements DOMTraversal.Handler

DOMTraversal handler for DOMInfo, using only generic DOM interfaces.


Field Summary
protected  boolean fAllAttributes
          Should all attributes, or only specified ones be printed?
protected  boolean fAttrSkipPrint
          Flag to indicate that nothing should be printed, just nodes counted.
protected  PrintWriter fOut
          Writer for output.
protected  boolean fVerboseAttributes
          Control attribute formatting.
protected  int level
          Indent level.
 
Constructor Summary
protected DOMInfoPrinter(int options, DOMTraversal traverser, PrintWriter out)
          Constructor.
 
Method Summary
 void handleAttr(Attr attr)
          Handler called for Attr nodes.
 void handleCDATASection(CDATASection cdata)
          Handler called for CDATASection nodes.
 void handleComment(Comment comment)
          Handler called for Comment nodes.
 void handleDocument(Document document)
          Handler called for Document nodes.
 void handleDocumentFragment(DocumentFragment documentFragment)
          Handler called for DocumentFragment nodes.
 void handleDocumentType(DocumentType documentType)
          Handler called for DocumentType nodes.
 void handleElement(Element element)
          Handler called for Element nodes.
 void handleEntity(Entity entity)
          Handler called for Entity nodes.
 void handleEntityReference(EntityReference entityRef)
          Handler called for EntityReference nodes.
 void handleNotation(Notation notation)
          Handler called for Notation nodes.
 void handleProcessingInstruction(ProcessingInstruction pi)
          Handler called for ProcessingInstruction nodes.
 void handleText(Text text)
          Handler called for Text nodes.
protected  boolean hasPrintAttributes(Element element)
          Determine if an element has attributes that are to be printed.
protected  void printIndent()
          Print indentation.
protected  void printNodeName(Node node)
          Print node name (override to add additional information).
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fOut

protected PrintWriter fOut
Writer for output.

fVerboseAttributes

protected boolean fVerboseAttributes
Control attribute formatting.

fAllAttributes

protected boolean fAllAttributes
Should all attributes, or only specified ones be printed?

fAttrSkipPrint

protected boolean fAttrSkipPrint
Flag to indicate that nothing should be printed, just nodes counted. Use to implement terse attribute printing, nonly need be checked on thinks that can be children of attributes.

level

protected int level
Indent level.
Constructor Detail

DOMInfoPrinter

protected DOMInfoPrinter(int options,
                         DOMTraversal traverser,
                         PrintWriter out)
Constructor.
Method Detail

printIndent

protected void printIndent()
Print indentation.

printNodeName

protected void printNodeName(Node node)
Print node name (override to add additional information).

hasPrintAttributes

protected boolean hasPrintAttributes(Element element)
Determine if an element has attributes that are to be printed.

handleDocument

public void handleDocument(Document document)
Handler called for Document nodes.
Specified by:
handleDocument in interface DOMTraversal.Handler

handleDocumentType

public void handleDocumentType(DocumentType documentType)
Handler called for DocumentType nodes.
Specified by:
handleDocumentType in interface DOMTraversal.Handler

handleDocumentFragment

public void handleDocumentFragment(DocumentFragment documentFragment)
Handler called for DocumentFragment nodes.
Specified by:
handleDocumentFragment in interface DOMTraversal.Handler

handleAttr

public void handleAttr(Attr attr)
Handler called for Attr nodes.
Specified by:
handleAttr in interface DOMTraversal.Handler

handleEntity

public void handleEntity(Entity entity)
Handler called for Entity nodes.
Specified by:
handleEntity in interface DOMTraversal.Handler

handleEntityReference

public void handleEntityReference(EntityReference entityRef)
Handler called for EntityReference nodes.
Specified by:
handleEntityReference in interface DOMTraversal.Handler

handleElement

public void handleElement(Element element)
Handler called for Element nodes.
Specified by:
handleElement in interface DOMTraversal.Handler

handleNotation

public void handleNotation(Notation notation)
Handler called for Notation nodes.
Specified by:
handleNotation in interface DOMTraversal.Handler

handleProcessingInstruction

public void handleProcessingInstruction(ProcessingInstruction pi)
Handler called for ProcessingInstruction nodes.
Specified by:
handleProcessingInstruction in interface DOMTraversal.Handler

handleCDATASection

public void handleCDATASection(CDATASection cdata)
Handler called for CDATASection nodes.
Specified by:
handleCDATASection in interface DOMTraversal.Handler

handleComment

public void handleComment(Comment comment)
Handler called for Comment nodes.
Specified by:
handleComment in interface DOMTraversal.Handler

handleText

public void handleText(Text text)
Handler called for Text nodes.
Specified by:
handleText in interface DOMTraversal.Handler


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