| java.lang.Object biz.hammurapi.convert.CompositeConverter
CompositeConverter | public class CompositeConverter (Code) | | author: Pavel Vlasov version: $Revision: 1.7 $ |
Constructor Summary | |
public | CompositeConverter() Creates new composite converter populated by default with some generic converters. |
CompositeConverter | public CompositeConverter()(Code) | | Creates new composite converter populated by default with some generic converters.
|
addConverter | public Converter addConverter(Class source, Class target, String accessor, Constructor constructor)(Code) | | Adds a converter which uses method of source object and constructor of target object to
perform conversion.
Parameters: source - Source object. Parameters: target - Target class. Parameters: accessor - Method name to invoke on source to obtain intermediate object. Can be null. Parameters: constructor - Target constructor. Can be null. |
addConverter | public void addConverter(Class source, Class target, Converter converter)(Code) | | Adds a converter from source object to target class.
Parameters: source - Parameters: target - Parameters: converter - |
convert | public Object convert(Object source, Class target, boolean lenient)(Code) | | Converts source object to target class instance
Parameters: source - Source object Parameters: target - Target class. If target class is String then toString() is always used. Parameters: lenient - When true null is returned if conversion cannot be performed, otherwise ConversionException is thrown Instance of target class. throws: ConversionException - If lenient=false and conversion cannot be performed. |
isImmutable | public boolean isImmutable()(Code) | | true if no additional converters can be added to this converter. |
setImmutable | public void setImmutable()(Code) | | Makes converter immutable.
|
|
|