Search code examples
javajavadoc

File not showing in Javadoc


I have just made my first Javadoc for one of my files in a project. The package this file is in has 2 files, the LoginInformation file and the DBRequests file. For some reason when I open the javadoc all the files are there but the one with the Javadoc comments on it?

The way my code is structured is I have a load of packages, some with nested packages and then about 40 files altogether.

Just wondering if anyone can help, here is the code of the file that is not showing just incase I've done anything wrong:

package Database;
/**
 * This class <b>LoginInformation</b> contains methods for retrieving the required
 * login data for connection to the database
 * 
 */
abstract class LoginInformation {
    /**
     * URL of the database for connection
     */
    private final static String URL = "jdbc:mysql://localhost:3306/sql_employees";
    
    /**
     * SQL root username for database connection
     */
    private final static String USERNAME = "root";
    
    /**
     * Password of SQL root account for database connection
     */
    private final static String PASSWORD = "";
    
    
    /**
     * Returns the URL used for connection
     * 
     * @return URL of database
     */
    public static String getURL() {
        return URL;
    }
    
    /**
     * Returns the username of the SQL account
     * 
     * @return SQL account username
     */
    public static String getUsername() {
        return USERNAME;
    }
    
    /**
     * Returns the password of the SQL account
     * 
     * @return SQL account password
     */
    public static String getPassword() {
        return PASSWORD;
    }

}

Solution

  • Your class has default "package private" visibility. Javadoc by default generates documentation for public and protected access level API, but not for "package private" or private.

    You can make javadoc generate documentation for this access level with the -package command line switch.

    If you want to see private members documented too, use -private

    See also the full tool documentation: https://docs.oracle.com/javase/10/tools/javadoc.html