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.WithLookupNested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOpNested 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.GenericThe field's type.private final ObjectThe target instance.Fields inherited from class net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
fieldName, matcher, methodGraphCompiler, parameterBindersFields inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate
FIELD_NAME_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWithInstance(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 FieldDescriptionresolve(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.ForFieldResolves the field to which is delegated.- Specified by:
resolvein classMethodDelegation.ImplementationDelegate.ForField- Parameters:
instrumentedType- The instrumented type.- Returns:
- The field that is the delegation target.
-