Class PkgImportRule
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.imports.AbstractImportRule
com.puppycrawl.tools.checkstyle.checks.imports.PkgImportRule
Represents whether a package is allowed to be imported or not.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate final booleanIndicates if the package name must be an exact match.private final StringPackage to control access to.
- 
Constructor SummaryConstructorsConstructorDescriptionPkgImportRule(boolean allow, boolean localOnly, String pkgName, boolean exactMatch, boolean regExp) Constructs an instance.
- 
Method SummaryModifier and TypeMethodDescriptionverifyImport(String forImport) Verifies whether a package name is used.Methods inherited from class com.puppycrawl.tools.checkstyle.checks.imports.AbstractImportRulecalculateResult, isLocalOnly, isRegExp
- 
Field Details- 
pkgNamePackage to control access to.
- 
exactMatchIndicates if the package name must be an exact match.
 
- 
- 
Constructor Details- 
PkgImportRulePkgImportRule(boolean allow, boolean localOnly, String pkgName, boolean exactMatch, boolean regExp) Constructs an instance.- Parameters:
- allow- whether to allow access.
- localOnly- whether the rule is to be applied locally only
- pkgName- the package to apply the rule on.
- exactMatch- whether the package name must match exactly.
- regExp- whether the package name is to be interpreted as a regular expression.
 
 
- 
- 
Method Details- 
verifyImportVerifies whether a package name is used.- Specified by:
- verifyImportin class- AbstractImportRule
- Parameters:
- forImport- the import to check.
- Returns:
- a result AccessResultindicating whether it can be used.
 
 
-