Package org.apache.fop.fo
Class FOTreeBuilder
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.fop.fo.FOTreeBuilder
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
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
Modifier and TypeFieldDescriptionprotected ContentHandler
Current delegate ContentHandler to receive the SAX eventsprotected ElementMappingRegistry
The registry for ElementMapping instancesprotected org.apache.fop.fo.FOTreeBuilder.MainFOHandler
Main DefaultHandler that handles the FO namespace.protected Root
The root of the formatting object tree -
Constructor Summary
ConstructorDescriptionFOTreeBuilder
(String outputFormat, FOUserAgent foUserAgent, OutputStream stream) FOTreeBuilder
constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] data, int start, int length) void
void
endElement
(String uri, String localName, String rawName) void
void
protected Locator
Provides access to the underlyingFOEventHandler
object.Returns the results of the rendering process.void
setDocumentLocator
(Locator locator) void
void
startElement
(String namespaceURI, String localName, String rawName, Attributes attlist) void
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
elementMappingRegistry
The registry for ElementMapping instances -
rootFObj
The root of the formatting object tree -
mainFOHandler
protected org.apache.fop.fo.FOTreeBuilder.MainFOHandler mainFOHandlerMain DefaultHandler that handles the FO namespace. -
delegate
Current delegate ContentHandler to receive the SAX events
-
-
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
- theFOUserAgent
in effect for this processstream
- theOutputStream
to direct the results to- Throws:
FOPException
- if theFOTreeBuilder
cannot be properly created
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
-
getEffectiveLocator
- Returns:
- a
Locator
instance if it is available and not disabled
-
characters
- Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
- Throws:
SAXException
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classDefaultHandler
- Throws:
SAXException
-
endDocument
- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String rawName, Attributes attlist) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Overrides:
warning
in classDefaultHandler
-
error
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
getEventHandler
Provides access to the underlyingFOEventHandler
object.- Returns:
- the FOEventHandler object
-
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.
-