Mods for new java typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5971 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c847c0d468
commit
b4b81a3347
3 changed files with 26 additions and 15 deletions
|
|
@ -7,7 +7,7 @@
|
|||
import java.lang.*; // For Exception
|
||||
%}
|
||||
|
||||
%pragma(java) jniclassclassmodifiers="public"
|
||||
%pragma(java) jniclassclassmodifiers="public class"
|
||||
%pragma(java) jniclassbase="Exception"
|
||||
%pragma(java) jniclassinterfaces="Cloneable"
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ import java.lang.*; // For Exception
|
|||
import java.io.*; // For Serializable
|
||||
%}
|
||||
|
||||
%pragma(java) moduleclassmodifiers="public final"
|
||||
%pragma(java) moduleclassmodifiers="public final class"
|
||||
%pragma(java) modulebase="Object"
|
||||
%pragma(java) moduleinterfaces="Serializable"
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
// BigDecimal requires the java.math library
|
||||
}
|
||||
%}
|
||||
%typemap(javaclassmodifiers) NS::Farewell "public final";
|
||||
%typemap(javaclassmodifiers) NS::Farewell "public final class";
|
||||
|
||||
%typemap(javaimports) NS::Greeting %{
|
||||
import java.util.*; // for EventListener
|
||||
|
|
@ -28,8 +28,17 @@ import java.lang.*; // for Exception
|
|||
}
|
||||
%}
|
||||
|
||||
// Create a new getCPtr() function which takes Java null
|
||||
%typemap(javagetcptr) NS::Greeting %{
|
||||
// Create a new getCPtr() function which takes Java null and is public
|
||||
// Make the pointer constructor public
|
||||
%typemap(javabody) NS::Greeting %{
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
|
||||
public $javaclassname(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
public static long getCPtr($javaclassname obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
|
|
@ -38,9 +47,6 @@ import java.lang.*; // for Exception
|
|||
// get rid of the finalize method for NS::Farewell
|
||||
%typemap(javafinalize) NS::Farewell "";
|
||||
|
||||
// Make the pointer constructor public
|
||||
%typemap(javaptrconstructormodifiers) NS::Farewell "public";
|
||||
|
||||
// Test typemaps are being found for templated classes
|
||||
%typemap(javacode) NS::Adieu<int**> %{
|
||||
public static void adieu() {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// BigDecimal requires the java.math library
|
||||
}
|
||||
%}
|
||||
%typemap(javaclassmodifiers) Farewell * "public final";
|
||||
%typemap(javaclassmodifiers) Farewell * "public final class";
|
||||
|
||||
%typemap(javaimports) Greeting * %{
|
||||
import java.util.*; // for EventListener
|
||||
|
|
@ -35,17 +35,22 @@ import java.lang.*; // for Exception
|
|||
}
|
||||
%}
|
||||
|
||||
// Create a new getCPtr() function which takes Java null
|
||||
%typemap(javagetcptr) Farewell * %{
|
||||
// Create a new getCPtr() function which takes Java null and is public
|
||||
// Make the pointer constructor public
|
||||
%typemap(javabody) Farewell * %{
|
||||
private long swigCPtr;
|
||||
protected boolean swigCMemOwn;
|
||||
|
||||
public $javaclassname(long cPtr, boolean cMemoryOwn) {
|
||||
swigCMemOwn = cMemoryOwn;
|
||||
swigCPtr = cPtr;
|
||||
}
|
||||
|
||||
public static long getCPtr($javaclassname obj) {
|
||||
return (obj == null) ? 0 : obj.swigCPtr;
|
||||
}
|
||||
%}
|
||||
|
||||
// Make the pointer constructor public
|
||||
%typemap(javaptrconstructormodifiers) Farewell * "public";
|
||||
|
||||
|
||||
%{
|
||||
class Greeting {};
|
||||
class Farewell {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue