jnr.ffi
Class Library

java.lang.Object
  extended by jnr.ffi.Library

public final class Library
extends java.lang.Object


Method Summary
static void addLibraryPath(java.lang.String libraryName, java.io.File path)
          Adds a custom search path for a library
static Library getInstance(java.lang.String libraryName)
           
static java.util.List<java.lang.String> getLibraryPath(java.lang.String libraryName)
          Gets the custom search path for a library.
 java.lang.String getName()
          Gets the name of this library
static Runtime getRuntime(java.lang.Object obj)
           
static
<T> T
loadLibrary(java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions, java.lang.String... libraryNames)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
static
<T> T
loadLibrary(java.lang.Class<T> interfaceClass, java.lang.String... libraryNames)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
static
<T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
static
<T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions)
          Loads a native library and links the methods defined in interfaceClass to native methods in the library.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRuntime

public static final Runtime getRuntime(java.lang.Object obj)

loadLibrary

public static <T> T loadLibrary(java.lang.String libraryName,
                                java.lang.Class<T> interfaceClass)
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Parameters:
libraryName - the name of the library to load
interfaceClass - the interface that describes the native library interface
Returns:
an instance of interfaceclass that will call the native methods.

loadLibrary

public static <T> T loadLibrary(java.lang.Class<T> interfaceClass,
                                java.lang.String... libraryNames)
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Parameters:
libraryName - the name of the library to load
interfaceClass - the interface that describes the native library interface
Returns:
an instance of interfaceclass that will call the native methods.

loadLibrary

public static <T> T loadLibrary(java.lang.String libraryName,
                                java.lang.Class<T> interfaceClass,
                                java.util.Map<LibraryOption,?> libraryOptions)
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Parameters:
libraryName - the name of the library to load
interfaceClass - the interface that describes the native library interface
libraryOptions - options
Returns:
an instance of interfaceclass that will call the native methods.

loadLibrary

public static <T> T loadLibrary(java.lang.Class<T> interfaceClass,
                                java.util.Map<LibraryOption,?> libraryOptions,
                                java.lang.String... libraryNames)
Loads a native library and links the methods defined in interfaceClass to native methods in the library.

Parameters:
libraryName - the name of the library to load
interfaceClass - the interface that describes the native library interface
libraryOptions - options
Returns:
an instance of interfaceclass that will call the native methods.

addLibraryPath

public static final void addLibraryPath(java.lang.String libraryName,
                                        java.io.File path)
Adds a custom search path for a library

Parameters:
libraryName - the name of the library to search for
path - the path to search for the library in

getLibraryPath

public static java.util.List<java.lang.String> getLibraryPath(java.lang.String libraryName)
Gets the custom search path for a library.

Parameters:
libraryName - The library to retrieve the path for.
Returns:
A List of String instances.

getInstance

public static final Library getInstance(java.lang.String libraryName)

getName

public java.lang.String getName()
Gets the name of this library

Returns:
The name of this library as a String


Copyright © 2012. All Rights Reserved.