Make SWIG generated Java interface file not visible outside package
lille stor via Swig-user <[email protected]> Thu, 20 Jun 2024 11:20:46 +0200
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <trinity-aad62ca6-7cc1-48d2-9b51-128bdb3d8149-1718875246756@3c-app-mailcom-bs05> |
--===============6750713600312557248==
Content-Type: text/html; charset=UTF-8
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>I am using SWIG (version 4.2.1) to generate a Java wrapper for some C code. This C code has some constants that SWIG represents with the Java interface file below. As it stands, this interface can be accessed by classes outside the "abc" package because it is declared as "public".</div>
<div> </div>
<div>
<div> /* ----------------------------------------------------------------------------<br/>
* This file was automatically generated by SWIG (<a href="http://www.swig.org" target="_blank">http://www.swig.org</a>).<br/>
* Version 4.2.1<br/>
*<br/>
* Do not make changes to this file unless you know what you are doing--modify<br/>
* the SWIG interface file instead.<br/>
* ----------------------------------------------------------------------------- */</div>
<div> package abc;</div>
<div> public interface TestConstants {<br/>
public final static int YES = TestJNI.YES_get();<br/>
public final static int NO = TestJNI.NO_get();<br/>
public final static int ENABLED = TestJNI.ENABLED_get();<br/>
public final static int DISABLED = TestJNI.DISABLED_get();<br/>
}</div>
<div> </div>
</div>
<div> </div>
<div>How can I make this interface visible only to classes within the same package (i.e., change "public interface TestConstants" to just "interface TestConstants")? I have tried:</div>
<div> </div>
<div> %typemap(javainterfacemodifiers) SWIGTYPE "interface"</div>
<div> </div>
<div>... but it did not work. How can I achieve this using SWIG?</div>
<div> </div></div></body></html>
--===============6750713600312557248==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============6750713600312557248==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user
--===============6750713600312557248==--