Package net.bytebuddy.implementation
Class MethodDelegation.ImplementationDelegate.ForField
java.lang.Object
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForField
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodDelegation.ImplementationDelegate
- Direct Known Subclasses:
MethodDelegation.ImplementationDelegate.ForField.WithInstance
,MethodDelegation.ImplementationDelegate.ForField.WithLookup
- Enclosing interface:
MethodDelegation.ImplementationDelegate
@Enhance
public abstract static class MethodDelegation.ImplementationDelegate.ForField
extends Object
implements MethodDelegation.ImplementationDelegate
An implementation delegate for invoking methods on a field that is declared by the instrumented type or a super type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An implementation target for a static field that is declared by the instrumented type and that is assigned an instance.protected static class
An implementation target for a field that is declared by the instrumented type or a super type.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 TypeFieldDescriptionprotected final String
The name of the field that is target of the delegation.protected final ElementMatcher
<? super MethodDescription> The matcher to use for filtering methods.protected final MethodGraph.Compiler
The method graph compiler to use.protected final List
<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> The parameter binders to use.Fields inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate
FIELD_NAME_PREFIX
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForField
(String fieldName, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher) Creates a new implementation delegate for a field delegation. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(TypeDescription instrumentedType) Compiles this implementation delegate.protected abstract FieldDescription
resolve
(TypeDescription instrumentedType) Resolves the field to which is delegated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
prepare
-
Field Details
-
fieldName
The name of the field that is target of the delegation. -
methodGraphCompiler
The method graph compiler to use. -
parameterBinders
protected final List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBindersThe parameter binders to use. -
matcher
The matcher to use for filtering methods.
-
-
Constructor Details
-
ForField
protected ForField(String fieldName, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher) Creates a new implementation delegate for a field delegation.- 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.
-
-
Method Details
-
compile
Compiles this implementation delegate.- Specified by:
compile
in interfaceMethodDelegation.ImplementationDelegate
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- A compiled implementation delegate.
-
resolve
Resolves the field to which is delegated.- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The field that is the delegation target.
-