Reputation: 2363
I have a case where I would like to generate a javadoc in the following manner.
This is very easy to do using the Generate Javadoc tool in Eclipse, but it has been requested that Javadoc generation for this case use the command line or batch script instead of the Eclipse GUI.
After reading through the following link
http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#runningjavadoc
I understand how I can use the javadoc tool from the command line but it does not tell me how I would select which type of methods to document, and it also appears that I will have to list each class.
My questions are as follows,
Upvotes: 1
Views: 1086
Reputation: 51473
You can let eclipse generate an ant build file. Then you can use this ant build file from the command line.
Upvotes: 2
Reputation: 31658
from the javadoc helptext you can use these flags/parameters:
-public Show only public classes and members
-protected Show protected/public classes and members (default)
-package Show package/protected/public classes and members
-private Show all classes and members
-help Display command line options and exit
-doclet <class> Generate output via alternate doclet
-docletpath <path> Specify where to find doclet class files
-sourcepath <pathlist> Specify where to find source files
-classpath <pathlist> Specify where to find user class files
-exclude <pkglist> Specify a list of packages to exclude
-subpackages <subpkglist> Specify subpackages to recursively load
Alternatively, you can use a build tool like ant or maven to generate the javadoc for you which have nice wrapped functions. Here is the ant javadoc target for one of my projects:
<target name="javadoc" description = "generate javadoc from source">
<delete dir="javadoc" verbose ="true"/>
<javadoc packagenames ="my.app.*"
sourcepathref = "javadoc.sourcepath"
author ="true"
destdir = "javadoc"
windowtitle = "${project-name} API"
linksource= "yes"
overview="${src}/overview-summary.html"
access="public">
</javadoc>
</target>
Upvotes: 0