Class ClassImportRule
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.imports.AbstractImportRule
-
- com.puppycrawl.tools.checkstyle.checks.imports.ClassImportRule
-
class ClassImportRule extends AbstractImportRule
Represents whether a class is allowed to be imported or not.
-
-
Constructor Summary
Constructors Constructor Description ClassImportRule(boolean allow, boolean localOnly, String className, boolean regExp)
Constructs an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccessResult
verifyImport(String forImport)
Verifies whether a class name is used.-
Methods inherited from class com.puppycrawl.tools.checkstyle.checks.imports.AbstractImportRule
calculateResult, isLocalOnly, isRegExp
-
-
-
-
Constructor Detail
-
ClassImportRule
ClassImportRule(boolean allow, boolean localOnly, String className, boolean regExp)
Constructs an instance.- Parameters:
allow
- whether to allow access.localOnly
- whether the rule is to be applied locally onlyclassName
- the class to apply the rule on.regExp
- whether the class name is to be interpreted as a regular expression.
-
-
Method Detail
-
verifyImport
public AccessResult verifyImport(String forImport)
Verifies whether a class name is used.- Specified by:
verifyImport
in classAbstractImportRule
- Parameters:
forImport
- the import to check.- Returns:
- a result
AccessResult
indicating whether it can be used.
-
-