Package io.debezium.checkstyle
Class IllegalImport
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.api.AutomaticBean
-
- com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
-
- com.puppycrawl.tools.checkstyle.api.AbstractCheck
-
- io.debezium.checkstyle.IllegalImport
-
- All Implemented Interfaces:
com.puppycrawl.tools.checkstyle.api.Configurable,com.puppycrawl.tools.checkstyle.api.Contextualizable
public class IllegalImport extends com.puppycrawl.tools.checkstyle.api.AbstractCheckA simple CheckStyle checker to verify specific import statements are not being used.- Author:
- Sanne Grinovero
-
-
Field Summary
Fields Modifier and Type Field Description private Stringmessageprivate HashSet<String>notAllowedImports
-
Constructor Summary
Constructors Constructor Description IllegalImport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private StringbuildError(String importStatement)int[]getAcceptableTokens()int[]getDefaultTokens()int[]getRequiredTokens()private booleanisIllegalImport(String importString)voidsetIllegalClassnames(String[] importStatements)Set the list of illegal import statements.voidsetMessage(String message)voidvisitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractCheck
beginTree, clearMessages, destroy, finishTree, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokens
-
Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
finishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeverity
-
-
-
-
Method Detail
-
setIllegalClassnames
public void setIllegalClassnames(String[] importStatements)
Set the list of illegal import statements.- Parameters:
importStatements- array of illegal packages
-
setMessage
public void setMessage(String message)
-
getDefaultTokens
public int[] getDefaultTokens()
- Specified by:
getDefaultTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getAcceptableTokens
public int[] getAcceptableTokens()
- Specified by:
getAcceptableTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
getRequiredTokens
public int[] getRequiredTokens()
- Specified by:
getRequiredTokensin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
visitToken
public void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST aAST)
- Overrides:
visitTokenin classcom.puppycrawl.tools.checkstyle.api.AbstractCheck
-
isIllegalImport
private boolean isIllegalImport(String importString)
-
-