info.informatica.report
Class ReportDocumentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.xml.sax.ext.DefaultHandler2
          extended by info.informatica.report.ReportDocumentHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler, EntityResolver2, LexicalHandler

public class ReportDocumentHandler
extends DefaultHandler2

Handles the input from a SAX parser, to obtain the skeleton of the report.

Format tags

template

document-properties

document-writer

target-document-declaration

pageheader

dataspec

img

param

row-template

table

Many times, document properties will be specified programmatically, so they take precedence over block attributes.

As the document properties essentially contain meta-information, conflicts will exist rarely.

Author:
amengual at informatica dot info

Nested Class Summary
 class ReportDocumentHandler.CarteHandler
           
 
Field Summary
static String CARTE_FORMAT_VERSION
           
static String CARTE_NAMESPACE_URI
           
static String XHTML_NAMESPACE_URI
           
 
Constructor Summary
ReportDocumentHandler(Report doc)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void comment(char[] ch, int start, int length)
           
 void endCDATA()
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void endPrefixMapping(String prefix)
           
 Parser getCSSParser()
           
 Namespace getDom4jCarteNS()
           
 void ignorableWhitespace(char[] ch, int start, int length)
           
 boolean isParsingActive()
           
static void main(String[] args)
           
static ReportDocumentHandler parseXML(InputSource is, Report rep)
           
 void processingInstruction(String target, String data)
           
 void skippedEntity(String name)
           
 void startCDATA()
           
 void startDocument()
           
 void startDTD(String name, String publicId, String systemId)
           
 void startElement(String uri, String localName, String qName, Attributes attributes)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class org.xml.sax.ext.DefaultHandler2
attributeDecl, elementDecl, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startEntity
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, notationDecl, setDocumentLocator, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CARTE_FORMAT_VERSION

public static final String CARTE_FORMAT_VERSION
See Also:
Constant Field Values

CARTE_NAMESPACE_URI

public static final String CARTE_NAMESPACE_URI
See Also:
Constant Field Values

XHTML_NAMESPACE_URI

public static final String XHTML_NAMESPACE_URI
See Also:
Constant Field Values
Constructor Detail

ReportDocumentHandler

public ReportDocumentHandler(Report doc)
Method Detail

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
              throws SAXException
Specified by:
startDTD in interface LexicalHandler
Overrides:
startDTD in class DefaultHandler2
Throws:
SAXException

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping in class DefaultHandler
Throws:
SAXException

getDom4jCarteNS

public Namespace getDom4jCarteNS()

endPrefixMapping

public void endPrefixMapping(String prefix)
                      throws SAXException
Specified by:
endPrefixMapping in interface ContentHandler
Overrides:
endPrefixMapping in class DefaultHandler
Throws:
SAXException

skippedEntity

public void skippedEntity(String name)
                   throws SAXException
Specified by:
skippedEntity in interface ContentHandler
Overrides:
skippedEntity in class DefaultHandler
Throws:
SAXException

processingInstruction

public void processingInstruction(String target,
                                  String data)
                           throws SAXException
Specified by:
processingInstruction in interface ContentHandler
Overrides:
processingInstruction in class DefaultHandler
Throws:
SAXException

startDocument

public void startDocument()
                   throws SAXException
Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Throws:
SAXException

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Throws:
SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws SAXException
Specified by:
ignorableWhitespace in interface ContentHandler
Overrides:
ignorableWhitespace in class DefaultHandler
Throws:
SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Throws:
SAXException

startCDATA

public void startCDATA()
                throws SAXException
Specified by:
startCDATA in interface LexicalHandler
Overrides:
startCDATA in class DefaultHandler2
Throws:
SAXException

endCDATA

public void endCDATA()
              throws SAXException
Specified by:
endCDATA in interface LexicalHandler
Overrides:
endCDATA in class DefaultHandler2
Throws:
SAXException

endDocument

public void endDocument()
                 throws SAXException
Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Specified by:
comment in interface LexicalHandler
Overrides:
comment in class DefaultHandler2
Throws:
SAXException

getCSSParser

public Parser getCSSParser()

isParsingActive

public final boolean isParsingActive()

parseXML

public static ReportDocumentHandler parseXML(InputSource is,
                                             Report rep)
                                      throws SAXException,
                                             ParserConfigurationException,
                                             IOException
Throws:
SAXException
ParserConfigurationException
IOException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception