|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.Check
com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder
public class SuppressWarningsHolder
Maintains a set of check suppressions from SuppressWarnings
annotations.
Field Summary | |
---|---|
static String |
CHECKSTYLE_PREFIX
Optional prefix for warning suppressions that are only intended to be recognized by checkstyle. |
Constructor Summary | |
---|---|
SuppressWarningsHolder()
|
Method Summary | |
---|---|
void |
beginTree(DetailAST aRootAST)
Called before the starting to process a tree. |
static String |
getAlias(String aSourceName)
Returns the alias for the source name of a check. |
static String |
getDefaultAlias(String aSourceName)
Returns the default alias for the source name of a check, which is the source name in lower case with any dotted prefix or "Check" suffix removed. |
int[] |
getDefaultTokens()
Returns the default token a check is interested in. |
static boolean |
isSuppressed(String aSourceName,
int aLine,
int aColumn)
Checks for a suppression of a check with the given source name and location in the last file processed. |
static void |
registerAlias(String aSourceName,
String aCheckAlias)
Registers an alias for the source name of a check. |
void |
setAliasList(String aAliasList)
Registers a list of source name aliases based on a comma-separated list of source=alias items, such as com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck=
paramnum . |
void |
visitToken(DetailAST aAST)
Called to process a token. |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
---|
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
---|
getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverity |
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
---|
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CHECKSTYLE_PREFIX
FallThroughCheck
only in checkstyle (and not in javac), use the
suppression "checkstyle:fallthrough"
. To suppress the warning in
both tools, just use "fallthrough"
.
Constructor Detail |
---|
public SuppressWarningsHolder()
Method Detail |
---|
public static String getDefaultAlias(String aSourceName)
aSourceName
- the source name of the check (generally the class
name)
public static String getAlias(String aSourceName)
registerAlias(String, String)
, that
alias is returned; otherwise, the default alias is used.
aSourceName
- the source name of the check (generally the class
name)
public static void registerAlias(String aSourceName, String aCheckAlias)
aSourceName
- the source name of the check (generally the class
name)aCheckAlias
- the alias used in SuppressWarnings
annotationspublic void setAliasList(String aAliasList)
source=alias
items, such as com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck=
paramnum
.
aAliasList
- the list of comma-separated alias assigmentspublic static boolean isSuppressed(String aSourceName, int aLine, int aColumn)
aSourceName
- the source name of the checkaLine
- the line number of the checkaColumn
- the column number of the check
public int[] getDefaultTokens()
Check
getDefaultTokens
in class Check
TokenTypes
public void beginTree(DetailAST aRootAST)
Check
beginTree
in class Check
aRootAST
- the root of the treepublic void visitToken(DetailAST aAST)
Check
visitToken
in class Check
aAST
- the token to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |