com.sun.jna
public class DefaultTypeMapper extends Object implements TypeMapper
Derived classes should install additional converters using
DefaultTypeMapper
and/or DefaultTypeMapper 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
DefaultTypeMapper and DefaultTypeMapper.
See Also: OPTION_TYPE_MAPPER
Method Summary | |
---|---|
void | addFromNativeConverter(Class cls, FromNativeConverter converter) Add a FromNativeConverter to convert a native result type into the
given Java type. |
void | addToNativeConverter(Class cls, ToNativeConverter converter) Add a ToNativeConverter to define the conversion into a native
type from arguments of the given Java type. |
protected void | addTypeConverter(Class cls, TypeConverter converter) Add a TypeConverter to provide bidirectional mapping between
a native and Java type. |
FromNativeConverter | getFromNativeConverter(Class javaType) |
ToNativeConverter | getToNativeConverter(Class javaType) |