Class SingleLineJavadocCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class SingleLineJavadocCheck
    extends AbstractJavadocCheck

    Checks that a Javadoc block can fit in 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.

    • Property violateExecutionOnNonTightHtml - Control when to print violations if the Javadoc being examined by this check violates the tight html rules defined at Tight-HTML Rules. Type is boolean. Default value is false.
    • Property ignoredTags - Specify at-clauses which are ignored by the check. Type is java.lang.String[]. Default value is "".
    • Property ignoreInlineTags - Control whether inline tags must be ignored. Type is boolean. Default value is true.

    To configure the check:

     <module name="SingleLineJavadoc"/>
     

    To configure the check with a list of ignored at-clauses and make inline at-clauses not ignored:

     <module name="SingleLineJavadoc">
       <property name="ignoredTags" value="@inheritDoc, @see"/>
       <property name="ignoreInlineTags" value="false"/>
     </module>
     

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • javadoc.missed.html.close
    • javadoc.parse.rule.error
    • javadoc.wrong.singleton.html.tag
    • singleline.javadoc
    Since:
    6.0
    • Field Detail

      • MSG_KEY

        public static final java.lang.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​(java.lang.String... tags)
        Setter to specify at-clauses which are ignored by the check.
        Parameters:
        tags - to be ignored by check.
      • setIgnoreInlineTags

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