Class JavadocDetailNodeParser

java.lang.Object
com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser

public class JavadocDetailNodeParser extends Object
Used for parsing Javadoc comment as DetailNode tree.
  • Field Details

    • MSG_JAVADOC_PARSE_RULE_ERROR

      public static final String MSG_JAVADOC_PARSE_RULE_ERROR
      Parse error while rule recognition.
      See Also:
    • MSG_UNCLOSED_HTML_TAG

      public static final String MSG_UNCLOSED_HTML_TAG
      Message property key for the Unclosed HTML message.
      See Also:
    • JAVADOC_START

      private static final String JAVADOC_START
      Symbols with which javadoc starts.
      See Also:
  • Constructor Details

    • JavadocDetailNodeParser

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

    • parseJavadocComment

      public JavadocDetailNodeParser.ParseStatus parseJavadocComment(DetailAST javadocCommentAst)
      Parses the given Javadoc comment AST into a JavadocDetailNodeParser.ParseStatus object.

      This method extracts the raw Javadoc comment text from the supplied DetailAST, creates a new lexer and parser for the Javadoc grammar, and attempts to parse it into an AST of DetailNodes. The parser uses PredictionMode.SLL for faster performance and stops parsing on the first error encountered by using CheckstyleParserErrorStrategy.

      Parameters:
      javadocCommentAst - the DetailAST node representing the Javadoc comment in the source file
      Returns:
      a ParseStatus containing the root of the parsed Javadoc tree (if successful), the first non-tight HTML tag (if any), and the error message (if parsing failed)