|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.convert.Converters.PassThruConverter<S,T>
protected static class Converters.PassThruConverter<S,T>
Pass-through converter used when the source and target java object
types are the same. The convert method returns the
source object.
| Constructor Summary | |
|---|---|
Converters.PassThruConverter(Class<S> sourceClass,
Class<T> targetClass)
|
|
| Method Summary | |
|---|---|
boolean |
canConvert(Class<?> sourceClass,
Class<?> targetClass)
Returns true if this object can convert
sourceClass to targetClass. |
T |
convert(S obj)
Converts obj to T. |
Class<?> |
getSourceClass()
Returns the source Class for this converter. |
Class<?> |
getTargetClass()
Returns the target Class for this converter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Converters.PassThruConverter(Class<S> sourceClass,
Class<T> targetClass)
| Method Detail |
|---|
public boolean canConvert(Class<?> sourceClass,
Class<?> targetClass)
Convertertrue if this object can convert
sourceClass to targetClass.
Implementations can accomodate class hierarchy ranges by converting super classes or interfaces.
canConvert in interface Converter<S,T>sourceClass - The source ClasstargetClass - The target Class
true if this object can convert
sourceClass to targetClass.
public T convert(S obj)
throws ConversionException
Converterobj to T.
convert in interface Converter<S,T>obj - The source Object to convert
Object
ConversionExceptionpublic Class<?> getSourceClass()
ConverterClass for this converter.
getSourceClass in interface Converter<S,T>Class for this converterpublic Class<?> getTargetClass()
ConverterClass for this converter.
getTargetClass in interface Converter<S,T>Class for this converter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||