public class NoCodeInFileCheck extends AbstractCheck
Checks whether file contains code. Files which are considered to have no code:
To configure the check:
<module name="NoCodeInFile"/>
Example:
Content of the files:
// single line comment // violation
/* // violation block comment */
Parent is com.puppycrawl.tools.checkstyle.TreeWalker
Violation Message Keys:
nocode.in.file
AutomaticBean.OutputStreamOptions| Modifier and Type | Field and Description |
|---|---|
static String |
MSG_KEY_NO_CODE
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
NoCodeInFileCheck() |
| Modifier and Type | Method and Description |
|---|---|
void |
finishTree(DetailAST ast)
Called after finished processing a tree.
|
int[] |
getAcceptableTokens()
The configurable token set.
|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
int[] |
getRequiredTokens()
The tokens that this check must be registered for.
|
beginTree, clearMessages, destroy, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens, visitTokenfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverityconfigure, contextualize, getConfiguration, setupChildpublic static final String MSG_KEY_NO_CODE
public NoCodeInFileCheck()
public int[] getDefaultTokens()
AbstractCheckgetDefaultTokens in class AbstractCheckTokenTypespublic int[] getAcceptableTokens()
AbstractCheckgetAcceptableTokens in class AbstractCheckTokenTypespublic int[] getRequiredTokens()
AbstractCheckgetRequiredTokens in class AbstractCheckTokenTypespublic void finishTree(DetailAST ast)
AbstractCheckfinishTree in class AbstractCheckast - the root of the treeCopyright © 2001–2020. All rights reserved.