Package jnr.ffi
Class Library
- java.lang.Object
-
- jnr.ffi.Library
-
public final class Library extends java.lang.Object
Deprecated.UseLibraryLoader
instead.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addLibraryPath(java.lang.String libraryName, java.io.File path)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.static Library
getInstance(java.lang.String libraryName)
Deprecated.static java.util.List<java.lang.String>
getLibraryPath(java.lang.String libraryName)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.java.lang.String
getName()
Deprecated.static Runtime
getRuntime(java.lang.Object library)
Deprecated.static <T> T
loadLibrary(java.lang.Class<T> interfaceClass, java.lang.String... libraryNames)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.static <T> T
loadLibrary(java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions, java.lang.String... libraryNames)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.static <T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.static <T> T
loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass, java.util.Map<LibraryOption,?> libraryOptions)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.
-
-
-
Method Detail
-
getRuntime
public static Runtime getRuntime(java.lang.Object library)
Deprecated.Gets theRuntime
that loaded the library interface.- Parameters:
library
- A library implementation as returned fromLibraryLoader.load()
- Returns:
- The runtime that loaded the library.
-
loadLibrary
public static <T> T loadLibrary(java.lang.String libraryName, java.lang.Class<T> interfaceClass)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClass
to native methods in the library.- Type Parameters:
T
- the interface class.- Parameters:
libraryName
- the name of the library to loadinterfaceClass
- 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)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClass
to native methods in the library.- Type Parameters:
T
- the interface type.- Parameters:
libraryNames
- the name of the library to loadinterfaceClass
- 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)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClass
to native methods in the library.- Type Parameters:
T
- the interface type.- Parameters:
libraryName
- the name of the library to loadinterfaceClass
- the interface that describes the native library interfacelibraryOptions
- 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)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Loads a native library and links the methods defined ininterfaceClass
to native methods in the library.- Type Parameters:
T
- the interface type.- Parameters:
libraryNames
- the name of the library to loadinterfaceClass
- the interface that describes the native library interfacelibraryOptions
- options- Returns:
- an instance of
interfaceclass
that will call the native methods.
-
addLibraryPath
public static void addLibraryPath(java.lang.String libraryName, java.io.File path)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Adds a custom search path for a library- Parameters:
libraryName
- the name of the library to search forpath
- the path to search for the library in
-
getLibraryPath
public static java.util.List<java.lang.String> getLibraryPath(java.lang.String libraryName)
Deprecated.seeLibraryLoader
for the preferred interface to loading libraries.Gets the custom search path for a library.- Parameters:
libraryName
- The library to retrieve the path for.- Returns:
- A
List
ofString
instances.
-
getInstance
@Deprecated public static Library getInstance(java.lang.String libraryName)
Deprecated.
-
getName
@Deprecated public java.lang.String getName()
Deprecated.
-
-