|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.hammurapi.convert.CompositeConverter
public class CompositeConverter
| Constructor Summary | |
|---|---|
CompositeConverter()
Creates new composite converter populated by default with some generic converters. |
|
| Method Summary | |
|---|---|
void |
addConverter(java.lang.Class source,
java.lang.Class target,
Converter converter)
Adds a converter from source object to target class. |
Converter |
addConverter(java.lang.Class source,
java.lang.Class target,
java.lang.String accessor,
java.lang.reflect.Constructor constructor)
Adds a converter which uses method of source object and constructor of target object to perform conversion. |
java.lang.Object |
convert(java.lang.Object source,
java.lang.Class target,
boolean lenient)
Converts source object to target class instance |
static CompositeConverter |
getDefaultConverter()
|
boolean |
isImmutable()
|
void |
setImmutable()
Makes converter immutable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeConverter()
| Method Detail |
|---|
public boolean isImmutable()
public void setImmutable()
public static CompositeConverter getDefaultConverter()
public Converter addConverter(java.lang.Class source,
java.lang.Class target,
java.lang.String accessor,
java.lang.reflect.Constructor constructor)
source - Source object.target - Target class.accessor - Method name to invoke on source to obtain intermediate object. Can be null.constructor - Target constructor. Can be null.
public void addConverter(java.lang.Class source,
java.lang.Class target,
Converter converter)
source - target - converter -
public java.lang.Object convert(java.lang.Object source,
java.lang.Class target,
boolean lenient)
source - Source objecttarget - Target class. If target class is String then toString() is always used.lenient - When true null is returned if conversion cannot be performed,
otherwise ConversionException is thrown
ConversionException - If lenient=false and conversion cannot be performed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||