Package org.apache.fop.fo
Class FOTreeBuilder
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.apache.fop.fo.FOTreeBuilder
-
- All Implemented Interfaces:
org.xml.sax.ContentHandler,org.xml.sax.DTDHandler,org.xml.sax.EntityResolver,org.xml.sax.ErrorHandler
public class FOTreeBuilder extends org.xml.sax.helpers.DefaultHandlerSAX 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
Fields Modifier and Type Field Description protected org.xml.sax.ContentHandlerdelegateCurrent delegate ContentHandler to receive the SAX eventsprotected ElementMappingRegistryelementMappingRegistryThe registry for ElementMapping instancesprotected org.apache.fop.fo.FOTreeBuilder.MainFOHandlermainFOHandlerMain DefaultHandler that handles the FO namespace.protected RootrootFObjThe root of the formatting object tree
-
Constructor Summary
Constructors Constructor Description FOTreeBuilder(java.lang.String outputFormat, FOUserAgent foUserAgent, java.io.OutputStream stream)FOTreeBuilderconstructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] data, int start, int length)voidendDocument()voidendElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName)voiderror(org.xml.sax.SAXParseException e)voidfatalError(org.xml.sax.SAXParseException e)protected org.xml.sax.LocatorgetEffectiveLocator()FOEventHandlergetEventHandler()Provides access to the underlyingFOEventHandlerobject.FormattingResultsgetResults()Returns the results of the rendering process.voidsetDocumentLocator(org.xml.sax.Locator locator)voidstartDocument()voidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attlist)voidwarning(org.xml.sax.SAXParseException e)
-
-
-
Field Detail
-
elementMappingRegistry
protected ElementMappingRegistry elementMappingRegistry
The registry for ElementMapping instances
-
rootFObj
protected Root rootFObj
The root of the formatting object tree
-
mainFOHandler
protected org.apache.fop.fo.FOTreeBuilder.MainFOHandler mainFOHandler
Main DefaultHandler that handles the FO namespace.
-
delegate
protected org.xml.sax.ContentHandler delegate
Current delegate ContentHandler to receive the SAX events
-
-
Constructor Detail
-
FOTreeBuilder
public FOTreeBuilder(java.lang.String outputFormat, FOUserAgent foUserAgent, java.io.OutputStream stream) throws FOPExceptionFOTreeBuilderconstructor- 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 Detail
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.ContentHandler- Overrides:
setDocumentLocatorin classorg.xml.sax.helpers.DefaultHandler
-
getEffectiveLocator
protected org.xml.sax.Locator getEffectiveLocator()
- Returns:
- a
Locatorinstance if it is available and not disabled
-
characters
public void characters(char[] data, int start, int length) throws org.xml.sax.SAXException- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Overrides:
charactersin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
startDocument
public void startDocument() throws org.xml.sax.SAXException- Specified by:
startDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
startDocumentin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Overrides:
endDocumentin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String rawName, org.xml.sax.Attributes attlist) throws org.xml.sax.SAXException- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Overrides:
startElementin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String rawName) throws org.xml.sax.SAXException- Specified by:
endElementin interfaceorg.xml.sax.ContentHandler- Overrides:
endElementin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
warning
public void warning(org.xml.sax.SAXParseException e)
- Specified by:
warningin interfaceorg.xml.sax.ErrorHandler- Overrides:
warningin classorg.xml.sax.helpers.DefaultHandler
-
error
public void error(org.xml.sax.SAXParseException e)
- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Overrides:
errorin classorg.xml.sax.helpers.DefaultHandler
-
fatalError
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXException- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Overrides:
fatalErrorin classorg.xml.sax.helpers.DefaultHandler- Throws:
org.xml.sax.SAXException
-
getEventHandler
public FOEventHandler getEventHandler()
Provides access to the underlyingFOEventHandlerobject.- 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.
-
-