user5793565
user5793565

Reputation: 109

SWIG generate Java wrapper private method

Given the following SWIG interface file:

%module abc
%{
    extern int my_function(int number);
%}

extern int my_function(int number);

It will generate the following public static Java wrapper method:

public static int my_function(int number)
{
    return abcJNI.my_function(number);
}

How can one have this Java method being generated as private such as this:

private static int my_function(int number)
{
    return abcJNI.my_function(number);
}

Upvotes: 1

Views: 262

Answers (1)

user5793565
user5793565

Reputation: 109

Solved by including the following line in the SWIG interface file:

%javamethodmodifiers my_function(int) "private";

Upvotes: 2

Related Questions