|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TypeConverter
A type converter can convert values between different types encountered
during expression evaluation. This is an SPI for the expression parser;
see ConversionService
for the
primary user API to Spring's conversion facilities.
Method Summary | |
---|---|
boolean |
canConvert(TypeDescriptor sourceType,
TypeDescriptor targetType)
Return true if the type converter can convert the specified type to the desired target type. |
Object |
convertValue(Object value,
TypeDescriptor sourceType,
TypeDescriptor targetType)
Convert (may coerce) a value from one type to another, for example from a boolean to a string. |
Method Detail |
---|
boolean canConvert(TypeDescriptor sourceType, TypeDescriptor targetType)
sourceType
- a type descriptor that describes the source typetargetType
- a type descriptor that describes the requested result type
Object convertValue(Object value, TypeDescriptor sourceType, TypeDescriptor targetType)
value
- the value to be convertedsourceType
- a type descriptor that supplies extra information about the source objecttargetType
- a type descriptor that supplies extra information about the requested result type
EvaluationException
- if conversion is not possible
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |