Reputation: 232
I need to write a crawler to find sample java class,method and field usage. So I need a parser to parse a java source file (parsing of source code in incomplete form is much more better of course!) and return used classes, methods, fields in it.
public void methodName() { String s = new String("Test"); int x = s.lastIndexOf("st"); }
In this example, I want to get that String
class is used, its String(String)
constructor and its lastIndexOf(String)
method are called.
Upvotes: 0
Views: 318
Reputation: 75446
Considered writing a Javadoc doclet which can do what you need?
http://download.oracle.com/javase/1.5.0/docs/guide/javadoc/
Upvotes: 1