Class NonEmptyAtclauseDescriptionCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class NonEmptyAtclauseDescriptionCheck
    extends AbstractJavadocCheck

    Checks that the block tag is followed by description.

    To configure the default check that will check @param, @deprecated, @throws, @return:

     <module name="NonEmptyAtclauseDescription"/>
     

    Example:

     class Test
     {
      // Violation for param "b" and at tags "deprecated", "throws" and "return".
      /**
      * Some summary.
      * @param a Some description
      * @param b
      * @deprecated
      * @throws Exception
      * @return
      */
     public int method(String a, int b) throws Exception {
       return 1;
      }
     }
     

    To configure the check to validate @param, @throws tags:

     <module name="NonEmptyAtclauseDescription">
       <property name="javadocTokens" value="PARAM_LITERAL,THROWS_LITERAL"/>
      </module>
     

    Example:

     class Test
     {
      // Violation for param "b" and at tag "throws".
      /**
      * Some summary.
      * @param a Some description
      * @param b
      * @deprecated
      * @throws Exception
      * @return
      */
     public int method(String a, int b) throws Exception {
       return 1;
      }
     }
     

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • javadoc.missed.html.close
    • javadoc.parse.rule.error
    • javadoc.wrong.singleton.html.tag
    • non.empty.atclause
    Since:
    6.0