1 %module java_nspacewithoutpackage 2 3 %warnfilter(SWIGWARN_JAVA_NSPACE_WITHOUT_PACKAGE) TopLevel::Foo; 4 %warnfilter(SWIGWARN_JAVA_NSPACE_WITHOUT_PACKAGE) TopLevel::Bar; 5 6 %pragma(java) jniclasspackage="PragmaDefinedPackage" 7 8 SWIG_JAVABODY_PROXY(public, public, SWIGTYPE) 9 SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE) 10 11 %include <std_string.i> 12 13 %nspace TopLevel::Foo; 14 %nspace TopLevel::Bar; 15 16 %{ 17 #include <string> 18 %} 19 20 %inline %{ 21 22 namespace TopLevel 23 { 24 class Foo { 25 public: ~Foo()26 virtual ~Foo() {} ping()27 virtual std::string ping() { return "TopLevel::Foo::ping()"; } 28 }; 29 30 class Bar { 31 public: ~Bar()32 virtual ~Bar() {} pong()33 virtual std::string pong() { return "TopLevel::Bar::pong()"; } 34 }; 35 } 36 37 %} 38