| java.lang.Object com.puppycrawl.tools.checkstyle.checks.imports.PkgControl
PkgControl | class PkgControl (Code) | | Represents the a tree of guards for controlling whether packages are allowed
to be used. Each instance must have a single parent or be the root node.
Each instance may have zero or more children.
author: Oliver Burn |
PkgControl | PkgControl(String aPkgName)(Code) | | Construct a root node.
Parameters: aPkgName - the name of the package. |
PkgControl | PkgControl(PkgControl aParent, String aSubPkg)(Code) | | Construct a child node.
Parameters: aParent - the parent node. Parameters: aSubPkg - the sub package name. |
addGuard | void addGuard(Guard aThug)(Code) | | Adds a guard to the node.
Parameters: aThug - the guard to be added. |
checkAccess | AccessResult checkAccess(String aForImport, String aInPkg)(Code) | | Returns whether a package is allowed to be used. The algorithm checks
with the current node for a result, and if none is found then calls
its parent looking for a match. This will recurse looking for match.
If there is no clear result then
AccessResult.UNKNOWN is
returned.
Parameters: aForImport - the package to check on. Parameters: aInPkg - the package doing the import. an AccessResult. |
getFullPackage | String getFullPackage()(Code) | | the full package name represented by the node. |
locateFinest | PkgControl locateFinest(String aForPkg)(Code) | | Search down the tree to locate the finest match for a supplied package.
Parameters: aForPkg - the package to search for. the finest match, or null if no match at all. |
|
|