summaryrefslogtreecommitdiff
path: root/Doc/Manual/Java.html
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2013-01-19 00:58:56 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2013-01-19 00:58:56 +0000
commitbd3e93ae61fb74d5a338eac884c1e61eb64d6234 (patch)
treeb16243deb2fb99a926f7e437d73fa27aef7f3c68 /Doc/Manual/Java.html
parent36ce54da8d46b340947940c202dd87a343153b63 (diff)
downloadswig-bd3e93ae61fb74d5a338eac884c1e61eb64d6234.tar.gz
Tidy up last few commits for Java new jniclasspackage pragma
Diffstat (limited to 'Doc/Manual/Java.html')
-rw-r--r--Doc/Manual/Java.html16
1 files changed, 15 insertions, 1 deletions
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html
index e8777fbe3..8245d46eb 100644
--- a/Doc/Manual/Java.html
+++ b/Doc/Manual/Java.html
@@ -1924,7 +1924,21 @@ Note that it only works for classes, structs, unions and enums declared within a
When the nspace feature is used, the C++ namespaces are converted into Java packages of the same name.
Proxy classes are thus declared within a package and this proxy makes numerous calls to the JNI intermediary class which is declared in the unnamed package by default.
As Java does not support types declared in a named package accessing types declared in an unnamed package, the <tt>-package</tt> commandline option described earlier generally should be used to provide a parent package.
-So if SWIG is run using the <tt>-package com.myco</tt> option, a wrapped class, <tt>MyWorld::Material::Color</tt>, can then be accessed as <tt>com.myco.MyWorld.Material.Color</tt>. If you don't specify a package, you will get a warning 186. If it is undesirable to have a single top level package, the nspace feature may be used without the <tt>-package<tt> commandline option (and the resulting warning ignored) if all of the types exposed using Swig are placed in a package using the nspace feature and the jniclasspackage pragma is used to specify a package for the JNI intermediate class.
+So if SWIG is run using the <tt>-package com.myco</tt> option, a wrapped class, <tt>MyWorld::Material::Color</tt>, can then be accessed as <tt>com.myco.MyWorld.Material.Color</tt>.
+If you don't specify a package, you will get the following warning:
+</p>
+
+<div class="shell">
+<pre>
+example.i:16: Warning 826: The nspace feature is used on 'MyWorld::Material::Color' without -package. The generated code
+may not compile as Java does not support types declared in a named package accessing types declared in an unnamed package.
+</pre>
+</div>
+
+<p>
+If it is undesirable to have a single top level package, the nspace feature may be used without the <tt>-package</tt> commandline option
+(and the resulting warning ignored) if all of the types exposed using SWIG are placed in a package using the nspace feature and the
+'jniclasspackage' pragma is used to specify a package for the JNI intermediary class.
</p>
<p>