Package org.openrewrite.config
Class DeclarativeRecipe
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.config.CompositeRecipe
org.openrewrite.config.DeclarativeRecipe
- All Implemented Interfaces:
Cloneable
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, NOOP, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUninitialized(DeclarativeRecipe.RecipeUse use, String recipeName, @Nullable ClassLoader classLoader) voidaddUninitialized(DeclarativeRecipe.RecipeUse use, Recipe recipe) voidaddValidation(Validated validated) booleanprotected RecipeDescriptorvoidinitialize(Collection<Recipe> availableRecipes, Map<String, List<Contributor>> recipeToContributors) validate()The default implementation of validate on the recipe will look for package and field level annotations that indicate a field is not-null.Methods inherited from class org.openrewrite.config.CompositeRecipe
getDataTableDescriptors, getDisplayName, getEstimatedEffortPerOccurrenceMethods inherited from class org.openrewrite.Recipe
addApplicableTest, addApplicableTest, addDataTable, addSingleSourceApplicableTest, addSingleSourceApplicableTest, clone, doNext, equals, getApplicableTest, getApplicableTests, getDescription, getDescriptor, getExamples, getJacksonPolymorphicTypeTag, getLanguages, getMaintainers, getName, getRecipeList, getSingleSourceApplicableTest, getSingleSourceApplicableTests, getTags, getVisitor, hashCode, noop, run, run, run, run, validate, validateAll, validateAll, visit
-
Constructor Details
-
DeclarativeRecipe
public DeclarativeRecipe()
-
-
Method Details
-
causesAnotherCycle
public boolean causesAnotherCycle()- Overrides:
causesAnotherCyclein classRecipe- Returns:
- Determines if another cycle is run when this recipe makes a change. In some cases, like changing method declaration names, a further cycle is needed to update method invocations of that declaration that were visited prior to the declaration change. But other visitors never need to cause another cycle, such as those that format whitespace or add search markers. Note that even when this is false, the recipe will still run on another cycle if any other recipe causes another cycle to run. But if every recipe reports no need to run another cycle (or if there are no changes made in a cycle), then another will not run.
-
initialize
public void initialize(Collection<Recipe> availableRecipes, Map<String, List<Contributor>> recipeToContributors) -
addUninitialized
-
addUninitialized
public void addUninitialized(DeclarativeRecipe.RecipeUse use, String recipeName, @Nullable @Nullable ClassLoader classLoader) -
addValidation
-
validate
Description copied from class:RecipeThe default implementation of validate on the recipe will look for package and field level annotations that indicate a field is not-null. The annotations must have run-time retention and the simple name of the annotation must match one of the common names defined inNullUtils -
createRecipeDescriptor
- Overrides:
createRecipeDescriptorin classRecipe
-
getContributors
- Overrides:
getContributorsin classRecipe
-