Package net.bytebuddy.implementation
Class MethodDelegation.ImplementationDelegate.Compiled.ForMethodReturn
java.lang.Object
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.Compiled.ForMethodReturn
- All Implemented Interfaces:
MethodDelegation.ImplementationDelegate.Compiled
- Enclosing interface:
MethodDelegation.ImplementationDelegate.Compiled
@Enhance
public static class MethodDelegation.ImplementationDelegate.Compiled.ForMethodReturn
extends Object
implements MethodDelegation.ImplementationDelegate.Compiled
A compiled implementation delegate that invokes a method on an instance that is returned by another method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.Compiled
MethodDelegation.ImplementationDelegate.Compiled.ForConstruction, MethodDelegation.ImplementationDelegate.Compiled.ForField, MethodDelegation.ImplementationDelegate.Compiled.ForMethodReturn, MethodDelegation.ImplementationDelegate.Compiled.ForStaticCall
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodDescription
The method to call for result.private final List
<MethodDelegationBinder.Record> The records to consider for delegation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForMethodReturn
(MethodDescription methodDescription, List<MethodDelegationBinder.Record> records) Creates a new compiled implementation delegate for a field delegation. -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of binding records to consider for delegation.invoke()
Resolves an invoker to use for invoking the delegation target.prepare
(MethodDescription instrumentedMethod) Resolves a stack manipulation that prepares the delegation invocation.
-
Field Details
-
methodDescription
The method to call for result. -
records
The records to consider for delegation.
-
-
Constructor Details
-
ForMethodReturn
protected ForMethodReturn(MethodDescription methodDescription, List<MethodDelegationBinder.Record> records) Creates a new compiled implementation delegate for a field delegation.- Parameters:
methodDescription
- The method to call for result.records
- The records to consider for delegation.
-
-
Method Details
-
prepare
Resolves a stack manipulation that prepares the delegation invocation.- Specified by:
prepare
in interfaceMethodDelegation.ImplementationDelegate.Compiled
- Parameters:
instrumentedMethod
- The instrumented method.- Returns:
- A stack manipulation that is applied prior to loading arguments and executing the method call.
-
invoke
Resolves an invoker to use for invoking the delegation target.- Specified by:
invoke
in interfaceMethodDelegation.ImplementationDelegate.Compiled
- Returns:
- The method invoker to use.
-
getRecords
Returns a list of binding records to consider for delegation.- Specified by:
getRecords
in interfaceMethodDelegation.ImplementationDelegate.Compiled
- Returns:
- A list of delegation binder records to consider.
-