jTransfo, 0.14

org.jtransfo
Class MappedBy.DefaultTypeConverter

java.lang.Object
  extended by org.jtransfo.MappedBy.DefaultTypeConverter
All Implemented Interfaces:
TypeConverter<Object,Object>
Enclosing class:
MappedBy

public static class MappedBy.DefaultTypeConverter
extends Object
implements TypeConverter<Object,Object>

Default value for MappedBy.typeConverterClass() indicating the type converter which should be used if MappedBy.typeConverter() is not set.


Constructor Summary
MappedBy.DefaultTypeConverter()
           
 
Method Summary
 boolean canConvert(Class<?> realToType, Class<?> realDomainType)
          Can this type converter handle conversions between the given transfer and domain object types?
 Object convert(Object object, SyntheticField domainField, Object domainObject, String... tags)
          Convert a transfer object field value to the value for the domain object.
 Object reverse(Object object, SyntheticField toField, Object toObject, String... tags)
          Convert a domain object field value to the value for the transfer object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappedBy.DefaultTypeConverter

public MappedBy.DefaultTypeConverter()
Method Detail

canConvert

public boolean canConvert(Class<?> realToType,
                          Class<?> realDomainType)
Description copied from interface: TypeConverter
Can this type converter handle conversions between the given transfer and domain object types?

Specified by:
canConvert in interface TypeConverter<Object,Object>
Parameters:
realToType - real class for the type in the transfer object
realDomainType - real class for the type in the domain object
Returns:
true is this type converter can handle the type conversions

convert

public Object convert(Object object,
                      SyntheticField domainField,
                      Object domainObject,
                      String... tags)
               throws JTransfoException
Description copied from interface: TypeConverter
Convert a transfer object field value to the value for the domain object.

Specified by:
convert in interface TypeConverter<Object,Object>
Parameters:
object - object to convert
domainField - target domain field
domainObject - target domain object
tags - tags which indicate which fields can be converted based on MapOnly annotations.
Returns:
converted object
Throws:
JTransfoException - problem during type conversion

reverse

public Object reverse(Object object,
                      SyntheticField toField,
                      Object toObject,
                      String... tags)
               throws JTransfoException
Description copied from interface: TypeConverter
Convert a domain object field value to the value for the transfer object.

Specified by:
reverse in interface TypeConverter<Object,Object>
Parameters:
object - object to convert
toField - target transfer object field
toObject - target transfer object
tags - tags which indicate which fields can be converted based on MapOnly annotations.
Returns:
converted object
Throws:
JTransfoException - problem during type conversion

jTransfo, 0.14

Copyright © 2014. All rights reserved.