com.jclark.xsl.sax2

Class Indenter

Implemented Interfaces:
ContentHandler, CommentHandler, OutputContentHandler, RawCharactersHandler

public class Indenter
extends java.lang.Object
implements OutputContentHandler, CommentHandler, RawCharactersHandler

performs "pretty-printing" by wrapping another ContentHandler, intercepting SAX events, and inserting whitespace events as appropriate. ... (Actually, I don't think it adds any indenting, just newlines)

Constructor Summary

Indenter(ContentHandler handler, RawCharactersHandler rawCharactersHandler)

Method Summary

void
characters(ch[] , int start, int length)
void
comment(String contents)
void
endDocument()
void
endElement(String namespaceURI, String localName, String qName)
void
endPrefixMapping(String prefix)
void
ignorableWhitespace(ch[] , int start, int length)
ContentHandler
init(Destination dest, Properties atts)
void
processingInstruction(String target, String data)
void
rawCharacters(String chars)
void
setDocumentLocator(Locator locator)
void
skippedEntity(String name)
void
startDocument()
void
startElement(String namespaceURI, String localName, String qName, Attributes atts)
void
startPrefixMapping(String prefix, String namespaceURI)

Constructor Details

Indenter

public Indenter(ContentHandler handler,
                RawCharactersHandler rawCharactersHandler)

Method Details

characters

public void characters(ch[] ,
                       int start,
                       int length)
            throws SAXException


comment

public void comment(String contents)
            throws SAXException
Specified by:
comment in interface CommentHandler


endDocument

public void endDocument()
            throws SAXException


endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
            throws SAXException


endPrefixMapping

public void endPrefixMapping(String prefix)
            throws SAXException


ignorableWhitespace

public void ignorableWhitespace(ch[] ,
                                int start,
                                int length)
            throws SAXException


init

public ContentHandler init(Destination dest,
                           Properties atts)
            throws IOException,
                   SAXException
Specified by:
init in interface OutputContentHandler


processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws SAXException


rawCharacters

public void rawCharacters(String chars)
            throws SAXException
Specified by:
rawCharacters in interface RawCharactersHandler


setDocumentLocator

public void setDocumentLocator(Locator locator)


skippedEntity

public void skippedEntity(String name)
            throws SAXException


startDocument

public void startDocument()
            throws SAXException


startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
            throws SAXException


startPrefixMapping

public void startPrefixMapping(String prefix,
                               String namespaceURI)
            throws SAXException