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
public class JavadocMetadataScraper extends AbstractJavadocCheck
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 Constructor Description JavadocMetadataScraper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beginJavadocTree(DetailNode rootAst)
Called before the starting to process a tree.void
finishJavadocTree(DetailNode rootAst)
Called after finished processing a tree.int[]
getDefaultJavadocTokens()
Returns the default javadoc token types a check is interested in.static java.util.Map<java.lang.String,ModuleDetails>
getModuleDetailsStore()
Getter method formoduleDetailsStore
.int[]
getRequiredJavadocTokens()
The javadoc tokens that this check must be registered for.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.void
scrapeContent(DetailNode ast)
Method containing the core logic of scraping.void
visitJavadocToken(DetailNode ast)
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
-
-
-
-
Method Detail
-
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:
JavadocTokenTypes
-
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:
JavadocTokenTypes
-
beginJavadocTree
public void beginJavadocTree(DetailNode rootAst)
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
public void visitJavadocToken(DetailNode ast)
Description copied from class:AbstractJavadocCheck
Called to process a Javadoc token.- Specified by:
visitJavadocToken
in classAbstractJavadocCheck
- Parameters:
ast
- the token to process
-
finishJavadocTree
public void finishJavadocTree(DetailNode rootAst)
Description copied from class:AbstractJavadocCheck
Called after finished processing a tree.- Overrides:
finishJavadocTree
in classAbstractJavadocCheck
- Parameters:
rootAst
- the root of the tree
-
scrapeContent
public void scrapeContent(DetailNode ast)
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
public static java.util.Map<java.lang.String,ModuleDetails> 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
-
-