org.apache.camel.spi
Interface TypeConverterRegistry

All Superinterfaces:
Service
All Known Implementing Classes:
BaseTypeConverterRegistry, DefaultTypeConverter, LazyLoadingTypeConverter

public interface TypeConverterRegistry
extends Service

Registry for type converters.

The utilization TypeConverterRegistry.Statistics is by default disabled, as it has a slight performance impact under very high concurrent load. The statistics can be enabled using TypeConverterRegistry.Statistics.setStatisticsEnabled(boolean) method.

Version:

Nested Class Summary
static interface TypeConverterRegistry.Statistics
          Utilization statistics of the this registry.
 
Method Summary
 void addFallbackTypeConverter(TypeConverter typeConverter, boolean canPromote)
          Registers a new fallback type converter
 void addTypeConverter(Class<?> toType, Class<?> fromType, TypeConverter typeConverter)
          Registers a new type converter
 Injector getInjector()
          Gets the injector
 TypeConverterRegistry.Statistics getStatistics()
          Gets the utilization statistics of this type converter registry
 TypeConverter lookup(Class<?> toType, Class<?> fromType)
          Performs a lookup for a given type converter.
 void setInjector(Injector injector)
          Sets the injector to be used for creating new instances during type conversions.
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Method Detail

addTypeConverter

void addTypeConverter(Class<?> toType,
                      Class<?> fromType,
                      TypeConverter typeConverter)
Registers a new type converter

Parameters:
toType - the type to convert to
fromType - the type to convert from
typeConverter - the type converter to use

addFallbackTypeConverter

void addFallbackTypeConverter(TypeConverter typeConverter,
                              boolean canPromote)
Registers a new fallback type converter

Parameters:
typeConverter - the type converter to use
canPromote - whether or not the fallback type converter can be promoted to a first class type converter

lookup

TypeConverter lookup(Class<?> toType,
                     Class<?> fromType)
Performs a lookup for a given type converter.

Parameters:
toType - the type to convert to
fromType - the type to convert from
Returns:
the type converter or null if not found.

setInjector

void setInjector(Injector injector)
Sets the injector to be used for creating new instances during type conversions.

Parameters:
injector - the injector

getInjector

Injector getInjector()
Gets the injector

Returns:
the injector

getStatistics

TypeConverterRegistry.Statistics getStatistics()
Gets the utilization statistics of this type converter registry

Returns:
the utilization statistics


Apache CAMEL