Package io.swagger.codegen.v3.ignore
Class CodegenIgnoreProcessor
- java.lang.Object
-
- io.swagger.codegen.v3.ignore.CodegenIgnoreProcessor
-
public class CodegenIgnoreProcessor extends Object
Presents a processing utility for parsing and evaluating files containing common ignore patterns. (.swagger-codegen-ignore)
-
-
Constructor Summary
Constructors Constructor Description CodegenIgnoreProcessor(File targetIgnoreFile)Constructs an instance ofCodegenIgnoreProcessorfrom an ignore file defined bytargetIgnoreFile.CodegenIgnoreProcessor(String baseDirectory)Loads the default ignore file (.swagger-codegen-ignore) from the specified path.CodegenIgnoreProcessor(String baseDirectory, String ignoreFile)Loads the specified ignore file by name ([ignoreFile]) from the specified path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsFile(File targetFile)Determines whether or not a file defined bytoEvaluateis allowed, under the exclusion rules from the ignore file being processed.List<Rule>getExclusionRules()Allows a consumer to manually inspect all "exclusion rules".List<Rule>getInclusionRules()Allows a consumer to manually inspect explicit "inclusion rules".
-
-
-
Constructor Detail
-
CodegenIgnoreProcessor
public CodegenIgnoreProcessor(String baseDirectory)
Loads the default ignore file (.swagger-codegen-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 ofCodegenIgnoreProcessorfrom an ignore file defined bytargetIgnoreFile.- Parameters:
targetIgnoreFile- The ignore file location.
-
-
Method Detail
-
allowsFile
public boolean allowsFile(File targetFile)
Determines whether or not a file defined bytoEvaluateis 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:
falseif file matches any pattern in the ignore file (disallowed), otherwisetrue(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 unmodifiable
Listof 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 bygetInclusionRules()rules. NOTE: Existence in this list doesn't mean a file is excluded. The rule can be overridden bygetInclusionRules()rules.- Returns:
- A unmodifiable
Listof rules which define exclusions by patterns in the ignore file.
-
-