org.databene.commons.converter
Class ConverterChain<S,T>

java.lang.Object
  extended by org.databene.commons.converter.MultiConverterWrapper
      extended by org.databene.commons.converter.ConverterChain<S,T>
All Implemented Interfaces:
Converter<S,T>, ThreadAware
Direct Known Subclasses:
DateString2DurationConverter

public class ConverterChain<S,T>
extends MultiConverterWrapper
implements Converter<S,T>

Aggregates other (sub) converters and implements conversion by subsequent invocation of the sub generators, each converting the result of the preceding converter.

Created: 13.05.2005 17:43:04

Since:
0.1
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.commons.converter.MultiConverterWrapper
components
 
Constructor Summary
ConverterChain(Converter... components)
           
 
Method Summary
 T convert(java.lang.Object source)
          Concerts an object of type S to an object of type T
 java.lang.Class<S> getSourceType()
           
 java.lang.Class<T> getTargetType()
           
 
Methods inherited from class org.databene.commons.converter.MultiConverterWrapper
addComponent, clone, getComponents, isParallelizable, isThreadSafe, setComponents
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.databene.commons.ThreadAware
isParallelizable, isThreadSafe
 

Constructor Detail

ConverterChain

public ConverterChain(Converter... components)
Method Detail

getSourceType

public java.lang.Class<S> getSourceType()
Specified by:
getSourceType in interface Converter<S,T>

getTargetType

public java.lang.Class<T> getTargetType()
Specified by:
getTargetType in interface Converter<S,T>

convert

public T convert(java.lang.Object source)
          throws ConversionException
Description copied from interface: Converter
Concerts an object of type S to an object of type T

Specified by:
convert in interface Converter<S,T>
Parameters:
source - the object to convert
Returns:
the converted object
Throws:
ConversionException - if the conversion fails


Copyright © 2010. All Rights Reserved.