org.apache.fop.fo

Class FOTreeBuilder


public class FOTreeBuilder
extends DefaultHandler

SAX Handler that passes parsed data to the various FO objects, where they can be used either to build an FO Tree, or used by Structure Renderers to build other data structures.

Field Summary

protected ContentHandler
delegate
Current delegate ContentHandler to receive the SAX events
protected ElementMappingRegistry
elementMappingRegistry
The registry for ElementMapping instances
protected Log
log
logging instance
protected org.apache.fop.fo.FOTreeBuilder.MainFOHandler
mainFOHandler
Main DefaultHandler that handles the FO namespace.
protected Root
rootFObj
The root of the formatting object tree

Constructor Summary

FOTreeBuilder(String outputFormat, FOUserAgent foUserAgent, OutputStream stream)
FOTreeBuilder constructor

Method Summary

void
characters(char[] data, int start, int length)
void
endDocument()
void
endElement(String uri, String localName, String rawName)
void
error(SAXParseException e)
void
fatalError(SAXParseException e)
protected Locator
getEffectiveLocator()
FOEventHandler
getEventHandler()
Provides access to the underlying FOEventHandler object.
FormattingResults
getResults()
Returns the results of the rendering process.
void
setDocumentLocator(Locator locator)
void
startDocument()
void
startElement(String namespaceURI, String localName, String rawName, Attributes attlist)
void
warning(SAXParseException e)

Field Details

delegate

protected ContentHandler delegate
Current delegate ContentHandler to receive the SAX events

elementMappingRegistry

protected ElementMappingRegistry elementMappingRegistry
The registry for ElementMapping instances

log

protected Log log
logging instance

mainFOHandler

protected org.apache.fop.fo.FOTreeBuilder.MainFOHandler mainFOHandler
Main DefaultHandler that handles the FO namespace.

rootFObj

protected Root rootFObj
The root of the formatting object tree

Constructor Details

FOTreeBuilder

public FOTreeBuilder(String outputFormat,
                     FOUserAgent foUserAgent,
                     OutputStream stream)
            throws FOPException
FOTreeBuilder constructor
Parameters:
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
foUserAgent - the FOUserAgent in effect for this process
stream - the OutputStream to direct the results to
Throws:
FOPException - if the FOTreeBuilder cannot be properly created

Method Details

characters

public void characters(char[] data,
                       int start,
                       int length)
            throws SAXException

endDocument

public void endDocument()
            throws SAXException

endElement

public void endElement(String uri,
                       String localName,
                       String rawName)
            throws SAXException

error

public void error(SAXParseException e)

fatalError

public void fatalError(SAXParseException e)
            throws SAXException

getEffectiveLocator

protected Locator getEffectiveLocator()
Returns:
a Locator instance if it is available and not disabled

getEventHandler

public FOEventHandler getEventHandler()
Provides access to the underlying FOEventHandler object.
Returns:
the FOEventHandler object

getResults

public FormattingResults getResults()
Returns the results of the rendering process. Information includes the total number of pages generated and the number of pages per page-sequence.
Returns:
the results of the rendering process.

setDocumentLocator

public void setDocumentLocator(Locator locator)

startDocument

public void startDocument()
            throws SAXException

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String rawName,
                         Attributes attlist)
            throws SAXException

warning

public void warning(SAXParseException e)

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.