Fix #2153773 - %nojavaexception - disabling and clearing Java checked exceptions
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10998 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7adb84f448
commit
e6f5cdac9f
7 changed files with 85 additions and 4 deletions
|
|
@ -1019,6 +1019,20 @@ but this will:
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
SWIG provides macros for disabling and clearing features. Many of these can be found in the <tt>swig.swg</tt> library file.
|
||||
The typical pattern is to define three macros; one to define the feature itself, one to disable the feature and one to clear the feature.
|
||||
The three macros below show this for the "except" feature:
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define %exception %feature("except")
|
||||
#define %noexception %feature("except","0")
|
||||
#define %clearexception %feature("except","")
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Customization_features_default_args"></a>11.3.4 Features and default arguments</H3>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3820,7 +3820,9 @@ public:
|
|||
In the example above, <tt>java.lang.Exception</tt> is a checked exception class and so ought to be declared in the throws clause of <tt>getitem</tt>.
|
||||
Classes can be specified for adding to the throws clause using <tt>%javaexception(classes)</tt> instead of <tt>%exception</tt>,
|
||||
where <tt>classes</tt> is a string containing one or more comma separated Java classes.
|
||||
The <tt>%nojavaexception</tt> feature is the equivalent to <tt>%noexception</tt> and clears previously declared exception handlers.
|
||||
The <tt>%clearjavaexception</tt> feature is the equivalent to <tt>%clearexception</tt> and clears previously declared exception handlers.
|
||||
The <tt>%nojavaexception</tt> feature is the equivalent to <tt>%noexception</tt> and disables the exception handler.
|
||||
See <a href="Customization.html#Customization_clearing_features">Clearing features</a> for the difference on disabling and clearing features.
|
||||
</p>
|
||||
|
||||
<div class="code">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue