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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classMainDefaultHandlerimplementation which builds the FO tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FOTreeBuilderContextProvides information used during tree building stage.protected ContentHandlerCurrent delegate ContentHandler to receive the SAX eventsprivate intprotected ElementMappingRegistryThe registry for ElementMapping instancesprivate booleanprivate booleanprivate FOEventHandlerThe object that handles formatting and rendering to a streamprivate LocatorThe SAX locator object managing the line and column countersprivate static final org.apache.commons.logging.Loglogging instanceprotected FOTreeBuilder.MainFOHandlerMain DefaultHandler that handles the FO namespace.protected RootThe root of the formatting object treeprivate booleanprivate FOUserAgentThe user agent for this processing run. -
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 DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOGlogging instance -
elementMappingRegistry
The registry for ElementMapping instances -
rootFObj
The root of the formatting object tree -
mainFOHandler
Main DefaultHandler that handles the FO namespace. -
delegate
Current delegate ContentHandler to receive the SAX events -
builderContext
Provides information used during tree building stage. -
foEventHandler
The object that handles formatting and rendering to a stream -
locator
The SAX locator object managing the line and column counters -
userAgent
The user agent for this processing run. -
used
private boolean used -
empty
private boolean empty -
depth
private int depth -
errorinstart
private boolean errorinstart
-
-
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
-
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.
-