Search code examples
javaantjavadoc

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

  • The default javadoc command line option is -protected, which generates only public and protected methods.

    To get package-private methods (as inc() is) you must specify -package or -private.

    Oracle Documentation: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#CHDCIFFD