Package net.bytebuddy.implementation
Class MethodDelegation.ImplementationDelegate.Compiled.ForField
java.lang.Object
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.Compiled.ForField
- All Implemented Interfaces:
MethodDelegation.ImplementationDelegate.Compiled
- Enclosing interface:
MethodDelegation.ImplementationDelegate.Compiled
@Enhance
public static class MethodDelegation.ImplementationDelegate.Compiled.ForField
extends Object
implements MethodDelegation.ImplementationDelegate.Compiled
A compiled implementation delegate that invokes methods on a field.
-
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 FieldDescription
The field to delegate to.private final List
<MethodDelegationBinder.Record> The records to consider for delegation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForField
(FieldDescription fieldDescription, 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
-
fieldDescription
The field to delegate to. -
records
The records to consider for delegation.
-
-
Constructor Details
-
ForField
Creates a new compiled implementation delegate for a field delegation.- Parameters:
fieldDescription
- The field to delegate to.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.
-