MCPcopy Create free account
hub / github.com/java-native-access/jna / ToNativeConverter

Interface ToNativeConverter

src/com/sun/jna/ToNativeConverter.java:30–55  ·  view source on GitHub ↗

Define conversion from a Java type to its corresponding native type.

Source from the content-addressed store, hash-verified

28 * Define conversion from a Java type to its corresponding native type.
29 */
30public 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}

Callers 10

writeFieldMethod · 0.95
deriveLayoutMethod · 0.95
getFieldTypeInfoMethod · 0.95
convertArgumentMethod · 0.95
CallbackReferenceMethod · 0.95
writeFieldMethod · 0.95
validateFieldMethod · 0.95
getFieldTypeInfoMethod · 0.95
getMethod · 0.95
getConversionMethod · 0.95

Implementers 15

PrimitiveConvertertest/com/sun/jna/DirectArgumentsWrappe
EnumConvertercontrib/platform/src/com/sun/jna/platf
CertStoreProviderNamecontrib/platform/src/com/sun/jna/platf
Customtest/com/sun/jna/ReturnTypesTest.java
DirectTestLibraryBooleantest/com/sun/jna/DirectTypeMapperTest.
DirectTestLibraryStringtest/com/sun/jna/DirectTypeMapperTest.
DirectTestLibraryCharSequencetest/com/sun/jna/DirectTypeMapperTest.
DirectTestLibraryNumbertest/com/sun/jna/DirectTypeMapperTest.
DirectTestLibraryWStringtest/com/sun/jna/DirectTypeMapperTest.
DirectTestLibraryBidirectionalBooleantest/com/sun/jna/DirectTypeMapperTest.
DirectTypeMappedResultTypeTestLibrarytest/com/sun/jna/DirectTypeMapperTest.
DirectTypeMappedEnumerationTestLibrarytest/com/sun/jna/DirectTypeMapperTest.

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…