Package org.openrewrite.analysis
Interface InvocationMatcher
- All Known Subinterfaces:
BasicInvocationMatcher,GenericExternalModel
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The most basic version of a
MethodMatcher that allows implementers to craft custom matching logic.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionadvanced()static InvocationMatcherfrom(Collection<? extends InvocationMatcher> matchers) static InvocationMatcherfromMethodMatcher(org.openrewrite.java.MethodMatcher methodMatcher) static InvocationMatcherfromMethodMatchers(Collection<? extends org.openrewrite.java.MethodMatcher> matchers) static InvocationMatcherfromMethodMatchers(org.openrewrite.java.MethodMatcher... matchers) default booleanmatches(@Nullable org.openrewrite.java.tree.Expression maybeMethod) Whether the method invocation or constructor matches the criteria of this matcher.default booleanmatches(@Nullable org.openrewrite.java.tree.MethodCall methodCall) booleanmatches(org.openrewrite.java.tree.JavaType.Method type) Whether the method invocation or constructor matches the criteria of this matcher.
-
Method Details
-
matches
boolean matches(@Nullable org.openrewrite.java.tree.JavaType.Method type) Whether the method invocation or constructor matches the criteria of this matcher.- Parameters:
type- The type of the method invocation or constructor.- Returns:
- True if the invocation or constructor matches the criteria of this matcher.
-
matches
default boolean matches(@Nullable @Nullable org.openrewrite.java.tree.MethodCall methodCall) -
matches
default boolean matches(@Nullable @Nullable org.openrewrite.java.tree.Expression maybeMethod) Whether the method invocation or constructor matches the criteria of this matcher.- Parameters:
maybeMethod- AnyExpressionthat might be a method invocation or constructor.- Returns:
- True if the invocation or constructor matches the criteria of this matcher.
-
from
-
fromMethodMatcher
-
fromMethodMatchers
-
fromMethodMatchers
static InvocationMatcher fromMethodMatchers(Collection<? extends org.openrewrite.java.MethodMatcher> matchers) -
advanced
-