Interface TwoWayConverter
- All Superinterfaces:
Converter
- All Known Implementing Classes:
ArrayToCollection,FormattedStringToNumber,PropertyEditorConverter,StringToBigDecimal,StringToBigInteger,StringToBoolean,StringToByte,StringToCharacter,StringToClass,StringToDate,StringToDouble,StringToEnum,StringToFloat,StringToInteger,StringToLocale,StringToLong,StringToObject,StringToShort
A converter that can also convert from the target back to the source.
- Author:
- Keith Donald
-
Method Summary
Modifier and TypeMethodDescriptionconvertTargetToSourceClass(Object target, Class<?> sourceClass) Convert the provided target object argument to an instance of the specified source class.Methods inherited from interface org.springframework.binding.convert.converters.Converter
convertSourceToTargetClass, getSourceClass, getTargetClass
-
Method Details
-
convertTargetToSourceClass
Convert the provided target object argument to an instance of the specified source class.- Parameters:
target- the target object to convert, which must be an instance ofConverter.getTargetClass()sourceClass- the source class to convert the target to, which must be equal to or a specialization ofConverter.getSourceClass()- Returns:
- the converted object, which must be an instance of the
sourceClass - Throws:
Exception- an exception occurred performing the conversion
-