public class RedundantImportCheck extends Check
Checks for imports that are redundant. An import statement is considered redundant if:
java.lang
package. For example importing java.lang.String.An example of how to configure the check is:
<module name="RedundantImport"/>Compatible with Java 1.5 source.
| Modifier and Type | Field and Description |
|---|---|
static String |
MSG_DUPLICATE
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_LANG
A key is pointing to the warning message text in "messages.properties"
file.
|
static String |
MSG_SAME
A key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
RedundantImportCheck() |
| Modifier and Type | Method and Description |
|---|---|
void |
beginTree(DetailAST aRootAST)
Called before the starting to process 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.
|
void |
visitToken(DetailAST ast)
Called to process a token.
|
destroy, finishTree, getClassLoader, getFileContents, getLine, getLines, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic static final String MSG_LANG
public static final String MSG_SAME
public static final String MSG_DUPLICATE
public RedundantImportCheck()
public void beginTree(DetailAST aRootAST)
Checkpublic int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic int[] getAcceptableTokens()
CheckgetAcceptableTokens in class CheckTokenTypespublic int[] getRequiredTokens()
CheckgetRequiredTokens in class CheckTokenTypespublic void visitToken(DetailAST ast)
CheckvisitToken in class Checkast - the token to processCopyright © 2001-2015. All Rights Reserved.