Using the Javadoc API without calling javadoc

Hi,

I am developing an application that needs to show to the user the methods and arguments of a Class. I saw that the Javadoc API has a set of methods that does that. However, I don't want to show to the user the HTML result; I want to use the Javadoc API to get the methods, so I will format then and show in my interface.

The only ways to execute the javadoc are by command line, or by using the Main class inside the code. Is there a way to develop an application that can use the Javadoc API without needing to call the javadoc?

For example, a small part of my code skeleton would be like that:

public class CodeAnalisys {

public String getMethods(String className) {

//use the Javadoc API to get all methods and parameters

//format the results

//return the formated results

}

}

Thanks

[864 byte] By [Emanuela] at [2007-10-2 13:15:55]
# 1

The Javadoc tool has a programmatic interface with overloads of public method "execute()" for invoking javadoc. However, it generates HTML files (rather than returning the results).

http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/standard-doclet.html#runningprogrammatically

Your program could import and parse the generated files, but their format is just HTML. Another alternative is to use an XML doclet: There are some choices at http://doclet.com/

-Doug

dhkramera at 2007-7-13 10:47:41 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...