Normally c++ has a header file, but I just want java to generate list of all classes/methods and save it as text file. This is one of the requirement for my reports.
Thanks
Normally c++ has a header file, but I just want java to generate list of all classes/methods and save it as text file. This is one of the requirement for my reports.
Thanks
Google reflections will generate a list of the classes in a specified package programmatically.
You could automatically generate Javadoc then copy it to text, if that fits you.
If you only want descriptions, then just generate Javadoc for the visibility level you want from Project -> Generate Javadoc
should be enough. It will give you the Javadoc in html format.
Also, writing Javadoc is a good habit; it could save you a lot of time for your next report.
If you have some time and appetite for creativity , you can create a small program , which will start from the root of your project , get the list of all file names and save to a text file.
Thanks Abhi
Others already suggested javadoc, a similar approach would be doxygen. When you want just plain text, just run javap
on all class files (you dont say which system you use, under unix you would do it with a find basedir -name *.class -exec javap {} ;
).
That should create exactly what you want.
javap is a utility from the sdk (Class File Disassembler).
Default is to print only public, package and protected classes and member, but if you want more (also private) or less (just public), you can contril it with command line switches.