I guess you'll have to be a bit more specific, as to what you want to achieve. Do you want to
* annotate a method on a jython subclass (parent class is java)?
* access the annotation of a method (or class) declared in the java superclass (or somewhere else).
The first case is probably not solved yet (at least according
to the bugtracker [1], that means that there's no possibility to
declare annotations in your Jython code
The second case can be achieved with generics, just as you would in Java (your annotations have to be declared with RetentionPolicy.RUNTIME). Check [2] for a good summary.
Summary: Declaration inside Jython is probably not going to work, Access at runtime can be achieved in the same way as in Java, through Reflection (it's a Java class, not even a Jython class).
Cheers,
Daniel
[1]
http://bugs.jython.org/issue1080[2]
http://www.eclipse.org/aspectj/doc/released/adk15notebook/annotations.html#annotations-inJava5
On Sun, May 31, 2009 at 4:02 PM, James Deng
<jtdeng@...> wrote:
Hi all
As title, How to use java annotations in a jython subclass?
I am using Jython 2.5rc3 on jdk 1.6
thanks!
BRs//James Deng
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com
_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship.
http://p.sf.net/sfu/creativitycat-com _______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users