Class ImportAnalyzer


  • class ImportAnalyzer
    extends Object
    Collects banned import matches from a single source file.
    • Constructor Detail

      • ImportAnalyzer

        ImportAnalyzer()
    • Method Detail

      • checkFile

        Optional<BannedImportRecords> checkFile​(ParsedJavaFile sourceFile,
                                                BannedImportGroups groups)
        Collects all imports that are banned within the given source file.
        Parameters:
        sourceFile - The parsed file to check for banned imports..
        groups - The groups of banned imports to check the file against. From all groups, the one with the most specific base pattern match is chosen.
        Returns:
        a BannedImportRecords holds information about the found matches. Returns an empty optional if no matches were found.