Package org.openrewrite.codemods
Class NodeBasedRecipe
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
org.openrewrite.codemods.NodeBasedRecipe
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ApplyCodemod,Biome,ESLint,Putout,ReactI18Next,UI5
public abstract class NodeBasedRecipe
extends org.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.openrewrite.SourceFilecreateAfter(org.openrewrite.SourceFile before, NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) protected static PathcreateDirectory(org.openrewrite.ExecutionContext ctx, String prefix) Collection<? extends org.openrewrite.SourceFile> generate(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) getCommandEnvironment(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) getInitialValue(org.openrewrite.ExecutionContext ctx) getNpmCommand(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> org.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> protected voidprocessOutput(Path out, NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) protected voidrunNode(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) 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, getDescription, getDescriptor, getDisplayName, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll
-
Constructor Details
-
NodeBasedRecipe
public NodeBasedRecipe()
-
-
Method Details
-
getInitialValue
- Specified by:
getInitialValuein classorg.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
-
getScanner
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getScanner(NodeBasedRecipe.Accumulator acc) - Specified by:
getScannerin classorg.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
-
generate
public Collection<? extends org.openrewrite.SourceFile> generate(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) - Overrides:
generatein classorg.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
-
runNode
-
getNpmCommand
protected abstract List<String> getNpmCommand(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) -
getCommandEnvironment
protected Map<String,String> getCommandEnvironment(NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) -
processOutput
protected void processOutput(Path out, NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) -
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor(NodeBasedRecipe.Accumulator acc) - Overrides:
getVisitorin classorg.openrewrite.ScanningRecipe<NodeBasedRecipe.Accumulator>
-
createAfter
protected org.openrewrite.SourceFile createAfter(org.openrewrite.SourceFile before, NodeBasedRecipe.Accumulator acc, org.openrewrite.ExecutionContext ctx) -
createDirectory
-