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 |
| Modifier and Type | Field and Description |
|---|---|
| private List | |
| private List |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFromNativeConverter(Class<?>
Java class for the Java representation of a native type. cls, FromNativeConverter FromNativeConverter to transform a
native-compatible type into its Java equivalent.Add a |
| public void | addToNativeConverter(Class<?>
Java class requiring conversion cls, ToNativeConverter ToNativeConverter to transform an object of
the given Java class into its native-compatible form.Add a |
| public void | addTypeConverter(Class<?>
Java class representation for a native type cls, TypeConverter TypeConverter to translate between native and
Java types.Add a |
| private Class | |
| public FromNativeConverter | getFromNativeConverter(Class<?>
Java class representation of the native type. javaType)Implements com. FromNativeConverter appropriate for the given Java class.
|
| public ToNativeConverter | getToNativeConverter(Class<?>
Java class representation of the native type. javaType)Implements com. ToNativeConverter appropriate for the given Java class.
|
| private Object |
| fromNativeConverters | back to summary |
|---|---|
| private List<DefaultTypeMapper. | |
| toNativeConverters | back to summary |
|---|---|
| private List<DefaultTypeMapper. | |
| DefaultTypeMapper | back to summary |
|---|---|
| public DefaultTypeMapper() | |
| addFromNativeConverter | back to summary |
|---|---|
| public void addFromNativeConverter(Class<?> cls, FromNativeConverter converter) Add a
| |
| addToNativeConverter | back to summary |
|---|---|
| public void addToNativeConverter(Class<?> cls, ToNativeConverter converter) Add a
| |
| addTypeConverter | back to summary |
|---|---|
| public void addTypeConverter(Class<?> cls, TypeConverter converter) Add a
| |
| getAltClass | back to summary |
|---|---|
| private Class | |
| getFromNativeConverter | back to summary |
|---|---|
| public FromNativeConverter getFromNativeConverter(Class<?> javaType) Implements com. Doc from com. Return the
| |
| getToNativeConverter | back to summary |
|---|---|
| public ToNativeConverter getToNativeConverter(Class<?> javaType) Implements com. Doc from com. Return the
| |
| lookupConverter | back to summary |
|---|---|
| private Object lookupConverter(Class<?> javaClass, Collection<? extends DefaultTypeMapper. | |
| converter | back to summary |
|---|---|
| public Object converter | |
| type | back to summary |
|---|---|
| public Class<?> type | |
| Entry | back to summary |
|---|---|
| public Entry(Class<?> type, Object converter) | |