diff options
author | Brant K. Kyser <brantkyser@gmail.com> | 2013-01-14 13:11:42 -0600 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2013-01-17 08:13:04 +0000 |
commit | 20ce05f9548e1bc69bdd2a45f3032e45288f8075 (patch) | |
tree | 3aaac1ac87ed5a7291c304b593d9d83cd9306f41 | |
parent | 7104b20d0d805972d59c5acc89dfb6d42b2e7ffa (diff) | |
download | swig-20ce05f9548e1bc69bdd2a45f3032e45288f8075.tar.gz |
Update documentation regarding the use of the nspace feature in java without the -package commandline option.
-rw-r--r-- | Doc/Manual/Java.html | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index 858342c43..e8777fbe3 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -1923,19 +1923,10 @@ The default behaviour described above can be improved via the <a href="SWIGPlus. Note that it only works for classes, structs, unions and enums declared within a named C++ namespace. 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 must 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 the following error message: +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. </p> -<div class="shell"> -<pre> -example.i:16: Error: The nspace feature used on 'MyWorld::Material::Color' is not supported unless -a package is specified -with -package - Java does not support types declared in a named package accessing types declared -in an unnamed package. -</pre> -</div> - <p> If the resulting use of the nspace feature and hence packages results in a proxy class in one package deriving or using a proxy class from another package, you will need to open up the visibility for the pointer constructor and <tt>getCPtr</tt> method from the default 'protected' to 'public' with the <tt>SWIG_JAVABODY_PROXY</tt> macro. See <a href="#Java_code_typemaps">Java code typemaps</a>. @@ -2226,6 +2217,9 @@ The intermediary JNI class can be tailored through the use of pragmas, but is no <td>jniclassbase </td> <td>Base class for the intermediary JNI class</td> </tr> <tr> + <td>jniclasspackage </td> <td>Package in which to place the intermediary JNI class</td> +</tr> +<tr> <td>jniclassclassmodifiers </td> <td>Class modifiers and class type for the intermediary JNI class</td> </tr> <tr> |