class PkgImportRule extends AbstractImportRule
Modifier and Type | Field and Description |
---|---|
private boolean |
exactMatch
Indicates if the package name must be an exact match.
|
private java.lang.String |
pkgName
Package to control access to.
|
Constructor and Description |
---|
PkgImportRule(boolean allow,
boolean localOnly,
java.lang.String pkgName,
boolean exactMatch,
boolean regExp)
Constructs an instance.
|
Modifier and Type | Method and Description |
---|---|
AccessResult |
verifyImport(java.lang.String forImport)
Verifies whether a package name is used.
|
calculateResult, isLocalOnly, isRegExp
private final java.lang.String pkgName
private final boolean exactMatch
PkgImportRule(boolean allow, boolean localOnly, java.lang.String pkgName, boolean exactMatch, boolean regExp)
allow
- whether to allow access.localOnly
- whether the rule is to be applied locally onlypkgName
- 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.public AccessResult verifyImport(java.lang.String forImport)
verifyImport
in class AbstractImportRule
forImport
- the import to check.AccessResult
indicating whether it can be used.