de.pannenleiter.client
Class Indenter

java.lang.Object
  |
  +--de.pannenleiter.client.Indenter

public class Indenter
extends java.lang.Object
implements org.xml.sax.DocumentHandler

Indenter -- indents or trims xml text


Field Summary
protected  java.lang.StringBuffer collect
           
protected  int depth
           
protected  boolean escaping
           
protected  org.xml.sax.Parser theParser
           
protected  boolean trimming
           
 
Constructor Summary
Indenter()
           
 
Method Summary
 java.lang.String beautify(java.lang.String xml, boolean trim)
           
 void characters(char[] ch, int start, int length)
           
protected  void doIndent()
           
 void endDocument()
           
 void endElement(java.lang.String element)
           
protected  void escape(char[] ch, int start, int length)
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 void processingInstruction(java.lang.String target, java.lang.String data)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void startDocument()
           
 void startElement(java.lang.String element, org.xml.sax.AttributeList atts)
           
protected  void writeAttribute(java.lang.String elname, java.lang.String attname, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theParser

protected org.xml.sax.Parser theParser

collect

protected java.lang.StringBuffer collect

depth

protected int depth

trimming

protected boolean trimming

escaping

protected boolean escaping
Constructor Detail

Indenter

public Indenter()
         throws java.lang.Exception
Method Detail

beautify

public java.lang.String beautify(java.lang.String xml,
                                 boolean trim)
                          throws java.lang.Exception

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.DocumentHandler

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Specified by:
endDocument in interface org.xml.sax.DocumentHandler

endElement

public void endElement(java.lang.String element)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.DocumentHandler

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Specified by:
ignorableWhitespace in interface org.xml.sax.DocumentHandler

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Specified by:
processingInstruction in interface org.xml.sax.DocumentHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.DocumentHandler

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Specified by:
startDocument in interface org.xml.sax.DocumentHandler

startElement

public void startElement(java.lang.String element,
                         org.xml.sax.AttributeList atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.DocumentHandler

writeAttribute

protected void writeAttribute(java.lang.String elname,
                              java.lang.String attname,
                              java.lang.String value)

escape

protected void escape(char[] ch,
                      int start,
                      int length)

doIndent

protected void doIndent()