Class DefaultHandler

java.lang.Object
org.exolab.adaptx.xslt.handlers.DefaultHandler
All Implemented Interfaces:
ResultHandler, ContentHandler, DocumentHandler

public class DefaultHandler extends Object implements ContentHandler, ResultHandler
The default implementation of ResultHandler. It uses the Apache Serializer classes written by my friend and colleague Assaf Arkin.
Version:
$Revision: 4774 $ $Date: 2004-09-28 21:28:19 +0200 (Tue, 28 Sep 2004) $
Author:
Keith Visco
  • Constructor Details

    • DefaultHandler

      public DefaultHandler(Writer out)
      Creates a new DefaultHandler
    • DefaultHandler

      public DefaultHandler(OutputStream out)
      Creates a new DefaultHandler
    • DefaultHandler

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

      public DefaultHandler(OutputStream 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 SAXException
      Signals the start of characters
      Specified by:
      characters in interface ContentHandler
      Specified by:
      characters in interface DocumentHandler
      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
      Throws:
      SAXException
    • comment

      public void comment(String data)
      Description copied from interface: ResultHandler
      Signals to recieve a comment
      Specified by:
      comment in interface ResultHandler
      Parameters:
      data - , the content of the comment
    • endDocument

      public void endDocument() throws SAXException
      Signals the end of the document
      Specified by:
      endDocument in interface ContentHandler
      Specified by:
      endDocument in interface DocumentHandler
      Throws:
      SAXException
    • endElement

      public void endElement(String name) throws SAXException
      Signals the start of element
      Specified by:
      endElement in interface DocumentHandler
      Parameters:
      name - the name of the element
      atts - the AttributeList containing the associated attributes for the element
      Throws:
      SAXException
    • endElement

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

      ContentHandler#endElement

      Signals the end of an element
      Specified by:
      endElement in interface ContentHandler
      Parameters:
      name - the name of the element
      Throws:
      SAXException
    • endPrefixMapping

      public void endPrefixMapping(String prefix) throws SAXException
      Signals to end the namespace prefix mapping
      Specified by:
      endPrefixMapping in interface ContentHandler
      Parameters:
      prefix - the namespace prefix
      Throws:
      SAXException
    • 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 SAXException
      Signals the start of ignorable whitespace characters
      Specified by:
      ignorableWhitespace in interface ContentHandler
      Specified by:
      ignorableWhitespace in interface DocumentHandler
      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
      Throws:
      SAXException
    • processingInstruction

      public void processingInstruction(String target, String data) throws SAXException
      Signals to recieve a processing instruction
      Specified by:
      processingInstruction in interface ContentHandler
      Specified by:
      processingInstruction in interface DocumentHandler
      Parameters:
      target - the target of the processing instruction
      data - the content of the processing instruction
      Throws:
      SAXException
    • setDocumentLocator

      public void setDocumentLocator(Locator locator)
      Sets the document locator
      Specified by:
      setDocumentLocator in interface ContentHandler
      Specified by:
      setDocumentLocator in interface DocumentHandler
      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
    • skippedEntity

      public void skippedEntity(String name) throws SAXException
      Signals that an entity was skipped by the parser
      Specified by:
      skippedEntity in interface ContentHandler
      Parameters:
      name - the skipped entity's name
      Throws:
      SAXException
    • startDocument

      public void startDocument() throws SAXException
      Signals the start of a document
      Specified by:
      startDocument in interface ContentHandler
      Specified by:
      startDocument in interface DocumentHandler
      Throws:
      SAXException
    • startElement

      public void startElement(String name, AttributeList atts) throws SAXException
      Signals the start of element
      Specified by:
      startElement in interface DocumentHandler
      Parameters:
      name - the name of the element
      atts - the AttributeList containing the associated attributes for the element
      Throws:
      SAXException
    • startElement

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

      ContentHandler#startElement

      Signals the start of element
      Specified by:
      startElement in interface ContentHandler
      Parameters:
      name - the name of the element
      atts - the AttributeList containing the associated attributes for the element
      Throws:
      SAXException
    • startPrefixMapping

      public void startPrefixMapping(String prefix, String uri) throws SAXException
      Signals to start the namespace - prefix mapping
      Specified by:
      startPrefixMapping in interface ContentHandler
      Parameters:
      prefix - the namespace prefix to map
      uri - the namespace URI
      Throws:
      SAXException
    • 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