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 java.lang.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 Classes Modifier and Type Class Description protected static class
InvokeDynamic.InvocationProvider.Default.Target
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
Fields Modifier and Type Field Description private java.util.List<InvokeDynamic.InvocationProvider.ArgumentProvider>
argumentProviders
The providers for the method arguments in their order.private InvokeDynamic.InvocationProvider.NameProvider
nameProvider
The provider for the name of the intercepted method.private InvokeDynamic.InvocationProvider.ReturnTypeProvider
returnTypeProvider
The provider for the required return type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
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, java.util.List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders)
Creates a new default invocation provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvokeDynamic.InvocationProvider
appendArgument(InvokeDynamic.InvocationProvider.ArgumentProvider argumentProvider)
Appends the given argument to the invocation to be loaded onto the operand stack.InvokeDynamic.InvocationProvider
appendArguments(java.util.List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders)
Appends the given arguments to the invocation to be loaded onto the operand stack.InvokeDynamic.InvocationProvider.Default.Target
make(MethodDescription methodDescription)
Creates a target for the invocation.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.InvokeDynamic.InvocationProvider
withNameProvider(InvokeDynamic.InvocationProvider.NameProvider nameProvider)
Returns a copy of this invocation provider that applies the given name provider.InvokeDynamic.InvocationProvider
withoutArguments()
Returns a copy of this invocation provider that does not add any arguments.InvokeDynamic.InvocationProvider
withReturnTypeProvider(InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider)
Returns a copy of this invocation provider that applies the given return type provider.
-
-
-
Field Detail
-
nameProvider
private final InvokeDynamic.InvocationProvider.NameProvider nameProvider
The provider for the name of the intercepted method.
-
returnTypeProvider
private final InvokeDynamic.InvocationProvider.ReturnTypeProvider returnTypeProvider
The provider for the required return type.
-
argumentProviders
private final java.util.List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders
The providers for the method arguments in their order.
-
-
Constructor Detail
-
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, java.util.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 Detail
-
make
public InvokeDynamic.InvocationProvider.Default.Target make(MethodDescription methodDescription)
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(java.util.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
public InvokeDynamic.InvocationProvider 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
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.- Specified by:
prepare
in interfaceInvokeDynamic.InvocationProvider
- Parameters:
instrumentedType
- The instrumented type to prepare.- Returns:
- The prepared instrumented type.
-
-