Package net.bytebuddy.implementation
Interface InvokeDynamic.InvocationProvider
- All Known Implementing Classes:
InvokeDynamic.InvocationProvider.Default
- Enclosing class:
InvokeDynamic
protected static interface InvokeDynamic.InvocationProvider
An invocation provider is responsible for loading the arguments of the invoked method onto the operand
stack and for creating the actual invoke dynamic instruction.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
An argument provider is responsible for loading arguments to a bootstrapped method onto the operand stack and providing the types of these arguments.static class
An invocation provider that requests a synthetic dynamic invocation where all arguments are explicitly provided by the user.static interface
Provides the name of the method that is to be bound by a dynamic method call.static interface
Provides the return type that is requested from the bootstrap method.static interface
A target for a dynamic method invocation. -
Method Summary
Modifier and TypeMethodDescriptionappendArgument
(InvokeDynamic.InvocationProvider.ArgumentProvider argumentProvider) Appends the given argument to the invocation to be loaded onto the operand stack.appendArguments
(List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders) Appends the given arguments to the invocation to be loaded onto the operand stack.make
(MethodDescription methodDescription) Creates a target for the invocation.prepare
(InstrumentedType instrumentedType) Prepares the instrumented type.Returns a copy of this invocation provider that applies the given name provider.Returns a copy of this invocation provider that does not add any arguments.withReturnTypeProvider
(InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider) Returns a copy of this invocation provider that applies the given return type provider.
-
Method Details
-
make
Creates a target for the invocation.- Parameters:
methodDescription
- The method that is being intercepted.- Returns:
- The target for the invocation.
-
appendArguments
InvokeDynamic.InvocationProvider appendArguments(List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders) Appends the given arguments to the invocation to be loaded onto the operand stack.- Parameters:
argumentProviders
- The next arguments to be loaded onto the operand stack.- Returns:
- An invocation provider for this target that loads the given arguments onto the operand stack.
-
appendArgument
InvokeDynamic.InvocationProvider appendArgument(InvokeDynamic.InvocationProvider.ArgumentProvider argumentProvider) Appends the given argument to the invocation to be loaded onto the operand stack.- Parameters:
argumentProvider
- The next argument to be loaded onto the operand stack.- Returns:
- An invocation provider for this target that loads the given arguments onto the operand stack.
-
withoutArguments
InvokeDynamic.InvocationProvider withoutArguments()Returns a copy of this invocation provider that does not add any arguments.- Returns:
- A copy of this invocation provider that does not add any arguments.
-
withNameProvider
InvokeDynamic.InvocationProvider withNameProvider(InvokeDynamic.InvocationProvider.NameProvider nameProvider) Returns a copy of this invocation provider that applies the given name provider.- Parameters:
nameProvider
- The name provider to be used.- Returns:
- A copy of this invocation provider that applies the given name provider.
-
withReturnTypeProvider
InvokeDynamic.InvocationProvider withReturnTypeProvider(InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider) Returns a copy of this invocation provider that applies the given return type provider.- Parameters:
returnTypeProvider
- The return type provider to be used.- Returns:
- A copy of this invocation provider that applies the given return type provider.
-
prepare
Prepares the instrumented type.- Parameters:
instrumentedType
- The instrumented type to prepare.- Returns:
- The prepared instrumented type.
-