File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes JavaDoc Reader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JavaDoc Reader" Watch "JavaDoc Reader" New topic

JavaDoc Reader

Rishita Pallavi

Joined: Jun 27, 2009
Posts: 7

I have a requirement to load class files/jars and then read javadoc from it.
How can this be done??

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Javadocs are generated from source files, not class files, so having the jar file is not sufficient. What's more, javadocs are generated from source code comments -which are not preserved in the class file- there's not even a theoretical way to generate them from class files.
Rishita Pallavi

Joined: Jun 27, 2009
Posts: 7
are you sure? But we use ant scrit to generate java docs from jars. We dont give Source file as input anywhere there.
So i am sure, javadoc gets preserved in the class files.
Just wan to know if there is any exising API solving the purpose.
John de Michele

Joined: Mar 09, 2009
Posts: 600

Sorry, but class files do not preserve comments. However, it is common practice (at least on open source projects, anyway) to jar up source code and/or javadocs. It sounds like that's what your ant build.xml file is doing.

I agree. Here's the link:
subject: JavaDoc Reader
It's not a secret anymore!