jodd.typeconverter
Class TypeConverterManagerBean

java.lang.Object
  extended by jodd.typeconverter.TypeConverterManagerBean

public class TypeConverterManagerBean
extends java.lang.Object

Provides dynamic object conversion to a type. Contains a map of registered converters. User may add new converters. Instantiable version of TypeConverterManager.


Field Summary
protected  ConvertBean convertBean
           
 
Constructor Summary
TypeConverterManagerBean()
           
 
Method Summary
<T> T
convertType(java.lang.Object value, java.lang.Class<T> destinationType)
          Converts an object to destination type.If destination type is one of common types, consider using Convert instead for faster approach.
 ConvertBean getConvertBean()
          Returns ConvertBean.
 TypeConverter lookup(java.lang.Class type)
          Retrieves converter for provided type.
 void register(java.lang.Class type, TypeConverter typeConverter)
          Registers a converter for specified type.
 void registerDefaults()
          Registers default set of converters.
 void unregister(java.lang.Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

convertBean

protected ConvertBean convertBean
Constructor Detail

TypeConverterManagerBean

public TypeConverterManagerBean()
Method Detail

getConvertBean

public ConvertBean getConvertBean()
Returns ConvertBean.


registerDefaults

public void registerDefaults()
Registers default set of converters.


register

public void register(java.lang.Class type,
                     TypeConverter typeConverter)
Registers a converter for specified type. User must register converter for all super-classes as well.

Parameters:
type - class that converter is for
typeConverter - converter for provided class

unregister

public void unregister(java.lang.Class type)

lookup

public TypeConverter lookup(java.lang.Class type)
Retrieves converter for provided type. Only registered types are matched, therefore subclasses must be also registered.

Returns:
founded converter or null

convertType

public <T> T convertType(java.lang.Object value,
                         java.lang.Class<T> destinationType)
Converts an object to destination type.If destination type is one of common types, consider using Convert instead for faster approach.



Copyright © 2003-2012 Jodd Team