Package net.bytebuddy.implementation
Class MethodDelegation.ImplementationDelegate.ForField.WithInstance
java.lang.Object
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField.WithInstance
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodDelegation.ImplementationDelegate
- Enclosing class:
- MethodDelegation.ImplementationDelegate.ForField
@Enhance
protected static class MethodDelegation.ImplementationDelegate.ForField.WithInstance
extends MethodDelegation.ImplementationDelegate.ForField
An implementation target for a static field that is declared by the instrumented type and that is assigned an instance.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
MethodDelegation.ImplementationDelegate.ForField.WithInstance, MethodDelegation.ImplementationDelegate.ForField.WithLookup
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate
MethodDelegation.ImplementationDelegate.Compiled, MethodDelegation.ImplementationDelegate.ForConstruction, MethodDelegation.ImplementationDelegate.ForField, MethodDelegation.ImplementationDelegate.ForMethodReturn, MethodDelegation.ImplementationDelegate.ForStaticMethod
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TypeDescription.Generic
The field's type.private final Object
The target instance.Fields inherited from class net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
fieldName, matcher, methodGraphCompiler, parameterBinders
Fields inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate
FIELD_NAME_PREFIX
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
WithInstance
(String fieldName, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher, Object target, TypeDescription.Generic fieldType) Creates a new implementation delegate for invoking methods on a supplied instance. -
Method Summary
Modifier and TypeMethodDescriptionprepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.protected FieldDescription
resolve
(TypeDescription instrumentedType) Resolves the field to which is delegated.Methods inherited from class net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
compile
-
Field Details
-
target
The target instance. -
fieldType
The field's type.
-
-
Constructor Details
-
WithInstance
protected WithInstance(String fieldName, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher, Object target, TypeDescription.Generic fieldType) Creates a new implementation delegate for invoking methods on a supplied instance.- Parameters:
fieldName
- The name of the field that is target of the delegation.methodGraphCompiler
- The method graph compiler to use.parameterBinders
- The parameter binders to use.matcher
- The matcher to use for filtering methods.target
- The target instance.fieldType
- The field's type.
-
-
Method Details
-
prepare
Prepares a given instrumented type.- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
resolve
Description copied from class:MethodDelegation.ImplementationDelegate.ForField
Resolves the field to which is delegated.- Specified by:
resolve
in classMethodDelegation.ImplementationDelegate.ForField
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The field that is the delegation target.
-