Dummy example:
class Pointer<T> implements NativeMapped {
public Object fromNative(Object nativeValue, FromNativeContext context) {
// context.getTargetType() -> Pointer.class
}
}
Sometimes it would be useful to know the full generic information. E.g. whether a Pointer<Integer>, a Pointer<Double> or a Pointer<Pointer<Pointer<Short>>> needs to be created.
This would be easy to implement; in the Native class, just give method.getGenericReturnType() to registerMethod() instead of method.getReturnType(), adapt fromNative() to take a Type and change the C code.
Though this would change the API and requires Java 1.5. So maybe instead of changing the API an addition would be better.
Dummy example:
class Pointer<T> implements NativeMapped {
public Object fromNative(Object nativeValue, FromNativeContext context) {
// context.getTargetType() -> Pointer.class
}
}
Sometimes it would be useful to know the full generic information. E.g. whether a Pointer<Integer>, a Pointer<Double> or a Pointer<Pointer<Pointer<Short>>> needs to be created.
This would be easy to implement; in the Native class, just give method.getGenericReturnType() to registerMethod() instead of method.getReturnType(), adapt fromNative() to take a Type and change the C code.
Though this would change the API and requires Java 1.5. So maybe instead of changing the API an addition would be better.