Add Swig::DirectorException directorthrows typemap for Java

For use with a global %catches(Swig::DirectorException)
This commit is contained in:
William S Fulton 2017-11-29 18:44:37 +00:00
commit 406c7a732a
2 changed files with 6 additions and 1 deletions

View file

@ -403,6 +403,7 @@ namespace Swig {
};
// Helper method to determine if a Java throwable matches a particular Java class type
// Note side effect of clearing any pending exceptions
SWIGINTERN bool ExceptionMatches(JNIEnv *jenv, jthrowable throwable, const char *classname) {
bool matches = false;

View file

@ -1051,11 +1051,15 @@ Swig::LocalRefGuard $1_refguard(jenv, $input); }
%{ SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1);
return $null; %}
// For directors to raise/throw the original Java exception
/* For methods to raise/throw the original Java exception thrown in a director method */
%typemap(throws) Swig::DirectorException
%{ $1.raiseJavaException(jenv);
return $null; %}
/* Java to C++ DirectorException should already be handled. Suppress warning and do nothing in the
event a user specifies a global: %catches(Swig::DirectorException); */
%typemap(directorthrows) Swig::DirectorException ""
/* Typemaps for code generation in proxy classes and Java type wrapper classes */
/* The javain typemap is used for converting function parameter types from the type