org.apache.fop.render

Class RendererFactory


public class RendererFactory
extends java.lang.Object

Factory for FOEventHandlers and Renderers.

Constructor Summary

RendererFactory()
Main constructor.

Method Summary

void
addFOEventHandlerMaker(String className)
Add a new FOEventHandlerMaker.
void
addFOEventHandlerMaker(AbstractFOEventHandlerMaker maker)
Add a new FOEventHandlerMaker.
void
addRendererMaker(String className)
Add a new RendererMaker.
void
addRendererMaker(AbstractRendererMaker maker)
Add a new RendererMaker.
FOEventHandler
createFOEventHandler(FOUserAgent userAgent, String outputFormat, OutputStream out)
Creates FOEventHandler instances based on the desired output.
Renderer
createRenderer(FOUserAgent userAgent, String outputFormat)
Creates a Renderer object based on render-type desired
AbstractFOEventHandlerMaker
getFOEventHandlerMaker(String mime)
Returns a FOEventHandlerMaker which handles the given MIME type.
AbstractRendererMaker
getRendererMaker(String mime)
Returns a RendererMaker which handles the given MIME type.
String[]
listSupportedMimeTypes()

Constructor Details

RendererFactory

public RendererFactory()
Main constructor.

Method Details

addFOEventHandlerMaker

public void addFOEventHandlerMaker(String className)
Add a new FOEventHandlerMaker. If another maker has already been registered for a particular MIME type, this call overwrites the existing one.
Parameters:
className - the fully qualified class name of the FOEventHandlerMaker

addFOEventHandlerMaker

public void addFOEventHandlerMaker(AbstractFOEventHandlerMaker maker)
Add a new FOEventHandlerMaker. If another maker has already been registered for a particular MIME type, this call overwrites the existing one.
Parameters:
maker - the FOEventHandlerMaker

addRendererMaker

public void addRendererMaker(String className)
Add a new RendererMaker. If another maker has already been registered for a particular MIME type, this call overwrites the existing one.
Parameters:
className - the fully qualified class name of the RendererMaker

addRendererMaker

public void addRendererMaker(AbstractRendererMaker maker)
Add a new RendererMaker. If another maker has already been registered for a particular MIME type, this call overwrites the existing one.
Parameters:
maker - the RendererMaker

createFOEventHandler

public FOEventHandler createFOEventHandler(FOUserAgent userAgent,
                                           String outputFormat,
                                           OutputStream out)
            throws FOPException
Creates FOEventHandler instances based on the desired output.
Parameters:
userAgent - the user agent for access to configuration
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
out - the OutputStream where the output is written to (if applicable)
Returns:
the newly constructed FOEventHandler
Throws:
FOPException - if the FOEventHandler cannot be properly constructed

createRenderer

public Renderer createRenderer(FOUserAgent userAgent,
                               String outputFormat)
            throws FOPException
Creates a Renderer object based on render-type desired
Parameters:
userAgent - the user agent for access to configuration
outputFormat - the MIME type of the output format to use (ex. "application/pdf").
Returns:
the new Renderer instance
Throws:
FOPException - if the renderer cannot be properly constructed

getFOEventHandlerMaker

public AbstractFOEventHandlerMaker getFOEventHandlerMaker(String mime)
Returns a FOEventHandlerMaker which handles the given MIME type.
Parameters:
mime - the requested output format
Returns:
the requested FOEventHandlerMaker or null if none is available

getRendererMaker

public AbstractRendererMaker getRendererMaker(String mime)
Returns a RendererMaker which handles the given MIME type.
Parameters:
mime - the requested output format
Returns:
the requested RendererMaker or null if none is available

listSupportedMimeTypes

public String[] listSupportedMimeTypes()
Returns:
an array of all supported MIME types

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.