Define conversion from a Java type to its corresponding native type.
| 28 | * Define conversion from a Java type to its corresponding native type. |
| 29 | */ |
| 30 | public interface ToNativeConverter { |
| 31 | /** |
| 32 | * Convert a Java type to an appropriate native type. The new type |
| 33 | * must be one of the following classes: |
| 34 | * <ul> |
| 35 | * <li>{@link Pointer} |
| 36 | * <li>Boolean |
| 37 | * <li>Byte |
| 38 | * <li>Short |
| 39 | * <li>Character |
| 40 | * <li>Integer |
| 41 | * <li>{@link NativeLong} |
| 42 | * <li>Long |
| 43 | * <li>Float |
| 44 | * <li>Double |
| 45 | * <li>{@link Structure} |
| 46 | * <li>String |
| 47 | * <li>{@link WString} |
| 48 | * <li>{@link java.nio.Buffer} (unsupported in direct mode) |
| 49 | * <li>primitive array (unsupported in direct mode) |
| 50 | * </ul> |
| 51 | */ |
| 52 | Object toNative(Object value, ToNativeContext context); |
| 53 | /** Indicate the type expected from {@link #toNative}. */ |
| 54 | Class<?> nativeType(); |
| 55 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…