org.exolab.adaptx.xslt.handlers

Class DefaultHandler

Implemented Interfaces:
DocumentHandler, ResultHandler

public class DefaultHandler
extends java.lang.Object
implements ResultHandler

The default implementation of ResultHandler. It uses the Apache Serializer classes written by my friend and colleague Assaf Arkin.
Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/01 07:39:56 $
Author:
Keith Visco

Constructor Summary

DefaultHandler(Writer out)
Creates a new DefaultHandler
DefaultHandler(Writer out, OutputFormat format)
Creates a new DefaultHandler

Method Summary

void
cdata(char[] chars, int start, int length)
Signals to receive CDATA characters
void
characters(char[] chars, int start, int length)
Signals the start of characters
void
comment(String data)
void
endDocument()
Signals the end of the document
void
endElement(String name)
Signals the start of element
void
entityReference(String name)
Signals to recieve an entity reference with the given name
void
ignorableWhitespace(char[] chars, int start, int length)
Signals the start of ignorable whitespace characters
void
processingInstruction(String target, String data)
Signals to recieve a processing instruction
void
setDocumentLocator(Locator locator)
Sets the document locator
void
setIndentSize(short indentSize)
Sets the indent size for all formatters that perform serialization, in which indentation is applicable.
void
setOutputFormat(OutputFormat format)
Sets the output format information for Formatters that perform serialization.
void
startDocument()
Signals the start of a document
void
startElement(String name, AttributeList atts)
Signals the start of element
void
unescapedCharacters(char[] chars, int start, int length)
Signals to receive characters which should not be escaped

Constructor Details

DefaultHandler

public DefaultHandler(Writer out)
Creates a new DefaultHandler

DefaultHandler

public DefaultHandler(Writer out,
                      OutputFormat format)
Creates a new DefaultHandler

Method Details

cdata

public void cdata(char[] chars,
                  int start,
                  int length)
Signals to receive CDATA characters
Specified by:
cdata in interface ResultHandler
Parameters:
chars - the character array containing the characters to receive
start - the index into the character array to start receiving characters at
length - the number of characters to recieve

characters

public void characters(char[] chars,
                       int start,
                       int length)
            throws org.xml.sax.SAXException
Signals the start of characters
Parameters:
chars - the character array containing the characters to receive
start - the index into the character array to start receiving characters at
length - the number of characters to recieve

comment

public void comment(String data)
Specified by:
comment in interface ResultHandler

endDocument

public void endDocument()
            throws org.xml.sax.SAXException
Signals the end of the document

endElement

public void endElement(String name)
            throws org.xml.sax.SAXException
Signals the start of element
Parameters:
name - the name of the element

entityReference

public void entityReference(String name)
Signals to recieve an entity reference with the given name
Specified by:
entityReference in interface ResultHandler
Parameters:
name - the name of the entity reference

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int start,
                                int length)
            throws org.xml.sax.SAXException
Signals the start of ignorable whitespace characters
Parameters:
chars - the character array containing the characters to receive
start - the index into the character array to start receiving characters at
length - the number of characters to recieve

processingInstruction

public void processingInstruction(String target,
                                  String data)
            throws org.xml.sax.SAXException
Signals to recieve a processing instruction
Parameters:
target - the target of the processing instruction
data - the content of the processing instruction

setDocumentLocator

public void setDocumentLocator(Locator locator)
Sets the document locator
Parameters:
locator - the Locator used by this DocumentHandler

setIndentSize

public void setIndentSize(short indentSize)
Sets the indent size for all formatters that perform serialization, in which indentation is applicable.
Specified by:
setIndentSize in interface ResultHandler
Parameters:
indentSize - the number of characters to indent

setOutputFormat

public void setOutputFormat(OutputFormat format)
Sets the output format information for Formatters that perform serialization.
Specified by:
setOutputFormat in interface ResultHandler
Parameters:
format - the OutputFormat used to specify properties during serialization

startDocument

public void startDocument()
            throws org.xml.sax.SAXException
Signals the start of a document

startElement

public void startElement(String name,
                         AttributeList atts)
            throws org.xml.sax.SAXException
Signals the start of element
Parameters:
name - the name of the element
atts - the AttributeList containing the associated attributes for the element

unescapedCharacters

public void unescapedCharacters(char[] chars,
                                int start,
                                int length)
Signals to receive characters which should not be escaped
Specified by:
unescapedCharacters in interface ResultHandler
Parameters:
chars - the character array containing the characters to receive
start - the index into the character array to start receiving characters at
length - the number of characters to recieve