org.apache.fop.fo
Class FOTreeBuilder
DefaultHandler
org.apache.fop.fo.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.
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
FOTreeBuilder
public FOTreeBuilder(String outputFormat,
FOUserAgent foUserAgent,
OutputStream stream)
throws FOPException
FOTreeBuilder constructor
outputFormat
- the MIME type of the output format to use (ex. "application/pdf").foUserAgent
- in effect for this processstream
- OutputStream to direct results
FOPException
- if the FOTreeBuilder cannot be properly created
characters
public void characters(char[] data,
int start,
int length)
throws SAXException
SAX Handler for characters
org.xml.sax.ContentHandler.characters(char[], int, int)
endDocument
public void endDocument()
throws SAXException
SAX Handler for the end of the document
org.xml.sax.ContentHandler.endDocument()
endElement
public void endElement(String uri,
String localName,
String rawName)
throws SAXException
SAX Handler for the end of an element
org.xml.sax.ContentHandler.endElement(String, String, String)
error
public void error(SAXParseException e)
org.xml.sax.ErrorHandler.error(org.xml.sax.SAXParseException)
fatalError
public void fatalError(SAXParseException e)
throws SAXException
org.xml.sax.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
getEffectiveLocator
protected Locator getEffectiveLocator()
- a Locator instance if it is available and not disabled
getEventHandler
public FOEventHandler getEventHandler()
Provides access to the underlying FOEventHandler object.
- 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.
- the results of the rendering process.
isLocatorDisabled
protected boolean isLocatorDisabled()
Use FOUserAgent.isLocatorEnabled() instead.
This method enables to reduce memory consumption of the FO tree slightly. When it returns
true no Locator is passed to the FO tree nodes which would copy the information into
a SAX LocatorImpl instance.
- true if no context information should be stored on each node in the FO tree.
setDocumentLocator
public void setDocumentLocator(Locator locator)
SAX Handler for locator
org.xml.sax.ContentHandler.setDocumentLocator(Locator)
startDocument
public void startDocument()
throws SAXException
SAX Handler for the start of the document
org.xml.sax.ContentHandler.startDocument()
startElement
public void startElement(String namespaceURI,
String localName,
String rawName,
Attributes attlist)
throws SAXException
SAX Handler for the start of an element
org.xml.sax.ContentHandler.startElement(String, String, String, Attributes)
warning
public void warning(SAXParseException e)
org.xml.sax.ErrorHandler.warning(org.xml.sax.SAXParseException)
Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.