All Implemented Interfaces:
Configurable, Contextualizable

public class WriteTagCheck extends AbstractJavadocCheck
Requires user defined Javadoc tag to be present in Javadoc comment with defined format. To define the format for a tag, set property tagFormat to a regular expression. Violations are reported only when the configured tag is missing or when the tag content does not match tagFormat. No violation is reported when the tag is present and matches tagFormat (or when tagFormat is not configured). No violation reported in case there is no javadoc. To forbid tags instead of requiring them, use IllegalBlockTag.
Since:
4.2
  • Field Details

    • MSG_MISSING_TAG

      public static final String MSG_MISSING_TAG
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • MSG_TAG_FORMAT

      public static final String MSG_TAG_FORMAT
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • tagFormat

      private Pattern tagFormat
      Specify the regexp to match tag content.
    • tag

      private String tag
      Specify the name of tag.
    • tagFound

      private boolean tagFound
      Whether the target tag was found in the current Javadoc tree.
    • parentAst

      private DetailAST parentAst
      Parent AST for the missing tag report in the current Javadoc tree.
  • Constructor Details

    • WriteTagCheck

      public WriteTagCheck()
      Creates a new WriteTagCheck instance.
  • Method Details