Package org.openrewrite
Class FindCollidingSourceFiles
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.ScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>
org.openrewrite.FindCollidingSourceFiles
- All Implemented Interfaces:
Cloneable
public class FindCollidingSourceFiles
extends ScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
Recipe.Builder, Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends SourceFile>generate(org.openrewrite.FindCollidingSourceFiles.Accumulator acc, ExecutionContext ctx) Generate new source files to add to the repository using information collected from scanning.A human-readable description for the recipe, consisting of one or more full sentences ending with a period.A human-readable display name for the recipe, initial capped with no period.org.openrewrite.FindCollidingSourceFiles.AccumulatorgetScanner(org.openrewrite.FindCollidingSourceFiles.Accumulator acc) A visitor that is called for each source file in the repository in an initial pass.getVisitor(org.openrewrite.FindCollidingSourceFiles.Accumulator acc) A visitor that is called in a second pass to perform transformation on each source file.Methods inherited from class org.openrewrite.ScanningRecipe
generate, getAccumulator, getVisitorMethods inherited from class org.openrewrite.Recipe
addDataTable, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, run, run, run, validate, validate, validateAll, validateAll
-
Constructor Details
-
FindCollidingSourceFiles
public FindCollidingSourceFiles()
-
-
Method Details
-
getDisplayName
Description copied from class:RecipeA human-readable display name for the recipe, initial capped with no period. For example, "Find text". The display name can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`".- Specified by:
getDisplayNamein classRecipe- Returns:
- The display name.
-
getDescription
Description copied from class:RecipeA human-readable description for the recipe, consisting of one or more full sentences ending with a period."Find methods by pattern." is an example. The description can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`.".
- Specified by:
getDescriptionin classRecipe- Returns:
- The display name.
-
getInitialValue
- Specified by:
getInitialValuein classScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>- Returns:
- The initial value of the accumulator before any source files have been iterated over.
-
getScanner
public TreeVisitor<?,ExecutionContext> getScanner(org.openrewrite.FindCollidingSourceFiles.Accumulator acc) Description copied from class:ScanningRecipeA visitor that is called for each source file in the repository in an initial pass. Scanning data should be accumulated toacc. The first source file to visit will receive anaccvalue that is supplied byScanningRecipe.getInitialValue(ExecutionContext).
Any changes that the scanning visitor makes to the source file will be discarded.- Specified by:
getScannerin classScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>- Parameters:
acc- The accumulated scanning data.- Returns:
- A visitor that is called to collect scanning data on each source file.
-
generate
public Collection<? extends SourceFile> generate(org.openrewrite.FindCollidingSourceFiles.Accumulator acc, ExecutionContext ctx) Description copied from class:ScanningRecipeGenerate new source files to add to the repository using information collected from scanning.- Overrides:
generatein classScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>- Parameters:
acc- The accumulated scanning data.- Returns:
- A list of new source files.
-
getVisitor
public TreeVisitor<?,ExecutionContext> getVisitor(org.openrewrite.FindCollidingSourceFiles.Accumulator acc) Description copied from class:ScanningRecipeA visitor that is called in a second pass to perform transformation on each source file. To delete a source file, returnnullfrom theTreeVisitor.visit(Tree, Object)method.- Overrides:
getVisitorin classScanningRecipe<org.openrewrite.FindCollidingSourceFiles.Accumulator>- Parameters:
acc- The accumulated scanning data.- Returns:
- A visitor that is called to perform transformation on each source file.
-