Package com.puppycrawl.tools.checkstyle
Class JavadocDetailNodeParser
java.lang.Object
com.puppycrawl.tools.checkstyle.JavadocDetailNodeParser
Used for parsing Javadoc comment as DetailNode tree.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
Custom error listener for JavadocParser that prints user readable errors.static class
Contains information about parse error message.static class
Contains result of parsing javadoc comment: DetailNode tree and parse error message. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseJavadocComment
(DetailAST javadocCommentAst) Parses the given Javadoc comment AST into aJavadocDetailNodeParser.ParseStatus
object.
-
Field Details
-
MSG_JAVADOC_PARSE_RULE_ERROR
Parse error while rule recognition.- See Also:
-
MSG_UNCLOSED_HTML_TAG
Message property key for the Unclosed HTML message.- See Also:
-
JAVADOC_START
Symbols with which javadoc starts.- See Also:
-
-
Constructor Details
-
JavadocDetailNodeParser
public JavadocDetailNodeParser()
-
-
Method Details
-
parseJavadocComment
Parses the given Javadoc comment AST into aJavadocDetailNodeParser.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 ofDetailNode
s. The parser usesPredictionMode.SLL
for faster performance and stops parsing on the first error encountered by usingCheckstyleParserErrorStrategy
.- Parameters:
javadocCommentAst
- theDetailAST
node representing the Javadoc comment in the source file- Returns:
- a
JavadocDetailNodeParser.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)
-