info.informatica.report.handler
Class XHTMLNamespaceHandler

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

public class XHTMLNamespaceHandler
extends DefaultHandler2
implements ForeignNamespaceHandler

Document handler for XHTML tags.

Author:
Carlos Amengual (amengual at informatica.info)

Constructor Summary
XHTMLNamespaceHandler(Report report)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
           
 void endElement(String uri, String localName, String qName)
           
 void flush()
          Flushes the handler.
 boolean isInsideForeignElement()
          The parsing is considered to be inside a foreign element when it is not inside a Report element.
 void registerReportHandler(ReportScopeHandler carteHandler)
          Registers a ReportScopeHandler to receive callbacks (events) from this ForeignNamespaceHandler.
 void setTargetDocumentDeclaration(String dtdDecl)
          Sets the document type declaration of the target document format.
 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, comment, elementDecl, endCDATA, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startCDATA, startDTD, startEntity
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 

Constructor Detail

XHTMLNamespaceHandler

public XHTMLNamespaceHandler(Report report)
Method Detail

registerReportHandler

public void registerReportHandler(ReportScopeHandler carteHandler)
Description copied from interface: ForeignNamespaceHandler
Registers a ReportScopeHandler to receive callbacks (events) from this ForeignNamespaceHandler.

Specified by:
registerReportHandler in interface ForeignNamespaceHandler
Parameters:
carteHandler - the handler

setTargetDocumentDeclaration

public void setTargetDocumentDeclaration(String dtdDecl)
                                  throws info.informatica.doc.DocumentFormatException
Description copied from interface: ForeignNamespaceHandler
Sets the document type declaration of the target document format.

Intended only for reports that have an XML format as destination.

Specified by:
setTargetDocumentDeclaration in interface ForeignNamespaceHandler
Parameters:
dtdDecl - the document type declaration.
Throws:
info.informatica.doc.DocumentFormatException - if the document type is not supported.

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
                        throws SAXException
Specified by:
startPrefixMapping in interface ContentHandler
Overrides:
startPrefixMapping 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

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

endDocument

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

flush

public void flush()
           throws SAXException
Description copied from interface: ForeignNamespaceHandler
Flushes the handler.

Handlers are required to merge as much templates as possible, to optimize the report. Small templates should be merged to form a larger one, and this merged template must be committed when this method is called. This is typically done when the end of the document, or a new report tag, is found.

When the handler is flushed, it should commit any pending work.

Specified by:
flush in interface ForeignNamespaceHandler
Throws:
SAXException - if any problem is found when flushing.

isInsideForeignElement

public boolean isInsideForeignElement()
Description copied from interface: ForeignNamespaceHandler
The parsing is considered to be inside a foreign element when it is not inside a Report element.

Specified by:
isInsideForeignElement in interface ForeignNamespaceHandler
Returns:
true or false depending on the current handler state.