public abstract class SnippetSubstitutionInvocationPlugin<T extends SnippetTemplate.AbstractTemplates> extends InvocationPlugin.InlineOnlyInvocationPlugin
InvocationPlugin.InlineOnlyInvocationPlugin, InvocationPlugin.OptionalInvocationPlugin, InvocationPlugin.Receiver, InvocationPlugin.RequiredInlineOnlyInvocationPlugin, InvocationPlugin.RequiredInvocationPluginargumentsDescriptor, isStatic, name| Constructor and Description |
|---|
SnippetSubstitutionInvocationPlugin(Class<T> templateClass,
String name,
Type... argumentTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
execute(GraphBuilderContext b,
ResolvedJavaMethod targetMethod,
InvocationPlugin.Receiver receiver,
ValueNode[] args)
Executes this plugin against a set of invocation arguments.
|
protected Object[] |
getConstantArguments(ResolvedJavaMethod targetMethod)
Provide any extra arguments that should be passed to the
Snippet as
Snippet.ConstantParameter arguments. |
abstract SnippetTemplate.SnippetInfo |
getSnippet(T templates) |
inlineOnlyapply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, canBeDisabled, defaultHandler, getArgumentsSize, getMethodNameWithArgumentsDescriptor, getSourceLocation, isDecorator, isOptional, match, match, rewriteReceiverTypepublic abstract SnippetTemplate.SnippetInfo getSnippet(T templates)
public boolean execute(GraphBuilderContext b, ResolvedJavaMethod targetMethod, InvocationPlugin.Receiver receiver, ValueNode[] args)
InvocationPluginInvocationPlugin dispatches to the apply(...)
method that matches the number of arguments.execute in class InvocationPlugintargetMethod - the method for which this plugin is being appliedreceiver - access to the receiver, null if targetMethod is staticargs - all arguments to the invocation include the receiver in position
0 if targetMethod is not statictrue if this plugin handled the invocation of targetMethod
false if the graph builder should process the invoke further (e.g., by
inlining it or creating an Invoke node). A plugin that does not handle an
invocation must not modify the graph being constructed unless it is a
decorator.protected Object[] getConstantArguments(ResolvedJavaMethod targetMethod)
Snippet as
Snippet.ConstantParameter arguments.