Class AbstractImportControl

    • Method Detail

      • locateFinest

        public abstract AbstractImportControl locateFinest​(String forPkg,
                                                           String forFileName)
        Search down the tree to locate the finest match for a supplied package.
        Parameters:
        forPkg - the package to search for.
        forFileName - the file name to search for.
        Returns:
        the finest match, or null if no match at all.
      • matchesExactly

        protected abstract boolean matchesExactly​(String pkg,
                                                  String fileName)
        Check for equality of this with pkg.
        Parameters:
        pkg - the package to compare with.
        fileName - the file name to compare with.
        Returns:
        if it matches.
      • checkAccess

        public AccessResult checkAccess​(String inPkg,
                                        String inFileName,
                                        String forImport)
        Returns whether a package or class is allowed to be imported. 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:
        inPkg - the package doing the import.
        inFileName - the file name doing the import.
        forImport - the import to check on.
        Returns:
        an AccessResult.
      • localCheckAccess

        private AccessResult localCheckAccess​(String inPkg,
                                              String inFileName,
                                              String forImport)
        Checks whether any of the rules for this node control access to a specified package or file.
        Parameters:
        inPkg - the package doing the import.
        inFileName - the file name doing the import.
        forImport - the import to check on.
        Returns:
        an AccessResult.