Package org.openrewrite.java.search
Class FindMethods
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.search.FindMethods
- All Implemented Interfaces:
Cloneable
public class FindMethods
extends org.openrewrite.Recipe
Finds matching method invocations.
-
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, NOOP, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<J.MethodDeclaration>findDeclaration(J j, String methodPattern) static Set<J.MethodDeclaration>findDeclaration(J j, String methodPattern, boolean matchOverrides) protected JavaVisitor<org.openrewrite.ExecutionContext>org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addApplicableTest, addApplicableTest, addDataTable, addSingleSourceApplicableTest, addSingleSourceApplicableTest, causesAnotherCycle, clone, createRecipeDescriptor, doNext, equals, getApplicableTest, getApplicableTests, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getJacksonPolymorphicTypeTag, getLanguages, getMaintainers, getName, getRecipeList, getSingleSourceApplicableTests, getTags, hashCode, noop, run, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, visit
-
Constructor Details
-
FindMethods
public FindMethods()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Overrides:
getDescriptionin classorg.openrewrite.Recipe
-
getSingleSourceApplicableTest
- Overrides:
getSingleSourceApplicableTestin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
find
-
find
- Parameters:
j- The subtree to search.methodPattern- A method pattern. SeeMethodMatcherfor details about this syntax.matchOverrides- Whether to match overrides.- Returns:
- A set of
J.MethodInvocation,J.MemberReference, andJ.NewClassrepresenting calls to this method.
-
findDeclaration
-
findDeclaration
public static Set<J.MethodDeclaration> findDeclaration(J j, String methodPattern, boolean matchOverrides)
-