[Jorge Mireles J.]
>How can I access Java protected (static) members from a Jython subclass?
The short answer: you can't. At least not without setting the registry
option python.security.respectJavaAccessibility to false.
It is difficult to add in a nice manner. The problem is a bit like this:
A normal (public) static method is from jython called on the parent java
class:
javaclass.method()
Such a call does not originate from the subclass, but from internal
reflection code in jython. If we want to add support for calling
protected static methods from a jython subclass, the call will have to
originate from the subclass (ie. the proxy class), so we will have to
generate a referring method in subclass proxy like:
public static void method() {
javaclass.method()
}
(with the right return type and throws clauses) and the jython subclass
will have to call the method on its own class, not the java class.
A little more though is needed before I charge in and start making
modifications. Where have you seen this? I might be more inclined to add
this if it occur for some well known library.
regards,
finn
|