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 classInvokeDynamic.InvocationProvider.Default.TargetA 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>argumentProvidersThe providers for the method arguments in their order.private InvokeDynamic.InvocationProvider.NameProvidernameProviderThe provider for the name of the intercepted method.private InvokeDynamic.InvocationProvider.ReturnTypeProviderreturnTypeProviderThe provider for the required return type.
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefault()Creates a new default invocation provider that provides information and arguments of the intercepted method.protectedDefault(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.InvocationProviderappendArgument(InvokeDynamic.InvocationProvider.ArgumentProvider argumentProvider)Appends the given argument to the invocation to be loaded onto the operand stack.InvokeDynamic.InvocationProviderappendArguments(java.util.List<InvokeDynamic.InvocationProvider.ArgumentProvider> argumentProviders)Appends the given arguments to the invocation to be loaded onto the operand stack.InvokeDynamic.InvocationProvider.Default.Targetmake(MethodDescription methodDescription)Creates a target for the invocation.InstrumentedTypeprepare(InstrumentedType instrumentedType)Prepares the instrumented type.InvokeDynamic.InvocationProviderwithNameProvider(InvokeDynamic.InvocationProvider.NameProvider nameProvider)Returns a copy of this invocation provider that applies the given name provider.InvokeDynamic.InvocationProviderwithoutArguments()Returns a copy of this invocation provider that does not add any arguments.InvokeDynamic.InvocationProviderwithReturnTypeProvider(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:
makein 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:
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
public InvokeDynamic.InvocationProvider 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
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.- Specified by:
preparein interfaceInvokeDynamic.InvocationProvider- Parameters:
instrumentedType- The instrumented type to prepare.- Returns:
- The prepared instrumented type.
-
-