Interface GenericExternalModel
- All Superinterfaces:
BasicInvocationMatcher,InvocationMatcher
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classNested classes/interfaces inherited from interface org.openrewrite.analysis.InvocationMatcher
InvocationMatcher.AdvancedInvocationMatcher -
Method Summary
Modifier and TypeMethodDescriptioncomputeArgumentRange(String arguments) The argument positions selected by anArgument[...]access path, as an inclusive range.default StringgetName()getType()static InvocationMatcherindexedMatcher(Collection<? extends GenericExternalModel> models) Builds anInvocationMatcherthat matches any ofmodels, indexed by method name.default booleandefault booleanbooleandefault booleanmatchesMethodName(String methodName) default booleanmatchesParameterTypes(List<org.openrewrite.java.tree.JavaType> parameterTypes) default booleanmatchesTargetTypeName(String fullyQualifiedTypeName) Methods inherited from interface org.openrewrite.analysis.BasicInvocationMatcher
matches, matchesTargetTypeMethods inherited from interface org.openrewrite.analysis.InvocationMatcher
advanced, matches, matches
-
Method Details
-
indexedMatcher
Builds anInvocationMatcherthat matches any ofmodels, indexed by method name.A model can only match a call when its (effective) method name equals the call's name — see
matchesMethodName(String)— so dispatching onJavaType.Method.getName()and only checking the models registered under that name yields exactly the same result as scanning every model, but turns the per-call cost from O(models of this flow shape) into O(1) plus the handful of same-named models. This matters because the model set is large (tens of thousands of rows). -
getNamespace
String getNamespace() -
getType
String getType() -
isSubtypes
boolean isSubtypes() -
getName
String getName() -
getSignature
String getSignature() -
getArguments
String getArguments() -
getFullyQualifiedName
-
isConstructor
default boolean isConstructor() -
isMatchOverrides
default boolean isMatchOverrides()- Specified by:
isMatchOverridesin interfaceBasicInvocationMatcher- Returns:
- True if this method matcher should match on overrides of the target type.
-
matchesTargetTypeName
- Specified by:
matchesTargetTypeNamein interfaceBasicInvocationMatcher
-
matchesMethodName
- Specified by:
matchesMethodNamein interfaceBasicInvocationMatcher
-
matchesParameterTypes
- Specified by:
matchesParameterTypesin interfaceBasicInvocationMatcher
-
getArgumentRange
-
computeArgumentRange
The argument positions selected by anArgument[...]access path, as an inclusive range.Mirrors CodeQL's MaD selector grammar: the bracketed list is comma-separated, and each element is
this(the qualifier, position-1), an integer, or an inclusive rangea..b; the selector applies to the union of those positions. A comma-separated union is representable here only when it is contiguous (e.g.this,0={-1, 0}); a non-contiguous union (e.g.0,2) returns empty rather than over-approximating to include positions it does not cover. Returns empty for anything that is not a bareArgument[...]selector (e.g.ReturnValueor a content-suffixed path).
-