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.implementation.MethodDelegation.ImplementationDelegate
MethodDelegation.ImplementationDelegate.Compiled, MethodDelegation.ImplementationDelegate.ForConstruction, MethodDelegation.ImplementationDelegate.ForField, MethodDelegation.ImplementationDelegate.ForMethodReturn, MethodDelegation.ImplementationDelegate.ForStaticMethod
-
-
Field Summary
Fields Modifier and Type Field Description private TypeDescription.Generic
fieldType
The field's type.private java.lang.Object
target
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
Constructors Modifier Constructor Description protected
WithInstance(java.lang.String fieldName, MethodGraph.Compiler methodGraphCompiler, java.util.List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher, java.lang.Object target, TypeDescription.Generic fieldType)
Creates a new implementation delegate for invoking methods on a supplied instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstrumentedType
prepare(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 Detail
-
target
private final java.lang.Object target
The target instance.
-
fieldType
private final TypeDescription.Generic fieldType
The field's type.
-
-
Constructor Detail
-
WithInstance
protected WithInstance(java.lang.String fieldName, MethodGraph.Compiler methodGraphCompiler, java.util.List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher, java.lang.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 Detail
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
resolve
protected FieldDescription resolve(TypeDescription instrumentedType)
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.
-
-