Class SingleLineJavadocCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class SingleLineJavadocCheck
    extends AbstractJavadocCheck
    Checks that a JavaDoc block can fit on a single line and doesn't contain at-clauses. Javadoc comment that contains at least one at-clause should be formatted in a few lines.
    All inline at-clauses are ignored by default.

    The Check has the following properties:
    ignoredTags - allows to specify a list of at-clauses (including custom at-clauses) to be ignored by the check.
    ignoreInlineTags - whether inline at-clauses must be ignored.

    Default configuration:

     <module name="SingleLineJavadoc"/>
     
    To specify a list of ignored at-clauses and make inline at-clauses not ignored in general:
     <module name="SingleLineJavadoc">
         <property name="ignoredTags" value="@inheritDoc, @link"/>
         <property name="ignoreInlineTags" value="false"/>
     </module>
     
    • Field Detail

      • MSG_KEY

        public static final String MSG_KEY
        A key is pointing to the warning message text in "messages.properties" file.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SingleLineJavadocCheck

        public SingleLineJavadocCheck()
    • Method Detail

      • setIgnoredTags

        public void setIgnoredTags​(String... tags)
        Sets a list of tags to be ignored by check.
        Parameters:
        tags - to be ignored by check.
      • setIgnoreInlineTags

        public void setIgnoreInlineTags​(boolean ignoreInlineTags)
        Sets whether inline tags must be ignored.
        Parameters:
        ignoreInlineTags - whether inline tags must be ignored.