public interface TypeConverterRegistry extends StaticService
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.Modifier and Type | Interface and Description |
---|---|
static interface |
TypeConverterRegistry.Statistics
Utilization statistics of the this registry.
|
Modifier and Type | Method and Description |
---|---|
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.
|
void |
addTypeConverters(TypeConverters typeConverters)
Registers all the type converters from the class, each converter must be implemented as a method and annotated with
Converter . |
Injector |
getInjector()
Gets the injector
|
TypeConverterRegistry.Statistics |
getStatistics()
Gets the utilization statistics of this type converter registry
|
TypeConverterExists |
getTypeConverterExists()
What should happen when attempting to add a duplicate type converter.
|
LoggingLevel |
getTypeConverterExistsLoggingLevel()
The logging level to use when logging that a type converter already exists when attempting to add a duplicate type converter.
|
List<Class<?>[]> |
listAllTypeConvertersFromTo()
Gets a read-only list of the type converter from / to classes
|
TypeConverter |
lookup(Class<?> toType,
Class<?> fromType)
Performs a lookup for a given type converter.
|
boolean |
removeTypeConverter(Class<?> toType,
Class<?> fromType)
Removes the type converter
|
void |
setInjector(Injector injector)
Sets the injector to be used for creating new instances during type conversions.
|
void |
setTypeConverterExists(TypeConverterExists typeConverterExists)
What should happen when attempting to add a duplicate type converter.
|
void |
setTypeConverterExistsLoggingLevel(LoggingLevel typeConverterExistsLoggingLevel)
The logging level to use when logging that a type converter already exists when attempting to add a duplicate type converter.
|
int |
size()
Number of type converters in the registry.
|
void addTypeConverter(Class<?> toType, Class<?> fromType, TypeConverter typeConverter)
TypeConverterExistsException
if configured to fail if an existing
type converter already existstoType
- the type to convert tofromType
- the type to convert fromtypeConverter
- the type converter to useboolean removeTypeConverter(Class<?> toType, Class<?> fromType)
toType
- the type to convert tofromType
- the type to convert fromvoid addTypeConverters(TypeConverters typeConverters)
Converter
.typeConverters
- class which implements the type convertersvoid addFallbackTypeConverter(TypeConverter typeConverter, boolean canPromote)
typeConverter
- the type converter to usecanPromote
- whether or not the fallback type converter can be promoted to a first class type converterTypeConverter lookup(Class<?> toType, Class<?> fromType)
toType
- the type to convert tofromType
- the type to convert fromList<Class<?>[]> listAllTypeConvertersFromTo()
void setInjector(Injector injector)
injector
- the injectorInjector getInjector()
TypeConverterRegistry.Statistics getStatistics()
int size()
LoggingLevel getTypeConverterExistsLoggingLevel()
void setTypeConverterExistsLoggingLevel(LoggingLevel typeConverterExistsLoggingLevel)
TypeConverterExists getTypeConverterExists()
void setTypeConverterExists(TypeConverterExists typeConverterExists)
Apache Camel