Package net.bytebuddy.implementation
Class InvokeDynamic.InvocationProvider.Default
java.lang.Object
net.bytebuddy.implementation.InvokeDynamic.InvocationProvider.Default
- All Implemented Interfaces:
InvokeDynamic.InvocationProvider
- Enclosing interface:
InvokeDynamic.InvocationProvider
@Enhance
public static class InvokeDynamic.InvocationProvider.Default
extends Object
implements InvokeDynamic.InvocationProvider
An invocation provider that requests a synthetic dynamic invocation where all arguments are explicitly
provided by the user.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
A target for a synthetically bound method call.Nested classes/interfaces inherited from interface net.bytebuddy.implementation.InvokeDynamic.InvocationProvider
InvokeDynamic.InvocationProvider.ArgumentProvider, InvokeDynamic.InvocationProvider.Default, InvokeDynamic.InvocationProvider.NameProvider, InvokeDynamic.InvocationProvider.ReturnTypeProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<InvokeDynamic.InvocationProvider.ArgumentProvider> The providers for the method arguments in their order.private final InvokeDynamic.InvocationProvider.NameProvider
The provider for the name of the intercepted method.private final InvokeDynamic.InvocationProvider.ReturnTypeProvider
The provider for the required return type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default()
Creates a new default invocation provider that provides information and arguments of the intercepted method.protected
Default
(InvokeDynamic.InvocationProvider.NameProvider nameProvider, InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider, List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders) Creates a new default invocation provider. -
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.
-
Field Details
-
nameProvider
The provider for the name of the intercepted method. -
returnTypeProvider
The provider for the required return type. -
argumentProviders
The providers for the method arguments in their order.
-
-
Constructor Details
-
Default
protected Default()Creates a new default invocation provider that provides information and arguments of the intercepted method. -
Default
protected Default(InvokeDynamic.InvocationProvider.NameProvider nameProvider, InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider, List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders) Creates a new default invocation provider.- Parameters:
nameProvider
- The provider for the name of the intercepted method.returnTypeProvider
- The provider for the required return type.argumentProviders
- The providers for the method arguments in their order.
-
-
Method Details
-
make
Creates a target for the invocation.- Specified by:
make
in interfaceInvokeDynamic.InvocationProvider
- Parameters:
methodDescription
- The method that is being intercepted.- Returns:
- The target for the invocation.
-
appendArguments
public InvokeDynamic.InvocationProvider appendArguments(List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders) Appends the given arguments to the invocation to be loaded onto the operand stack.- Specified by:
appendArguments
in interfaceInvokeDynamic.InvocationProvider
- 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
public InvokeDynamic.InvocationProvider appendArgument(InvokeDynamic.InvocationProvider.ArgumentProvider argumentProvider) Appends the given argument to the invocation to be loaded onto the operand stack.- Specified by:
appendArgument
in interfaceInvokeDynamic.InvocationProvider
- 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
Returns a copy of this invocation provider that does not add any arguments.- Specified by:
withoutArguments
in interfaceInvokeDynamic.InvocationProvider
- Returns:
- A copy of this invocation provider that does not add any arguments.
-
withNameProvider
public InvokeDynamic.InvocationProvider withNameProvider(InvokeDynamic.InvocationProvider.NameProvider nameProvider) Returns a copy of this invocation provider that applies the given name provider.- Specified by:
withNameProvider
in interfaceInvokeDynamic.InvocationProvider
- Parameters:
nameProvider
- The name provider to be used.- Returns:
- A copy of this invocation provider that applies the given name provider.
-
withReturnTypeProvider
public InvokeDynamic.InvocationProvider withReturnTypeProvider(InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider) Returns a copy of this invocation provider that applies the given return type provider.- Specified by:
withReturnTypeProvider
in interfaceInvokeDynamic.InvocationProvider
- 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.- Specified by:
prepare
in interfaceInvokeDynamic.InvocationProvider
- Parameters:
instrumentedType
- The instrumented type to prepare.- Returns:
- The prepared instrumented type.
-