jTransfo, 0.10

org.jtransfo
Class ReadOnlyDomainListTypeConverter

java.lang.Object
  extended by org.jtransfo.AbstractListTypeConverter
      extended by org.jtransfo.ReadOnlyDomainListTypeConverter
All Implemented Interfaces:
Named, NeedsJTransfo, TypeConverter<List,List>

public class ReadOnlyDomainListTypeConverter
extends AbstractListTypeConverter

Type converter for converting lists with object of specific type. Can only be used as declared converter.

Similar to ReadOnlyDomainTypeConverter this does a full conversion from domain to transfer object but will only find the objects and not update the fields when converting to the domain object. This way list membership is updated, but the domain objects remain unmodified.


Constructor Summary
ReadOnlyDomainListTypeConverter(String name, Class<?> toType)
          Construct type converter for converting a list, assign given name and use given transfer object type.
 
Method Summary
 Object doConvertOne(JTransfo jTransfo, Object toObject, Class<?> domainObjectType, String... tags)
          Do the actual conversion of one object.
 
Methods inherited from class org.jtransfo.AbstractListTypeConverter
canConvert, convert, getName, reverse, setAlwaysNewList, setJTransfo, setKeepNullList, setSortList
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyDomainListTypeConverter

public ReadOnlyDomainListTypeConverter(String name,
                                       Class<?> toType)
Construct type converter for converting a list, assign given name and use given transfer object type.

Parameters:
name - name for type converter, for use in MappedBy.typeConverter()
toType - transfer object type
Method Detail

doConvertOne

public Object doConvertOne(JTransfo jTransfo,
                           Object toObject,
                           Class<?> domainObjectType,
                           String... tags)
                    throws JTransfoException
Description copied from class: AbstractListTypeConverter
Do the actual conversion of one object.

Specified by:
doConvertOne in class AbstractListTypeConverter
Parameters:
jTransfo - jTransfo instance in use
toObject - transfer object
domainObjectType - domain object type
tags - tags which indicate which fields can be converted based on MapOnly annotations.
Returns:
domain object
Throws:
JTransfoException - oops, cannot convert

jTransfo, 0.10

Copyright © 2013. All rights reserved.