Java Reference
In-Depth Information
* The value of DIVISOR is {@value}.
*/
public final static int DIVISOR = 1000;
}
The following is the generated documentation comment that shows the effects of using
{@value}
tag:
MULTIPLIER
public static final int MULTIPLIER
The MULTIPLIER is 2000
DIVISOR
public static final int DIVISOR
The value of MULTIPLIER is
2000
. The value of DIVISOR is 1000.
Documenting Packages
A package declaration appears multiple times in an application. There needs to be a simpler and separate way to
document a package. You can document a package by placing either of the following two files, but not both, in the
package directory along with the source files (
.java
files):
package-info.java
•
package.html
•
■
Tip
if both
package-info.java
and
package.html
files are available, the
package-info.java
file is used.
When you run the
javadoc
tool, it automatically uses the documentation in one of these two files as the
documentation for your package. The
package-info.java
file was introduced in JDK5.0. The first sentence of the
package documentation should be a summary statement about the package. The first sentence of the package
documentation is displayed in the package summary description.
com/jdojo/utility/package-info.java file
It contains the package declaration with documentation comments for a package. In
package-info.java
file, a package
is documented the same way any other program elements are documented. The content of the
package-info.java
file for
com.jdojo.utility
package is as follows:
/**
* Contains utility classes. More description for
* com.jdojo.utility package goes here.
* @since 1.1
* @version 1.9
*/
package com.jdojo.utility;