Class JavadocMetadataScraper
java.lang.Object
com.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.AbstractCheck
com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
com.puppycrawl.tools.checkstyle.meta.JavadocMetadataScraper
- All Implemented Interfaces:
Configurable
,Contextualizable
Class for scraping module metadata from the corresponding class' class-level javadoc.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
AutomaticBean.OutputStreamOptions
-
Field Summary
Fields inherited from class com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
MSG_JAVADOC_MISSED_HTML_CLOSE, MSG_JAVADOC_PARSE_RULE_ERROR, MSG_JAVADOC_WRONG_SINGLETON_TAG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
beginJavadocTree
(DetailNode rootAst) Called before the starting to process a tree.void
finishJavadocTree
(DetailNode rootAst) Called after finished processing a tree.int[]
Returns the default javadoc token types a check is interested in.static Map<String,
ModuleDetails> Getter method formoduleDetailsStore
.int[]
The javadoc tokens that this check must be registered for.boolean
Check if the current javadoc block comment AST corresponds to the top-level class as we only want to scrape top-level class javadoc.void
scrapeContent
(DetailNode ast) Method containing the core logic of scraping.void
Called to process a Javadoc token.Methods inherited from class com.puppycrawl.tools.checkstyle.checks.javadoc.AbstractJavadocCheck
acceptJavadocWithNonTightHtml, beginTree, destroy, finishTree, getAcceptableJavadocTokens, getAcceptableTokens, getBlockCommentAst, getDefaultTokens, getRequiredTokens, init, isCommentNodesRequired, leaveJavadocToken, setJavadocTokens, setViolateExecutionOnNonTightHtml, visitToken
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
clearMessages, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
configure, contextualize, getConfiguration, setupChild
-
Constructor Details
-
JavadocMetadataScraper
public JavadocMetadataScraper()
-
-
Method Details
-
getDefaultJavadocTokens
public int[] getDefaultJavadocTokens()Description copied from class:AbstractJavadocCheck
Returns the default javadoc token types a check is interested in.- Specified by:
getDefaultJavadocTokens
in classAbstractJavadocCheck
- Returns:
- the default javadoc token types
- See Also:
-
getRequiredJavadocTokens
public int[] getRequiredJavadocTokens()Description copied from class:AbstractJavadocCheck
The javadoc tokens that this check must be registered for.- Overrides:
getRequiredJavadocTokens
in classAbstractJavadocCheck
- Returns:
- the javadoc token set this must be registered for.
- See Also:
-
beginJavadocTree
Description copied from class:AbstractJavadocCheck
Called before the starting to process a tree.- Overrides:
beginJavadocTree
in classAbstractJavadocCheck
- Parameters:
rootAst
- the root of the tree
-
visitJavadocToken
Description copied from class:AbstractJavadocCheck
Called to process a Javadoc token.- Specified by:
visitJavadocToken
in classAbstractJavadocCheck
- Parameters:
ast
- the token to process
-
finishJavadocTree
Description copied from class:AbstractJavadocCheck
Called after finished processing a tree.- Overrides:
finishJavadocTree
in classAbstractJavadocCheck
- Parameters:
rootAst
- the root of the tree
-
scrapeContent
Method containing the core logic of scraping. This keeps track and decides which phase of scraping we are in, and accordingly call other subroutines.- Parameters:
ast
- javadoc ast
-
getModuleDetailsStore
Getter method formoduleDetailsStore
.- Returns:
- map containing module details of supplied checks.
-
isTopLevelClassJavadoc
public boolean isTopLevelClassJavadoc()Check if the current javadoc block comment AST corresponds to the top-level class as we only want to scrape top-level class javadoc.- Returns:
- true if the current AST corresponds to top level class
-