org.apache.cocoon.components.renderer
Class ExtendableRendererFactory

java.lang.Object
  extended by org.apache.cocoon.components.renderer.ExtendableRendererFactory
All Implemented Interfaces:
RendererFactory

public class ExtendableRendererFactory
extends Object
implements RendererFactory

An extendable FOP Renderer factory. When given a MIME type, find a Renderer which supports that MIME type. This factory is extendable as new Renderers can be added at runtime.

Version:
CVS $Id: ExtendableRendererFactory.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Davanum Srinivas

Field Summary
protected static Map renderers
           
protected static RendererFactory singleton
           
 
Method Summary
 void addRenderer(String mimeType, Class rendererClass)
          Add a mapping from the specified MIME type to a renderer.
 org.apache.fop.render.Renderer createRenderer(String mimeType)
          Create a renderer for a specified MIME type.
static RendererFactory getRendererFactoryImplementation()
          Get a reference to this Renderer Factory.
 void removeRenderer(String mimeType)
          Remove the mapping from a specified MIME type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

renderers

protected static final Map renderers

singleton

protected static final RendererFactory singleton
Method Detail

getRendererFactoryImplementation

public static final RendererFactory getRendererFactoryImplementation()
Get a reference to this Renderer Factory.


createRenderer

public org.apache.fop.render.Renderer createRenderer(String mimeType)
Create a renderer for a specified MIME type.

Specified by:
createRenderer in interface RendererFactory
Parameters:
mimeType - The MIME type of the destination format
Returns:
A suitable renderer, or null if one cannot be found

addRenderer

public void addRenderer(String mimeType,
                        Class rendererClass)
Add a mapping from the specified MIME type to a renderer. Note: The renderer must have a no-argument constructor.

Parameters:
mimeType - The MIME type of the Renderer
rendererClass - The Class object for the Renderer.

removeRenderer

public void removeRenderer(String mimeType)
Remove the mapping from a specified MIME type.

Parameters:
mimeType - The MIME type to remove from the mapping.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.