01: // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
02:
03: package jodd.typeconverter;
04:
05: /**
06: * Object converter interface.
07: *
08: * @see jodd.typeconverter.TypeConverterManager
09: */
10: public interface TypeConverter {
11:
12: /**
13: * Converts object received as parameter into object of another class.
14: * For example, in a IntegerConverter implementation of this interface,
15: * this method should convert all objects into Integer object. Conversion has
16: * to be done correctly, with investigation of given object.
17: * <p>
18: *
19: * If conversion is not possible {@link TypeConversionException} should be thrown.
20: *
21: * @param obj object to convert from
22: *
23: * @return resulting object
24: */
25: Object convert(Object obj);
26:
27: }
|