info.informatica.report
Interface ForeignNamespaceHandler

All Superinterfaces:
ContentHandler, LexicalHandler
All Known Implementing Classes:
IdentityNamespaceHandler, XHTMLNamespaceHandler

public interface ForeignNamespaceHandler
extends ContentHandler, LexicalHandler

A foreign handler is a content handler that is responsible for receiving the SAX events for non-report elements, and build the appropriate document structures for future rendering.

Author:
Carlos Amengual (amengual at informatica.info)

Method Summary
 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.
 
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
 
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity
 

Method Detail

registerReportHandler

void registerReportHandler(ReportScopeHandler carteHandler)
Registers a ReportScopeHandler to receive callbacks (events) from this ForeignNamespaceHandler.

Parameters:
carteHandler - the handler

setTargetDocumentDeclaration

void setTargetDocumentDeclaration(String dtdDecl)
                                  throws info.informatica.doc.DocumentFormatException
Sets the document type declaration of the target document format.

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

Parameters:
dtdDecl - the document type declaration.
Throws:
info.informatica.doc.DocumentFormatException - if the document type is not supported.

flush

void flush()
           throws SAXException
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.

Throws:
SAXException - if any problem is found when flushing.

isInsideForeignElement

boolean isInsideForeignElement()
The parsing is considered to be inside a foreign element when it is not inside a Report element.

Returns:
true or false depending on the current handler state.