abstract class AbstractImportControl extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private AbstractImportControl |
parent
The parent.
|
private java.util.Deque<AbstractImportRule> |
rules
List of
AbstractImportRule objects to check. |
private MismatchStrategy |
strategyOnMismatch
Strategy in a case if matching allow/disallow rule was not found.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractImportControl(AbstractImportControl parent,
MismatchStrategy strategyOnMismatch)
Construct a child node.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addImportRule(AbstractImportRule rule)
Adds an
AbstractImportRule to the node. |
AccessResult |
checkAccess(java.lang.String inPkg,
java.lang.String inFileName,
java.lang.String forImport)
Returns whether a package or class is allowed to be imported.
|
private AccessResult |
localCheckAccess(java.lang.String inPkg,
java.lang.String inFileName,
java.lang.String forImport)
Checks whether any of the rules for this node control access to
a specified package or file.
|
abstract AbstractImportControl |
locateFinest(java.lang.String forPkg,
java.lang.String forFileName)
Search down the tree to locate the finest match for a supplied package.
|
protected abstract boolean |
matchesExactly(java.lang.String pkg,
java.lang.String fileName)
Check for equality of this with pkg.
|
private final java.util.Deque<AbstractImportRule> rules
AbstractImportRule objects to check.private final AbstractImportControl parent
private final MismatchStrategy strategyOnMismatch
protected AbstractImportControl(AbstractImportControl parent, MismatchStrategy strategyOnMismatch)
parent - the parent node.strategyOnMismatch - strategy in a case if matching allow/disallow rule was not found.public abstract AbstractImportControl locateFinest(java.lang.String forPkg, java.lang.String forFileName)
forPkg - the package to search for.forFileName - the file name to search for.protected abstract boolean matchesExactly(java.lang.String pkg, java.lang.String fileName)
pkg - the package to compare with.fileName - the file name to compare with.protected void addImportRule(AbstractImportRule rule)
AbstractImportRule to the node.rule - the rule to be added.public AccessResult checkAccess(java.lang.String inPkg, java.lang.String inFileName, java.lang.String forImport)
AccessResult.UNKNOWN is returned.inPkg - the package doing the import.inFileName - the file name doing the import.forImport - the import to check on.AccessResult.private AccessResult localCheckAccess(java.lang.String inPkg, java.lang.String inFileName, java.lang.String forImport)
inPkg - the package doing the import.inFileName - the file name doing the import.forImport - the import to check on.AccessResult.Copyright © 2001-2022. All Rights Reserved.