public class ReadOnlyDomainAutomaticTypeConverter extends AbstractToDomainTypeConverter implements Named, NeedsJTransfo
ReadOnlyDomainAutomaticListTypeConverter in that case.| Constructor and Description |
|---|
ReadOnlyDomainAutomaticTypeConverter() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canConvert(Type realToType,
Type realDomainType)
Can this type converter handle conversions between the given transfer and domain object types?
|
Object |
convert(Object toObject,
SyntheticField domainField,
Object domainObject,
String... tags)
Convert a transfer object field value to the value for the domain object.
|
Object |
doConvert(JTransfo jTransfo,
Object toObject,
SyntheticField domainField,
String... tags)
Do the actual conversion.
|
String |
getName()
Get name for the object.
|
Object |
reverse(Object domainObject,
SyntheticField toField,
Object toObject,
String... tags)
Convert a domain object field value to the value for the transfer object.
|
void |
setAlwaysNewList(boolean alwaysNewList)
Set whether a new list should be used as container for the values.
|
void |
setJTransfo(JTransfo jTransfo)
Set jTransfo instance which can be used recursively.
|
void |
setKeepNullList(boolean keepNullList)
Set whether null values should be kept (true).
|
void |
setName(String name)
Set the name for the type converter.
|
void |
setSortList(boolean sortList)
Should the list be sorted if the first member is Comparable?
|
public ReadOnlyDomainAutomaticTypeConverter()
public void setJTransfo(JTransfo jTransfo)
NeedsJTransfosetJTransfo in interface NeedsJTransfosetJTransfo in class AbstractToDomainTypeConverterjTransfo - jTransfo instancepublic boolean canConvert(Type realToType, Type realDomainType)
TypeConvertercanConvert in interface TypeConverter<Object,Object>canConvert in class AbstractToDomainTypeConverterrealToType - real class for the type in the transfer objectrealDomainType - real class for the type in the domain objectpublic Object convert(Object toObject, SyntheticField domainField, Object domainObject, String... tags) throws JTransfoException
TypeConverterconvert in interface TypeConverter<Object,Object>convert in class AbstractToDomainTypeConvertertoObject - object to convertdomainField - target domain fielddomainObject - target domain objecttags - tags which indicate which fields can be converted based on MapOnly annotations.JTransfoException - problem during type conversionpublic Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException
TypeConverterreverse in interface TypeConverter<Object,Object>reverse in class AbstractToDomainTypeConverterdomainObject - object to converttoField - target transfer object fieldtoObject - target transfer objecttags - tags which indicate which fields can be converted based on MapOnly annotations.JTransfoException - problem during type conversionpublic Object doConvert(JTransfo jTransfo, Object toObject, SyntheticField domainField, String... tags) throws JTransfoException
AbstractToDomainTypeConverterdoConvert in class AbstractToDomainTypeConverterjTransfo - jTransfo instance in usetoObject - transfer objectdomainField - domain object fieldtags - tags which indicate which fields can be converted based on MapOnly annotations.JTransfoException - oops, cannot convertpublic void setName(String name)
name - type converter namepublic void setKeepNullList(boolean keepNullList)
keepNullList - should null be kept as value or replaced by an empty list.public void setAlwaysNewList(boolean alwaysNewList)
alwaysNewList - should null be kept as value or replaced by an empty list.public void setSortList(boolean sortList)
sortList - true when list should be sortedCopyright © 2017. All rights reserved.