org.constretto.internal.converter
Class ValueConverterRegistry

java.lang.Object
  extended by org.constretto.internal.converter.ValueConverterRegistry

public class ValueConverterRegistry
extends Object

Author:
Kaare Nilsen

Constructor Summary
ValueConverterRegistry()
           
 
Method Summary
static
<K,V> Object
convert(Class<V> valueClazz, Class<K> keyClazz, CValue value)
           
static
<T extends Enum<T>>
T
convertEnum(Class<T> clazz, String value)
           
static
<T> List<T>
convertList(Class<T> clazz, CArray list)
           
static
<K,V> Map<K,V>
convertMap(Class<K> keyClazz, Class<V> valueClazz, CObject value)
           
static
<T> T
convertPrimitive(Class<T> clazz, CPrimitive value)
           
static void registerCustomConverter(Class<?> converterFor, ValueConverter<?> converter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueConverterRegistry

public ValueConverterRegistry()
Method Detail

registerCustomConverter

public static void registerCustomConverter(Class<?> converterFor,
                                           ValueConverter<?> converter)

convert

public static <K,V> Object convert(Class<V> valueClazz,
                                   Class<K> keyClazz,
                                   CValue value)
                      throws ConstrettoException
Throws:
ConstrettoException

convertList

public static <T> List<T> convertList(Class<T> clazz,
                                      CArray list)
                           throws ConstrettoException
Throws:
ConstrettoException

convertPrimitive

public static <T> T convertPrimitive(Class<T> clazz,
                                     CPrimitive value)
                          throws ConstrettoException
Throws:
ConstrettoException

convertMap

public static <K,V> Map<K,V> convertMap(Class<K> keyClazz,
                                        Class<V> valueClazz,
                                        CObject value)
                           throws ConstrettoException
Throws:
ConstrettoException

convertEnum

public static <T extends Enum<T>> T convertEnum(Class<T> clazz,
                                                String value)


Copyright © 2008-2013. All Rights Reserved.