com.puppycrawl.tools.checkstyle.checks.imports

Class UnusedImportsCheck

Implemented Interfaces:
Configurable, Contextualizable

public class UnusedImportsCheck
extends DeclarationCollector

Checks for unused import statements.

An example of how to configure the check is:

 <module name="UnusedImports"/>
 
Compatible with Java 1.5 source.
Version:
1.1
Author:
Oliver Burn

Constructor Summary

UnusedImportsCheck()
Default constructor.

Method Summary

void
beginTree(DetailAST aRootAST)
void
finishTree(DetailAST aRootAST)
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.DeclarationCollector

beginTree, isClassField, isDeclared, leaveToken, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setId, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

UnusedImportsCheck

public UnusedImportsCheck()
Default constructor.

Method Details

beginTree

public void beginTree(DetailAST aRootAST)
Overrides:
beginTree in interface DeclarationCollector

finishTree

public void finishTree(DetailAST aRootAST)
Overrides:
finishTree in interface Check

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

getRequiredTokens

public int[] getRequiredTokens()
Overrides:
getRequiredTokens in interface Check

visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface DeclarationCollector