JavadocPackage

Since Checkstyle 5.0

Description

Checks that each Java package has a Javadoc file used for commenting. By default, it only allows a package-info.java file, but can be configured to allow a package.html file.

A violation will be reported if both files exist as this is not allowed by the Javadoc tool.

Properties

name description type default value since
allowLegacy Allow legacy package.html file to be used. boolean false 5.0
fileExtensions Specify the file extensions of the files to process. String[] .java 5.0

Examples

To configure the check:

<module name="Checker">
  <module name="JavadocPackage"/>
</module>
        

To configure the check to use legacy package.html file when package-info.java file is absent:

<module name="JavadocPackage">
  <property name="allowLegacy" value="true"/>
</module>
        

Example of Usage

Violation Messages

All messages can be customized if the default message doesn't suit you. Please see the documentation to learn how to.

Package

com.puppycrawl.tools.checkstyle.checks.javadoc

Parent Module

Checker