Class CodegenIgnoreProcessor


  • public class CodegenIgnoreProcessor
    extends Object
    Presents a processing utility for parsing and evaluating files containing common ignore patterns. (.openapi-generator-ignore)
    • Constructor Detail

      • CodegenIgnoreProcessor

        public CodegenIgnoreProcessor​(String baseDirectory)
        Loads the default ignore file (.openapi-generator-ignore) from the specified path.
        Parameters:
        baseDirectory - The base directory of the files to be processed. This contains the ignore file.
      • CodegenIgnoreProcessor

        public CodegenIgnoreProcessor​(String baseDirectory,
                                      String ignoreFile)
        Loads the specified ignore file by name ([ignoreFile]) from the specified path.
        Parameters:
        baseDirectory - The base directory of the files to be processed. This contains the ignore file.
        ignoreFile - The file containing ignore patterns.
      • CodegenIgnoreProcessor

        public CodegenIgnoreProcessor​(File targetIgnoreFile)
        Constructs an instance of CodegenIgnoreProcessor from an ignore file defined by targetIgnoreFile.
        Parameters:
        targetIgnoreFile - The ignore file location.
    • Method Detail

      • allowsFile

        public boolean allowsFile​(File targetFile)
        Determines whether or not a file defined by toEvaluate is allowed, under the exclusion rules from the ignore file being processed.
        Parameters:
        targetFile - The file to check against exclusion rules from the ignore file.
        Returns:
        false if file matches any pattern in the ignore file (disallowed), otherwise true (allowed).
      • getInclusionRules

        public List<Rule> getInclusionRules()
        Allows a consumer to manually inspect explicit "inclusion rules". That is, patterns in the ignore file which have been negated.
        Returns:
        A Collections.unmodifiableList(List) of rules which possibly negate exclusion rules in the ignore file.
      • getExclusionRules

        public List<Rule> getExclusionRules()
        Allows a consumer to manually inspect all "exclusion rules". That is, patterns in the ignore file which represent files and directories to be excluded, unless explicitly overridden by getInclusionRules() rules. NOTE: Existence in this list doesn't mean a file is excluded. The rule can be overridden by getInclusionRules() rules.
        Returns:
        A Collections.unmodifiableList(List) of rules which define exclusions by patterns in the ignore file.