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

public interface TwoWayConverter extends Converter
A converter that can also convert from the target back to the source.
Author:
Keith Donald
  • Method Details

    • convertTargetToSourceClass

      Object convertTargetToSourceClass(Object target, Class<?> sourceClass) throws Exception
      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 of Converter.getTargetClass()
      sourceClass - the source class to convert the target to, which must be equal to or a specialization of Converter.getSourceClass()
      Returns:
      the converted object, which must be an instance of the sourceClass
      Throws:
      Exception - an exception occurred performing the conversion