Derived classes should install additional converters using
addToNativeConverter
and/or addFromNativeConverter in the default constructor. Classes
for primitive types will automatically register for the corresponding
Object type and vice versa (i.e. you don't have to register both
int.class and Integer.class).
If you want different mapping behavior than the default, simply override
getToNativeConverter and getFromNativeConverter.
Library#OPTION_TYPE_MAPPER
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFromNativeConverter(Class<T> cls, FromNativeConverter converter)
Add a |
| public void | addToNativeConverter(Class<T> cls, ToNativeConverter converter)
Add a |
| protected void | addTypeConverter(Class<T> cls, TypeConverter converter)
Add a |
| private Class | |
| public FromNativeConverter | getFromNativeConverter(Class<T> javaType)
Implements com. FromNativeConverter appropriate for the given Java class.
|
| public ToNativeConverter | getToNativeConverter(Class<T> javaType)
Implements com. ToNativeConverter appropriate for the given Java class.
|
| private Object |
| fromNativeConverters | back to summary |
|---|---|
| private List<E> fromNativeConverters | |
| toNativeConverters | back to summary |
|---|---|
| private List<E> toNativeConverters | |
| DefaultTypeMapper | back to summary |
|---|---|
| public DefaultTypeMapper() | |
| addFromNativeConverter | back to summary |
|---|---|
| public void addFromNativeConverter(Class<T> cls, FromNativeConverter converter) Add a | |
| addToNativeConverter | back to summary |
|---|---|
| public void addToNativeConverter(Class<T> cls, ToNativeConverter converter) Add a | |
| addTypeConverter | back to summary |
|---|---|
| protected void addTypeConverter(Class<T> cls, TypeConverter converter) Add a | |
| getAltClass | back to summary |
|---|---|
| private Class | |
| getFromNativeConverter | back to summary |
|---|---|
| public FromNativeConverter getFromNativeConverter(Class<T> javaType) Implements com. Doc from com. Return the | |
| getToNativeConverter | back to summary |
|---|---|
| public ToNativeConverter getToNativeConverter(Class<T> javaType) Implements com. Doc from com. Return the | |
| lookupConverter | back to summary |
|---|---|
| private Object lookupConverter(Class<T> javaClass, List<E> converters) | |
| converter | back to summary |
|---|---|
| public Object converter | |
| type | back to summary |
|---|---|
| public Class<T> type | |
| Entry | back to summary |
|---|---|
| public Entry(Class<T> type, Object converter) | |