|
|
-
subclassing Python classes in Java
Bill Janssen 2011-02-16, 17:39
How do I subclass a Python class in a JCC-wrapped Java module?
In UpLib, I've got a class, uplib.ripper.Ripper, and I'd like to be able to create a Java subclass for that in my module. I presume I need a Java interface for that Python class, but how do I hook the two together so that the Java subclass can inherit from the Python class?
Bill
+
Bill Janssen 2011-02-16, 17:39
-
Re: subclassing Python classes in Java
Andi Vajda 2011-02-16, 18:18
On Feb 16, 2011, at 9:39, Bill Janssen <[EMAIL PROTECTED]> wrote:
> How do I subclass a Python class in a JCC-wrapped Java module?
- define a Java class with native methods - using the usual "extension" tricks have a Python class implement these native methods - define a subclass of that Java class so as to inherit these native implementations
Andi..
> > In UpLib, I've got a class, uplib.ripper.Ripper, and I'd like to be > able > to create a Java subclass for that in my module. I presume I need a > Java interface for that Python class, but how do I hook the two > together so that the Java subclass can inherit from the Python class? > > Bill
+
Andi Vajda 2011-02-16, 18:18
-
Re: subclassing Python classes in Java
Bill Janssen 2011-02-16, 19:08
Andi Vajda <[EMAIL PROTECTED]> wrote:
> On Feb 16, 2011, at 9:39, Bill Janssen <[EMAIL PROTECTED]> wrote: > > > How do I subclass a Python class in a JCC-wrapped Java module? > > - define a Java class with native methods > - using the usual "extension" tricks have a Python class implement > these native methods > - define a subclass of that Java class so as to inherit these native > implementations
Yes, that's what I thought. Almost too painful to consider, I'm afraid.
I was thinking of a more dynamic solution, using reflection, but that seems a bit error-prone. Problematic contrast beween the cheerful dynamism of Python and the stern determinism of Java.
Bill
+
Bill Janssen 2011-02-16, 19:08
|
|
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by
Sematext