1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
/******************************************************************************
* $Id: gdalconst_java.i 21579 2011-01-24 21:57:24Z rouault $
*
* Name: gdalconst_java.i
* Project: GDAL SWIG Interface
* Purpose: Typemaps for Java bindings
* Author: Benjamin Collins, The MITRE Corporation
*
*
* $Log$
* Revision 1.2 2006/02/16 17:21:12 collinsb
* Updates to Java bindings to keep the code from halting execution if the native libraries cannot be found.
*
* Revision 1.1 2006/02/02 20:56:07 collinsb
* Added Java specific typemap code
*
*
*/
%pragma(java) jniclasscode=%{
private static boolean available = false;
static {
try {
System.loadLibrary("gdalconstjni");
available = true;
} catch (UnsatisfiedLinkError e) {
available = false;
System.err.println("Native library load failed.");
System.err.println(e);
}
}
public static boolean isAvailable() {
return available;
}
%}
/* This hacks turns the gdalconstJNI class into a package private class */
%pragma(java) jniclassimports=%{
%}
%pragma(java) modulecode=%{
/* Uninstanciable class */
private gdalconst()
{
}
%}
%include typemaps_java.i
|