Interface TypeConvertor

All Superinterfaces:
Cloneable, TypeConvertor
All Known Implementing Classes:
AbstractDateTypeConvertor, AbstractLobTypeConvertor, AbstractSimpleTypeConvertor, AbstractTypeConvertor, BigDecimalToBoolean, BigDecimalToByte, BigDecimalToDate, BigDecimalToDouble, BigDecimalToFloat, BigDecimalToInteger, BigDecimalToLong, BigDecimalToShort, BooleanToBigDecimal, BooleanToInteger, BooleanToShort, BooleanToString, ByteArrayToInputStream, ByteArrayToSerializable, ByteArrayToString, ByteToBigDecimal, ByteToInteger, ByteToShort, CastorDateToDate, CastorDateToSqlDate, CastorDurationToLong, CastorTimeToLong, CharArrayToSqlClob, CharArrayToString, DateToBigDecimal, DateToCastorDate, DateToDouble, DateToInteger, DateToLong, DateToSqlDate, DateToSqlTime, DateToSqlTimestamp, DateToString, DoubleToBigDecimal, DoubleToDate, DoubleToFloat, DoubleToInteger, DoubleToLong, EnumToOrdinal, EnumTypeConvertor, FloatToBigDecimal, FloatToDouble, FloatToInteger, FloatToLong, InputStreamToByteArray, InputStreamToSerializable, IntegerToBigDecimal, IntegerToBoolean, IntegerToByte, IntegerToDate, IntegerToDouble, IntegerToFloat, IntegerToLong, IntegerToShort, LongToBigDecimal, LongToCastorDuration, LongToCastorTime, LongToDate, LongToDouble, LongToFloat, LongToInteger, LongToShort, ObjectToString, SerializableToByteArray, SerializableToInputStream, ShortToBigDecimal, ShortToBoolean, ShortToByte, ShortToInteger, ShortToLong, SqlClobToCharArray, SqlClobToString, SqlDateToCastorDate, SqlDateToDate, SqlTimestampToDate, SqlTimestampToString, SqlTimeToDate, StringToBigDecimal, StringToBoolean, StringToByteArray, StringToCastorDuration, StringToCastorTime, StringToCharacter, StringToCharArray, StringToDate, StringToDouble, StringToFloat, StringToInteger, StringToLong, StringToShort, StringToSqlClob, StringToSqlTimestamp

public interface TypeConvertor extends TypeConvertor, Cloneable
Interface for a type convertor. A type convertor converts a Java object from one type to another. A type convertor implementation is required for each type of conversion.
Since:
1.1.3
Version:
$Revision: 7134 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $
Author:
Ralf Joachim
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates and returns a copy of this object.
    void
    Configure the converter with given configuration.
    convert(Object object)
    Convert the object from one type to another.
    Get the type being converted from.
    void
    parameterize(String parameter)
    Initialize the converter with the given parameter.
    Get the type being converted to.
  • Method Details

    • configure

      void configure(AbstractProperties properties)
      Configure the converter with given configuration.
      Parameters:
      properties - Properties to use.
    • parameterize

      void parameterize(String parameter)
      Initialize the converter with the given parameter. If no parameter is available the method don't need to be called or may be called with null which both should lead to the default behaviour of the converter.
      Parameters:
      parameter - The parameter for the convertor (null if is not specified).
    • clone

      Object clone()
      Creates and returns a copy of this object.
      Returns:
      A clone of this instance.
    • fromType

      Class<?> fromType()
      Get the type being converted from.
      Returns:
      The type being converted from.
    • toType

      Class<?> toType()
      Get the type being converted to.
      Returns:
      The type being converted to.
    • convert

      Object convert(Object object) throws ClassCastException
      Convert the object from one type to another.
      Specified by:
      convert in interface TypeConvertor
      Parameters:
      object - The object to convert.
      Returns:
      The converted object.
      Throws:
      ClassCastException - The object is not of the type supported by this convertor.