On Thu, Jan 10, 2002 at 06:16:00PM -0500, Justin Sheehy wrote:
| Hello,
|
| I am an experienced Python programmer, and I have written a few Java
| programs before. I am making my first foray into Jython now.
|
| I need to interact with an already-existing Java system.
|
| What would be best is if I could create the following:
|
| 1 - A module named "Spam"
|
| 2 - Containing a class definition for the class "Spam".
|
| 3 - Where the class exposes several public static methods.
|
| Obviously, (3) is the problem. Class static methods aren't really
| normal or usefully supported by Python.
Rigth.
| Is there some way that a Jython class can expose public static class
| methods to Java modules?
No.
| Perhaps I should write the Python module and then write a Java adapter
| to provide the proper interface?
You can either create an instance of the class to invoke methods on,
or make an adapter in java that hides the java<->python interface
differences.
-D
--
Come to me, all you who are weary and burdened, and I will give you
rest. Take my yoke upon you and learn from me, for I am gentle and
humble in heart, and you will find rest for your souls. For my yoke
is easy and my burden is light.
Matthew 11:28-30
|