From d6f5100b7363dc53e49b955b2de8d2d831544e9e Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 23 Jul 2004 21:53:04 +0000 Subject: [PATCH] throws typemaps added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6054 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Lib/java/std_string.i | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lib/java/std_string.i b/Lib/java/std_string.i index 31aef1338..7237cdda8 100644 --- a/Lib/java/std_string.i +++ b/Lib/java/std_string.i @@ -57,6 +57,11 @@ class string; %typemap(typecheck) string = char *; +%typemap(throws) string %{ + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); + return $null; +%} + // const string & %typemap(jni) const string & "jstring" %typemap(jtype) const string & "String" @@ -94,6 +99,11 @@ class string; %typemap(typecheck) const string & = char *; +%typemap(throws) const string & %{ + SWIG_JavaThrowException(jenv, SWIG_JavaRuntimeException, $1.c_str()); + return $null; +%} + } /* ------------------------------------------------------------------------