jTransfo, 0.14

org.jtransfo.internal
Class ConverterHelper

java.lang.Object
  extended by org.jtransfo.internal.ConverterHelper

public class ConverterHelper
extends Object

Helper class for building the converters for a pair of classes.


Constructor Summary
ConverterHelper()
           
 
Method Summary
 ToConverter getToConverter(Class toClass, Class domainClass)
          Build the descriptor for conversion between given object types.
 void setTypeConvertersInOrder(Collection<TypeConverter> typeConverters)
          Set the list of type converters.
 String withPath(String[] path)
          Convert path array to a readable representation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterHelper

public ConverterHelper()
Method Detail

getToConverter

public ToConverter getToConverter(Class toClass,
                                  Class domainClass)
                           throws JTransfoException
Build the descriptor for conversion between given object types.

Parameters:
toClass - transfer object class, contains the annotations for the conversion
domainClass - domain class as other side of conversion
Returns:
conversion descriptor
Throws:
JTransfoException - cannot build converter

withPath

public String withPath(String[] path)
Convert path array to a readable representation.

Parameters:
path - array of path elements
Returns:
original path string

setTypeConvertersInOrder

public void setTypeConvertersInOrder(Collection<TypeConverter> typeConverters)
Set the list of type converters. When searching a type conversion, the list is traversed front to back.

Parameters:
typeConverters - ordered list of type converters, the first converter in the list which can do the conversion is used.

jTransfo, 0.14

Copyright © 2014. All rights reserved.