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
FieldsModifier and TypeFieldDescriptionprotected ContentHandlerCurrent delegate ContentHandler to receive the SAX eventsprotected ElementMappingRegistryThe registry for ElementMapping instancesprotected org.apache.fop.fo.FOTreeBuilder.MainFOHandlerMain DefaultHandler that handles the FO namespace.protected RootThe root of the formatting object tree -
Constructor Summary
ConstructorsConstructorDescriptionFOTreeBuilder(String outputFormat, FOUserAgent foUserAgent, OutputStream stream) FOTreeBuilderconstructor -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] data, int start, int length) voidvoidendElement(String uri, String localName, String rawName) voidvoidprotected LocatorProvides access to the underlyingFOEventHandlerobject.Returns the results of the rendering process.voidsetDocumentLocator(Locator locator) voidvoidstartElement(String namespaceURI, String localName, String rawName, Attributes attlist) voidMethods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDeclMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 FOTreeBuilderconstructor- Parameters:
outputFormat- the MIME type of the output format to use (ex. "application/pdf").foUserAgent- theFOUserAgentin effect for this processstream- theOutputStreamto direct the results to- Throws:
FOPException- if theFOTreeBuildercannot be properly created
-
-
Method Details
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classDefaultHandler
-
getEffectiveLocator
- Returns:
- a
Locatorinstance if it is available and not disabled
-
characters
- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler- Throws:
SAXException
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classDefaultHandler- Throws:
SAXException
-
endDocument
- Specified by:
endDocumentin interfaceContentHandler- Overrides:
endDocumentin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String rawName, Attributes attlist) throws SAXException - Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
warning
- Specified by:
warningin interfaceErrorHandler- Overrides:
warningin classDefaultHandler
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
getEventHandler
Provides access to the underlyingFOEventHandlerobject.- 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.
-