jTransfo, 0.10

org.jtransfo.internal
Class AbstractConverter

java.lang.Object
  extended by org.jtransfo.internal.AbstractConverter
All Implemented Interfaces:
Converter
Direct Known Subclasses:
ToDomainConverter, ToToConverter

public abstract class AbstractConverter
extends Object
implements Converter

Converter class to copy one field to the transfer object class.


Constructor Summary
AbstractConverter()
           
 
Method Summary
abstract  String accessExceptionMessage()
          Get exception message for IllegalAccessException.
abstract  String argumentExceptionMessage()
          Get exception message for IllegalArgumentException.
 void convert(Object source, Object target, String... tags)
          Conversion from (part of) the source object to the target object.
abstract  void doConvert(Object source, Object target, String... tags)
          Actual conversion code, exceptions handled by invoker.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConverter

public AbstractConverter()
Method Detail

doConvert

public abstract void doConvert(Object source,
                               Object target,
                               String... tags)
                        throws JTransfoException,
                               IllegalAccessException,
                               IllegalArgumentException
Actual conversion code, exceptions handled by invoker.

Parameters:
source - source object
target - target object
tags - tags which indicate which fields can be converted based on MapOnly annotations
Throws:
JTransfoException - oops
IllegalAccessException - oops
IllegalArgumentException - oops

accessExceptionMessage

public abstract String accessExceptionMessage()
Get exception message for IllegalAccessException.

Returns:
message for exception with %s placeholders for source and target field name

argumentExceptionMessage

public abstract String argumentExceptionMessage()
Get exception message for IllegalArgumentException.

Returns:
message for exception with %s placeholders for source and target field name

convert

public void convert(Object source,
                    Object target,
                    String... tags)
             throws JTransfoException
Description copied from interface: Converter
Conversion from (part of) the source object to the target object.

Specified by:
convert in interface Converter
Parameters:
source - source to read from
target - target to write into
tags - tags which indicate which fields can be converted based on MapOnly annotations
Throws:
JTransfoException - problem during conversion

jTransfo, 0.10

Copyright © 2013. All rights reserved.