org.apache.cocoon.components.transcoder
Class ExtendableTranscoderFactory

java.lang.Object
  extended byorg.apache.cocoon.components.transcoder.ExtendableTranscoderFactory
All Implemented Interfaces:
TranscoderFactory

public class ExtendableTranscoderFactory
extends Object
implements TranscoderFactory

An extendable Batik Transcoder factory. When given a MIME type, find a Transcoder which supports that MIME type. This factory is extendable as new Transcoders can be added at runtime.

Version:
$Id: ExtendableTranscoderFactory.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
protected static TranscoderFactory singleton
           
protected static Map transcoders
           
 
Method Summary
 void addTranscoder(String mimeType, Class transcoderClass)
          Add a mapping from the specified MIME type to a transcoder.
 org.apache.batik.transcoder.Transcoder createTranscoder(String mimeType)
          Create a transcoder for a specified MIME type.
static TranscoderFactory getTranscoderFactoryImplementation()
          Get a reference to this Transcoder Factory.
 void removeTranscoder(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

transcoders

protected static final Map transcoders

singleton

protected static final TranscoderFactory singleton
Method Detail

getTranscoderFactoryImplementation

public static final TranscoderFactory getTranscoderFactoryImplementation()
Get a reference to this Transcoder Factory.


createTranscoder

public org.apache.batik.transcoder.Transcoder createTranscoder(String mimeType)
Create a transcoder for a specified MIME type.

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

addTranscoder

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

Parameters:
mimeType - The MIME type of the Transcoder
transcoderClass - The Class object for the Transcoder.

removeTranscoder

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

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


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