Devsphere.com


com.devsphere.xml.taglib.output.builder
Class Handler

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.devsphere.xml.taglib.output.builder.Handler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class Handler
extends org.xml.sax.helpers.DefaultHandler

This class extends org.xml.sax.helpers.DefaultHandler to generate JSP code that outputs XML.

An instance of this class is created by a Main object.


Constructor Summary
Handler(Parameters params, Outputter out)
          Initializes the handler.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Generates JSP code that outputs some character data.
 void endDocument()
          Generates JSP code that ends the XML producing.
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName)
          Generates JSP code that outputs an end tag.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Generates JSP code that outputs a processing instruction.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Does nothing.
 void startDocument()
          Generates the JSP header and JSP code that outputs an XML header.
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes attributes)
          Generates JSP code that outputs a start tag.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Handler

public Handler(Parameters params,
               Outputter out)
Initializes the handler.

Parameters:
params - the command line parameters
out - the object used to output the generated code
Method Detail

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Does nothing.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler
Parameters:
locator - the SAX Locator object

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Generates the JSP header and JSP code that outputs an XML header.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - to signal any error that might occur

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Generates JSP code that ends the XML producing.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - to signal any error that might occur

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qualifiedName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Generates JSP code that outputs a start tag.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
namespaceURI - the element's namespace URI
localName - the element's local name
qualifiedName - the element's qualified name
attributes - the element's attributes
Throws:
org.xml.sax.SAXException - to signal any error that might occur

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qualifiedName)
                throws org.xml.sax.SAXException
Generates JSP code that outputs an end tag.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
namespaceURI - the element's namespace URI
localName - the element's local name
qualifiedName - the element's qualified name
Throws:
org.xml.sax.SAXException - to signal any error that might occur

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Generates JSP code that outputs some character data.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Parameters:
ch - the characters from the XML document
start - the start position in the array
length - the number of characters to get from the array
Throws:
org.xml.sax.SAXException - to signal any error that might occur

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Generates JSP code that outputs a processing instruction.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class org.xml.sax.helpers.DefaultHandler
Parameters:
target - the target of the processing instruction.
data - the data of the processing instruction.
Throws:
org.xml.sax.SAXException - to signal any error that might occur

 Devsphere.com