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 classCustom error listener for JavadocParser that prints user readable errors.static classContains information about parse error message.static classContains 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.ParseStatusobject.
-
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.ParseStatusobject.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 ofDetailNodes. The parser usesPredictionMode.SLLfor faster performance and stops parsing on the first error encountered by usingCheckstyleParserErrorStrategy.- Parameters:
javadocCommentAst- theDetailASTnode representing the Javadoc comment in the source file- Returns:
- a
JavadocDetailNodeParser.ParseStatuscontaining the root of the parsed Javadoc tree (if successful), the first non-tight HTML tag (if any), and the error message (if parsing failed)
-