Package org.exolab.adaptx.xslt.handlers
Class DefaultHandler
- java.lang.Object
-
- org.exolab.adaptx.xslt.handlers.DefaultHandler
-
- All Implemented Interfaces:
ResultHandler
,org.xml.sax.ContentHandler
,org.xml.sax.DocumentHandler
public class DefaultHandler extends java.lang.Object implements org.xml.sax.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 Summary
Constructors Constructor Description DefaultHandler(java.io.OutputStream out)
Creates a new DefaultHandlerDefaultHandler(java.io.OutputStream out, OutputFormat format)
Creates a new DefaultHandlerDefaultHandler(java.io.Writer out)
Creates a new DefaultHandlerDefaultHandler(java.io.Writer out, OutputFormat format)
Creates a new DefaultHandler
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cdata(char[] chars, int start, int length)
Signals to receive CDATA charactersvoid
characters(char[] chars, int start, int length)
Signals the start of charactersvoid
comment(java.lang.String data)
Signals to recieve a commentvoid
endDocument()
Signals the end of the documentvoid
endElement(java.lang.String name)
Signals the start of elementvoid
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
ContentHandler#endElementvoid
endPrefixMapping(java.lang.String prefix)
Signals to end the namespace prefix mappingvoid
entityReference(java.lang.String name)
Signals to recieve an entity reference with the given namevoid
ignorableWhitespace(char[] chars, int start, int length)
Signals the start of ignorable whitespace charactersvoid
processingInstruction(java.lang.String target, java.lang.String data)
Signals to recieve a processing instructionvoid
setDocumentLocator(org.xml.sax.Locator locator)
Sets the document locatorvoid
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
skippedEntity(java.lang.String name)
Signals that an entity was skipped by the parservoid
startDocument()
Signals the start of a documentvoid
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
ContentHandler#startElementvoid
startElement(java.lang.String name, org.xml.sax.AttributeList atts)
Signals the start of elementvoid
startPrefixMapping(java.lang.String prefix, java.lang.String uri)
Signals to start the namespace - prefix mappingvoid
unescapedCharacters(char[] chars, int start, int length)
Signals to receive characters which should not be escaped
-
-
-
Constructor Detail
-
DefaultHandler
public DefaultHandler(java.io.Writer out)
Creates a new DefaultHandler
-
DefaultHandler
public DefaultHandler(java.io.OutputStream out)
Creates a new DefaultHandler
-
DefaultHandler
public DefaultHandler(java.io.Writer out, OutputFormat format)
Creates a new DefaultHandler
-
DefaultHandler
public DefaultHandler(java.io.OutputStream out, OutputFormat format)
Creates a new DefaultHandler
-
-
Method Detail
-
cdata
public void cdata(char[] chars, int start, int length)
Signals to receive CDATA characters- Specified by:
cdata
in interfaceResultHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- 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- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Specified by:
characters
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
org.xml.sax.SAXException
-
comment
public void comment(java.lang.String data)
Description copied from interface:ResultHandler
Signals to recieve a comment- Specified by:
comment
in interfaceResultHandler
- Parameters:
data
- , the content of the comment
-
endDocument
public void endDocument() throws org.xml.sax.SAXException
Signals the end of the document- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
endDocument
in interfaceorg.xml.sax.DocumentHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
Signals the start of element- Specified by:
endElement
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
ContentHandler#endElement
Signals the end of an element- Specified by:
endElement
in interfaceorg.xml.sax.ContentHandler
- Parameters:
name
- the name of the element- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXException
Signals to end the namespace prefix mapping- Specified by:
endPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Parameters:
prefix
- the namespace prefix- Throws:
org.xml.sax.SAXException
-
entityReference
public void entityReference(java.lang.String name)
Signals to recieve an entity reference with the given name- Specified by:
entityReference
in interfaceResultHandler
- 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- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.ContentHandler
- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
Signals to recieve a processing instruction- Specified by:
processingInstruction
in interfaceorg.xml.sax.ContentHandler
- Specified by:
processingInstruction
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
target
- the target of the processing instructiondata
- the content of the processing instruction- Throws:
org.xml.sax.SAXException
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Sets the document locator- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.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 interfaceResultHandler
- 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 interfaceResultHandler
- Parameters:
format
- the OutputFormat used to specify properties during serialization
-
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
Signals that an entity was skipped by the parser- Specified by:
skippedEntity
in interfaceorg.xml.sax.ContentHandler
- Parameters:
name
- the skipped entity's name- Throws:
org.xml.sax.SAXException
-
startDocument
public void startDocument() throws org.xml.sax.SAXException
Signals the start of a document- Specified by:
startDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
startDocument
in interfaceorg.xml.sax.DocumentHandler
- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXException
Signals the start of element- Specified by:
startElement
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
ContentHandler#startElement
Signals the start of element- Specified by:
startElement
in interfaceorg.xml.sax.ContentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXException
Signals to start the namespace - prefix mapping- Specified by:
startPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Parameters:
prefix
- the namespace prefix to mapuri
- the namespace URI- Throws:
org.xml.sax.SAXException
-
unescapedCharacters
public void unescapedCharacters(char[] chars, int start, int length)
Signals to receive characters which should not be escaped- Specified by:
unescapedCharacters
in interfaceResultHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve
-
-