Class JavadocMissingLeadingAsteriskCheck

All Implemented Interfaces:
Configurable, Contextualizable

public class JavadocMissingLeadingAsteriskCheck extends AbstractJavadocCheck
Checks if the javadoc has leading asterisks on each line.

The check does not require asterisks on the first line, nor on the last line if it is blank. All other lines in a Javadoc should start with *, including blank lines and code blocks.

Since:
8.38
  • Field Details

    • MSG_MISSING_ASTERISK

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

    • JavadocMissingLeadingAsteriskCheck

      public JavadocMissingLeadingAsteriskCheck()
  • Method Details

    • getRequiredJavadocTokens

      public int[] getRequiredJavadocTokens()
      Description copied from class: AbstractJavadocCheck
      The javadoc tokens that this check must be registered for.
      Overrides:
      getRequiredJavadocTokens in class AbstractJavadocCheck
      Returns:
      the javadoc token set this must be registered for.
      See Also:
    • getAcceptableJavadocTokens

      public int[] getAcceptableJavadocTokens()
      Description copied from class: AbstractJavadocCheck
      The configurable javadoc token set. Used to protect Checks against malicious users who specify an unacceptable javadoc token set in the configuration file. The default implementation returns the check's default javadoc tokens.
      Overrides:
      getAcceptableJavadocTokens in class AbstractJavadocCheck
      Returns:
      the javadoc token set this check is designed for.
      See Also:
    • getDefaultJavadocTokens

      public int[] getDefaultJavadocTokens()
      Description copied from class: AbstractJavadocCheck
      Returns the default javadoc token types a check is interested in.
      Specified by:
      getDefaultJavadocTokens in class AbstractJavadocCheck
      Returns:
      the default javadoc token types
      See Also:
    • visitJavadocToken

      public void visitJavadocToken(DetailNode detailNode)
      Description copied from class: AbstractJavadocCheck
      Called to process a Javadoc token.
      Specified by:
      visitJavadocToken in class AbstractJavadocCheck
      Parameters:
      detailNode - the token to process
    • isInsideHtmlComment

      private static boolean isInsideHtmlComment(DetailNode detailNode)
      Checks whether the given node is inside an HTML comment.
      Parameters:
      detailNode - the node to process
      Returns:
      true if the node is inside an HTML comment
    • isLeadingAsterisk

      private static boolean isLeadingAsterisk(DetailNode detailNode)
      Checks whether the given node is a leading asterisk.
      Parameters:
      detailNode - the node to process
      Returns:
      true if the node is JavadocCommentsTokenTypes.LEADING_ASTERISK
    • isLastLine

      private static boolean isLastLine(DetailNode detailNode)
      Checks whether this node is the end of a Javadoc comment, optionally preceded by blank text.
      Parameters:
      detailNode - the node to process
      Returns:
      true if the node is null