On Fri, 8 Aug 2008, Bill Janssen wrote:
I have a method in my API with the following signature:
public void something (java.util.List<java.net.URI> uris)
I'm trying to figure out how to call this from Python. I generated
the extension with --package java.util, but I can't seem to
instantiate an ArrayList:
Your method's signature uses java.util.List so, if you include --package
java.util (which you did), your method will not be ignored (wrappers will be
generated for it) as expected since java.util.List is found in java.util.
What --package java.util does is allow references to classes in that
package to be wrapped. But, nowhere do you reference java.util.ArrayList.
If you want that class wrapped as well, yet it is nowhere directly used in
any of your methods' signatures (or in the signatures on classes pulled in
by your methods' signatures) then you must request that that class be
wrapped explicitely by listing it on the command line.
Excerpt from JCC's README:
JCC generates wrappers for all public classes that are requested via the
command line or via the --jar command line argument. It generates wrapper
methods for all public methods and fields on these classes whose types are
found in one of the following ways:
- the type is one of the requested classes
- the type is one of the requested classes' superclass or implemented
interfaces
- the type is available from one of the packages listed via the
--package command line argument
JCC does not generate wrappers for methods or fields which don't satisfy
these requirements. Thus, JCC can avoid generating code for runaway
transitive closures of type dependencies.
That last condition, "the type is available from one of the packages listed
via the --package command line argument" is a little ambiguous. What it
means to say is that if you didn't list the type explicitely, yet it is
required by one of the classes you listed explicitely (or by --jar) or by
any of its dependencies, then it must be available in one of the --package
listed.
Andi..
_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev