com.puppycrawl.tools.checkstyle.checks.imports

Class ImportControlCheck

Implemented Interfaces:
Configurable, Contextualizable

public class ImportControlCheck
extends Check

Check that controls what packages can be imported in each package. Useful for ensuring that application layering is not violated. Ideas on how the check can be improved include support for:
Author:
Oliver Burn

Method Summary

void
beginTree(DetailAST aRootAST)
int[]
getDefaultTokens()
void
setFile(String aName)
Set the parameter for the file containing the import control configuration.
void
setUrl(String aUrl)
Set the parameter for the url containing the import control configuration.
void
visitToken(DetailAST aAST)

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

Method Details

beginTree

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

getDefaultTokens

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

setFile

public void setFile(String aName)
Set the parameter for the file containing the import control configuration. It will cause the file to be loaded.
Parameters:
aName - the name of the file to load.

setUrl

public void setUrl(String aUrl)
Set the parameter for the url containing the import control configuration. It will cause the url to be loaded.
Parameters:
aUrl - the url of the file to load.

visitToken

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