protected static class Converters.PassThruConverter<S,T> extends Object implements Converter<S,T>
convert
method returns the
source object.Constructor and Description |
---|
PassThruConverter(Class<S> sourceClass,
Class<T> targetClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(Class<?> sourceClass,
Class<?> targetClass)
Returns
true if this object can convert
sourceClass to targetClass . |
T |
convert(Class<? extends T> targetClass,
S obj)
Converts
obj to T . |
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. |
public boolean canConvert(Class<?> sourceClass, Class<?> targetClass)
Converter
true
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 Class
targetClass
- The target Class
true
if this object can convert
sourceClass
to targetClass
.public T convert(S obj) throws ConversionException
Converter
obj
to T
.convert
in interface Converter<S,T>
obj
- The source Object
to convertObject
ConversionException
public T convert(Class<? extends T> targetClass, S obj) throws ConversionException
Converter
obj
to T
.convert
in interface Converter<S,T>
targetClass
- The Class
to convert toobj
- The source Object
to convertObject
ConversionException
public Class<?> getSourceClass()
Converter
Class
for this converter.getSourceClass
in interface Converter<S,T>
Class
for this converter