NativeMapped (JNA API)
Description: declaration: package: com.sun.jna, interface: NativeMapped

Package com.sun.jna

# Interface NativeMapped

All Known Implementing Classes:
  `BaseTSD.DWORD_PTR`, `BaseTSD.LONG_PTR`, `BaseTSD.SIZE_T`, `BaseTSD.SSIZE_T`, `BaseTSD.ULONG_PTR`, `BaseTSD.ULONG_PTRByReference`, `ByReference`, `ByteByReference`, `COMBindingBaseObject`, `COMEarlyBindingObject`, `COMInvoker`, `COMLateBindingObject`, `ConnectionPoint`, `ConnectionPointContainer`, `CoreFoundation.CFAllocatorRef`, `CoreFoundation.CFArrayRef`, `CoreFoundation.CFBooleanRef`, `CoreFoundation.CFDataRef`, `CoreFoundation.CFDictionaryRef`, `CoreFoundation.CFDictionaryRef.ByReference`, `CoreFoundation.CFIndex`, `CoreFoundation.CFMutableDictionaryRef`, `CoreFoundation.CFNumberRef`, `CoreFoundation.CFStringRef`, `CoreFoundation.CFStringRef.ByReference`, `CoreFoundation.CFTypeID`, `CoreFoundation.CFTypeRef`, `Ddeml.HCONV`, `Ddeml.HCONVLIST`, `Ddeml.HDDEDATA`, `Ddeml.HSZ`, `DiskArbitration.DADiskRef`, `DiskArbitration.DASessionRef`, `Dispatch`, `Dispatch.ByReference`, `DoubleByReference`, `EnumMoniker`, `EnumVariant`, `FloatByReference`, `Guid.REFIID`, `HighLevelMonitorConfigurationAPI.MC_COLOR_TEMPERATURE.ByReference`, `HighLevelMonitorConfigurationAPI.MC_DISPLAY_TECHNOLOGY_TYPE.ByReference`, `IntByReference`, `IntegerType`, `IOKit.IOConnect`, `IOKit.IOIterator`, `IOKit.IOObject`, `IOKit.IORegistryEntry`, `IOKit.IOService`, `Kstat2.Kstat2Handle`, `Kstat2.Kstat2Map`, `Kstat2.Kstat2MatcherList`, `LibCAPI.size_t`, `LibCAPI.size_t.ByReference`, `LibCAPI.ssize_t`, `LongByReference`, `LowLevelMonitorConfigurationAPI.MC_VCP_CODE_TYPE.ByReference`, `Moniker`, `Moniker.ByReference`, `NativeLong`, `NativeLongByReference`, `OaIdl._VARIANT_BOOL`, `OaIdl._VARIANT_BOOLByReference`, `OaIdl.DISPID`, `OaIdl.DISPIDByReference`, `OaIdl.HREFTYPE`, `OaIdl.HREFTYPEByReference`, `OaIdl.MEMBERID`, `OaIdl.MEMBERIDByReference`, `OaIdl.VARIANT_BOOL`, `OaIdl.VARIANT_BOOLByReference`, `PointerByReference`, `PointerType`, `RecordInfo`, `RecordInfo.ByReference`, `RunningObjectTable`, `RunningObjectTable.ByReference`, `ShortByReference`, `Structure.FFIType.size_t`, `TypeComp`, `TypeComp.ByReference`, `TypeInfo`, `TypeInfo.ByReference`, `TypeLib`, `TypeLib.ByReference`, `Udev.UdevContext`, `Udev.UdevDevice`, `Udev.UdevEnumerate`, `Udev.UdevListEntry`, `Unknown`, `Unknown.ByReference`, `Wbemcli.IEnumWbemClassObject`, `Wbemcli.IWbemClassObject`, `Wbemcli.IWbemContext`, `Wbemcli.IWbemLocator`, `Wbemcli.IWbemQualifierSet`, `Wbemcli.IWbemServices`, `WinBase.DCB.DCBControllBits`, `WinCrypt.CertStoreProviderName`, `WinCrypt.HCERTCHAINENGINE`, `WinCrypt.HCERTSTORE`, `WinCrypt.HCRYPTMSG`, `WinCrypt.HCRYPTPROV_LEGACY`, `WinDef.ATOM`, `WinDef.BOOL`, `WinDef.BOOLByReference`, `WinDef.BYTE`, `WinDef.CHAR`, `WinDef.CHARByReference`, `WinDef.DWORD`, `WinDef.DWORDByReference`, `WinDef.DWORDLONG`, `WinDef.HBITMAP`, `WinDef.HBRUSH`, `WinDef.HCURSOR`, `WinDef.HDC`, `WinDef.HFONT`, `WinDef.HGLRC`, `WinDef.HGLRCByReference`, `WinDef.HICON`, `WinDef.HINSTANCE`, `WinDef.HKL`, `WinDef.HMENU`, `WinDef.HMODULE`, `WinDef.HPALETTE`, `WinDef.HPEN`, `WinDef.HRGN`, `WinDef.HRSRC`, `WinDef.HWND`, `WinDef.INT_PTR`, `WinDef.LCID`, `WinDef.LONG`, `WinDef.LONGByReference`, `WinDef.LONGLONG`, `WinDef.LONGLONGByReference`, `WinDef.LPARAM`, `WinDef.LPVOID`, `WinDef.LRESULT`, `WinDef.PVOID`, `WinDef.SCODE`, `WinDef.SCODEByReference`, `WinDef.SHORT`, `WinDef.UCHAR`, `WinDef.UINT`, `WinDef.UINT_PTR`, `WinDef.UINTByReference`, `WinDef.ULONG`, `WinDef.ULONGByReference`, `WinDef.ULONGLONG`, `WinDef.ULONGLONGByReference`, `WinDef.USHORT`, `WinDef.USHORTByReference`, `WinDef.WORD`, `WinDef.WORDByReference`, `WinDef.WPARAM`, `Winevt.EVT_HANDLE`, `WinNT.HANDLE`, `WinNT.HANDLEByReference`, `WinNT.HRESULT`, `WinNT.PACLByReference`, `WinNT.PSIDByReference`, `WinReg.HKEY`, `WinReg.HKEYByReference`, `Winsvc.SC_HANDLE`, `Winsvc.SERVICE_STATUS_HANDLE`, `WinUser.HDEVNOTIFY`, `WinUser.HHOOK`, `WinUser.HMONITOR`, `WTypes.BSTR`, `WTypes.BSTRByReference`, `WTypes.LPOLESTR`, `WTypes.LPOLESTR.ByReference`, `WTypes.LPSTR`, `WTypes.LPSTR.ByReference`, `WTypes.LPWSTR`, `WTypes.LPWSTR.ByReference`, `WTypes.VARTYPE`, `WTypes.VARTYPEByReference`, `X11.Atom`, `X11.AtomByReference`, `X11.Colormap`, `X11.Cursor`, `X11.Display`, `X11.Drawable`, `X11.Font`, `X11.GC`, `X11.KeySym`, `X11.Pixmap`, `X11.Screen`, `X11.Visual`, `X11.VisualID`, `X11.Window`, `X11.WindowByReference`, `X11.XID`, `X11.XImage`, `X11.Xrender.PictFormat`, `XAttr.size_t`, `XAttr.ssize_t`

public interface NativeMapped
Provide conversion for a Java type to and from a native type. `Function` and `Structure` will use this interface to determine how to map a given Java object into a native type.

Implementations of this interface must provide a no-args constructor.

See `ToNativeConverter` for a list of allowable native types.

Author:
  wmeissner

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `fromNative(Object nativeValue, FromNativeContext context)`
  Convert the given native object into its Java representation using the given context.
  `Class<?>`
  `nativeType()`
  Indicate the native type used by this converter.
  `Object`
  `toNative()`
  Convert this object into a supported native type.

- ## Method Details

  - ### fromNative

    Object fromNative(Object nativeValue, FromNativeContext context)
    Convert the given native object into its Java representation using the given context.
    Parameters:
      `nativeValue` - Java representation of the native type to be converted.
      `context` - Context in which the conversion is taking place.
    Returns:
      Converted object.

  - ### toNative

    Object toNative()
    Convert this object into a supported native type.
    Returns:
      Java representation of the original Java object converted to a native type.

  - ### nativeType

    Class<?> nativeType()
    Indicate the native type used by this converter.
    Returns:
      Java class representation of the native type.