|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.converter.DefaultTypeConverter
public class DefaultTypeConverter
Nested Class Summary | |
---|---|
protected static class |
DefaultTypeConverter.TypeMapping
Represents a mapping from one type (which can be null) to another |
Constructor Summary | |
---|---|
DefaultTypeConverter(Injector injector)
|
Method Summary | ||
---|---|---|
void |
addFallbackConverter(TypeConverter converter)
|
|
void |
addTypeConverter(Class toType,
Class fromType,
TypeConverter typeConverter)
Allows a new type converter to be registered |
|
protected void |
checkLoaded()
Checks if the registry is loaded and if not lazily load it |
|
|
convertTo(Class<T> toType,
Object value)
Converts the value to the specified type |
|
protected TypeConverter |
findTypeConverter(Class toType,
Class fromType,
Object value)
Tries to auto-discover any available type converters |
|
Injector |
getInjector()
|
|
protected
|
getOrFindTypeConverter(Class toType,
Object value)
|
|
TypeConverter |
getTypeConverter(Class toType,
Class fromType)
|
|
protected void |
loadFallbackTypeConverters()
|
|
void |
setInjector(Injector injector)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTypeConverter(Injector injector)
Method Detail |
---|
public <T> T convertTo(Class<T> toType, Object value)
TypeConverter
convertTo
in interface TypeConverter
toType
- the requested typevalue
- the value to be converted
public void addTypeConverter(Class toType, Class fromType, TypeConverter typeConverter)
TypeConverterRegistry
addTypeConverter
in interface TypeConverterRegistry
toType
- the type to convert tofromType
- the type to convert fromtypeConverter
- the type converter to usepublic void addFallbackConverter(TypeConverter converter)
public TypeConverter getTypeConverter(Class toType, Class fromType)
public Injector getInjector()
getInjector
in interface TypeConverterRegistry
public void setInjector(Injector injector)
protected <T> TypeConverter getOrFindTypeConverter(Class toType, Object value)
protected TypeConverter findTypeConverter(Class toType, Class fromType, Object value)
protected void checkLoaded()
protected void loadFallbackTypeConverters() throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |