David,
>I'm having trouble providing a jython implementation of a protected abstract
>method (I don't have the ability to change the protection -- it's in a
>provided framework). I've tried setting my registry value for
>python.security.RespectJavaAccessibility = false, but this hasn't helped.
Wasn't that without initial capital, ie .respectJavaAccessibility ?
However, you should not need it, see below.
>
>Here's my situation: In the following example, I need to provide an
>implementation for protectedAbstractMethod. This method is only used by
>other Java objects within the framework -- I never call it from jython.
>
>*** abstractClass.java ***
>package foo
>public abstract class abstractClass {
> public abstractClass (String a, String b) {
> //do construction here
> }
> protected abstract Stuff protectedAbstractMethod(String c, String
>d);
> //more stuff here
>}
>*** end abstractClass.java ***
>
>*** myClass.py***
>import package.abstractClass as abstractClass
>
>class myClass (abstractClass):
> def __init__(self,a,b):
> abstractClass.__init__(self,a,b)
>
> # implementation of 'protected abstract' method
> def protectedAbsctractMethod(self,c,d):
> # do some stuff
> return someStuff
>
># main
>myclassitem = myClass("red","green")
>myclass.run()
>*** end myClass.py***
>
>When I try to run myClass.py with jython, I get an exception saying that no
>implementation has been provided for protectedAbstractMethod.
You can use jythonc to put your jython class as a java class
in a/the java package. I'd put all other python code in another python module.
Good luck,
Ype
--
|