NativeMappedConverter (JNA API)

com.sun.jna

## Class NativeMappedConverter

- java.lang.Object
- - com.sun.jna.NativeMappedConverter

- All Implemented Interfaces:
    FromNativeConverter, ToNativeConverter, TypeConverter

      public class NativeMappedConverter
      extends java.lang.Object
      implements TypeConverter

  Provides type conversion for instances of `NativeMapped`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NativeMappedConverter(java.lang.Class<?> type)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NativeMapped` | `defaultValue()`
    `java.lang.Object` | `fromNative(java.lang.Object nativeValue, FromNativeContext context)` Convert the given native object into its Java representation using the given context.
    `static NativeMappedConverter` | `getInstance(java.lang.Class<?> cls)`
    `java.lang.Class<?>` | `nativeType()` Indicate the native type used by this converter.
    `java.lang.Object` | `toNative(java.lang.Object value, ToNativeContext context)` Convert a Java type to an appropriate native type.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NativeMappedConverter

          public NativeMappedConverter(java.lang.Class<?> type)

  - ### Method Detail

    - #### getInstance

          public static NativeMappedConverter getInstance(java.lang.Class<?> cls)

    - #### defaultValue

          public NativeMapped defaultValue()

    - #### fromNative

          public java.lang.Object fromNative(java.lang.Object nativeValue,
                                             FromNativeContext context)

      Description copied from interface: `FromNativeConverter`
      Convert the given native object into its Java representation using the given context.
      Specified by:
        `fromNative` in interface `FromNativeConverter`

    - #### nativeType

          public java.lang.Class<?> nativeType()

      Description copied from interface: `FromNativeConverter`
      Indicate the native type used by this converter.
      Specified by:
        `nativeType` in interface `FromNativeConverter`
      Specified by:
        `nativeType` in interface `ToNativeConverter`

    - #### toNative

          public java.lang.Object toNative(java.lang.Object value,
                                           ToNativeContext context)

      Description copied from interface: `ToNativeConverter`
      Convert a Java type to an appropriate native type. The new type must be one of the following classes:
      - `Pointer`
      - Boolean
      - Byte
      - Short
      - Character
      - Integer
      - `NativeLong`
      - Long
      - Float
      - Double
      - `Structure`
      - String
      - `WString`
      - `Buffer` (unsupported in direct mode)
      - primitive array (unsupported in direct mode)
      Specified by:
        `toNative` in interface `ToNativeConverter`

Copyright © 2007-2016 Timothy Wall. All Rights Reserved.