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, visitToken
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
configure, contextualize, getConfiguration, setupChild
public static final String MSG_KEY_NO_CODE
public NoCodeInFileCheck()
public int[] getDefaultTokens()
AbstractCheck
getDefaultTokens
in class AbstractCheck
TokenTypes
public int[] getAcceptableTokens()
AbstractCheck
getAcceptableTokens
in class AbstractCheck
TokenTypes
public int[] getRequiredTokens()
AbstractCheck
getRequiredTokens
in class AbstractCheck
TokenTypes
public void finishTree(DetailAST ast)
AbstractCheck
finishTree
in class AbstractCheck
ast
- the root of the treeCopyright © 2001–2020. All rights reserved.