public abstract class BaseValueConverter<S,T> extends Object implements ValueConverter<S,T>
Modifier | Constructor and Description |
---|---|
protected |
BaseValueConverter(String name,
Class<S> sourceType,
Class<T> targetType) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsSourceValue(Object value)
Returns true if the converter knows how to convert the given source value to the target type.
|
boolean |
acceptsTargetValue(Object value)
Returns true if the converter knows how to convert the given target value to the source type.
|
S |
convertToSourceType(Object value)
Converts the given target value to the source type.
|
protected abstract S |
convertToSourceTypeNullSafe(Object value) |
T |
convertToTargetType(Object value)
Converts the given source value to the target type.
|
protected abstract T |
convertToTargetTypeNullSafe(Object value) |
String |
getName()
The name of the converter.
|
Class<S> |
getSourceType()
Returns the type of source values that the converter can handle.
|
Class<T> |
getTargetType()
Returns the type of target values that the converter can handle.
|
public String getName()
ValueConverter
getName
in interface ValueConverter<S,T>
public Class<S> getSourceType()
ValueConverter
getSourceType
in interface ValueConverter<S,T>
public Class<T> getTargetType()
ValueConverter
getTargetType
in interface ValueConverter<S,T>
public boolean acceptsSourceValue(Object value)
ValueConverter
acceptsSourceValue
in interface ValueConverter<S,T>
value
- the candidate source valuepublic boolean acceptsTargetValue(Object value)
ValueConverter
acceptsTargetValue
in interface ValueConverter<S,T>
value
- the candidate target valuepublic T convertToTargetType(Object value)
ValueConverter
convertToTargetType
in interface ValueConverter<S,T>
value
- the source value to convertpublic S convertToSourceType(Object value)
ValueConverter
convertToSourceType
in interface ValueConverter<S,T>
value
- the target value to convertCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.