org.mmbase.streams.transcoders
Class AbstractTranscoder

java.lang.Object
  extended by org.mmbase.streams.transcoders.AbstractTranscoder
All Implemented Interfaces:
Serializable, Cloneable, Transcoder, PublicCloneable<Transcoder>
Direct Known Subclasses:
CommandTranscoder, InfiniteTranscoder, MockTranscoder

public abstract class AbstractTranscoder
extends Object
implements Transcoder

Base transcoder for others.

Version:
$Id: AbstractTranscoder.java 42277 2010-05-26 14:03:33Z andre $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected  boolean clone
           
protected  Codec codec
           
protected  Format format
           
protected  URI in
           
static Logger LOG
           
protected  MimeType mimeType
           
protected  URI out
           
static String PACKAGE
           
 
Constructor Summary
protected AbstractTranscoder()
           
 
Method Summary
 AbstractTranscoder clone()
           
 Codec getCodec()
           
 Format getFormat()
           
 URI getIn()
           
static Transcoder getInstance(String key)
           
 String getKey()
          Default and generic implementation of the key.
 MimeType getMimeType()
           
 URI getOut()
           
 void init(Node dest)
          Init the transcoder and destination node with appropiate values.
 void setCodec(String c)
           
 void setFormat(String f)
           
 void setMimeType(String m)
           
 String toString()
           
protected abstract  void transcode(Logger log)
           
 void transcode(URI in, URI out, Logger log)
          Transcode a file to another, follow the process with a logger.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PACKAGE

public static String PACKAGE

LOG

public static final Logger LOG

clone

protected boolean clone

in

protected URI in

out

protected URI out

format

protected Format format

codec

protected Codec codec

mimeType

protected MimeType mimeType
Constructor Detail

AbstractTranscoder

protected AbstractTranscoder()
Method Detail

getInstance

public static Transcoder getInstance(String key)
                              throws ClassNotFoundException,
                                     InstantiationException,
                                     IllegalAccessException,
                                     NoSuchMethodException,
                                     InvocationTargetException
Throws:
ClassNotFoundException
InstantiationException
IllegalAccessException
NoSuchMethodException
InvocationTargetException

init

public void init(Node dest)
Description copied from interface: Transcoder
Init the transcoder and destination node with appropiate values.

Specified by:
init in interface Transcoder
Parameters:
dest - stream destination Node

setFormat

public void setFormat(String f)

getFormat

public Format getFormat()
Specified by:
getFormat in interface Transcoder

setCodec

public void setCodec(String c)

getCodec

public Codec getCodec()
Specified by:
getCodec in interface Transcoder

getMimeType

public MimeType getMimeType()

setMimeType

public void setMimeType(String m)

getKey

public String getKey()
Default and generic implementation of the key. It can be parsed back to the same transcoder instance with getInstance(java.lang.String). This makes for a key which is, like the icaches 'ckey' key unique and parseable. The implementation depends on Settings annotations to be set on the classes.

Specified by:
getKey in interface Transcoder

transcode

public void transcode(URI in,
                      URI out,
                      Logger log)
               throws Exception
Description copied from interface: Transcoder
Transcode a file to another, follow the process with a logger.

Specified by:
transcode in interface Transcoder
Throws:
Exception

transcode

protected abstract void transcode(Logger log)
                           throws Exception
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object

getIn

public URI getIn()
Specified by:
getIn in interface Transcoder

getOut

public URI getOut()
Specified by:
getOut in interface Transcoder

clone

public AbstractTranscoder clone()
Specified by:
clone in interface PublicCloneable<Transcoder>
Overrides:
clone in class Object


MMBase 2.0-SNAPSHOT - null