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 classA target for a synthetically bound method call.Nested classes/interfaces inherited from interface 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.NameProviderThe provider for the name of the intercepted method.private final InvokeDynamic.InvocationProvider.ReturnTypeProviderThe provider for the required return type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault()Creates a new default invocation provider that provides information and arguments of the intercepted method.protectedDefault(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:
makein 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:
appendArgumentsin 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:
appendArgumentin 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:
withoutArgumentsin 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:
withNameProviderin 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:
withReturnTypeProviderin 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:
preparein interfaceInvokeDynamic.InvocationProvider- Parameters:
instrumentedType- The instrumented type to prepare.- Returns:
- The prepared instrumented type.
-