'Why doesn't javadoc via ant show some of my method's doc?
i'm trying to generate some javadoc via ant for a small testproject but i don't really understand all of its behaviour. It seems that a lot of methods in my main class are left out and i don't really udnerstand why.
Here is an example:
/**
* Diese Methode deligiert die Ausfuehrung der zustandsabhaengigen Aktion an die entsprechende Methode
* des Zustandsobjektes weiter, welches gerade in der Objektvariable zustand gespeichert ist.
* @see SetMinutes
* @see SetHours
* @see DisplayTime
*/
void inc(){
zustand = zustand.inc(this);
}
This one isn't shown. My ant target looks like this:
<target name="doc" depends="generateJar">
<javadoc destdir="${doc.dir}">
<fileset dir="."/>
</javadoc>
</target>
The only methods being shown are the main method (which is documented) and a run() method (empty). What makes me wonder as well is that my documentation for methods in the other classes of the project are generated properly and i can't see the difference. (I have problems with generating a fields summary too but that's probably stuff for another question, isn't it?)
Any help would be appreciated.
Solution 1:[1]
EDITED: to fit Stefan Bodewigs comment.
With the hint of Jim Garrison i was able to figure out the solution which is as follows (i will also sum up what was already said to have everything in one post):
- default command line option of javadoc is -protected which won't generate javadoc for private and package private fields and methods
- if one wishes to automate this via ant we can use package="true" (or private="true" if one wishes to include those fields and methods, too)
Example:
<target name="doc" depends="generateJar"> <!--default option für javadoc ist -protected (siehe Web) daher fliegen im default package private methoden raus aus der doc-->
<javadoc destdir="${doc.dir}" package="true">
<fileset dir="."/>
</javadoc>
</target>
Solution 2:[2]
Change dirctory to the folder which contain your javacode. Compile the code. Then run the following Command.
javadoc -private -splitindex <(compiledclassfilename)>.java
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | procrastinator |
