I want to get a .java file, recognize the first class in the file, and get information开发者_JAVA百科 about annotations, methods and attributes from this class.
Is there any module in both languages that already does that? I could build up a simple regexp to do it also, but I don't known how to recognize in the regexp the braces indicating the end of the class/method.
If you load the java classes inside Jython you probably could use introspection to find the information you need.
Why are you trying this in perl/python rather than just using a javadoc-aware program that can pull out the info?
I would suggest Inline::Java for accessing Java class from Perl,Once you have that interface running, you can easily access methods and attributes from the class.
精彩评论