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 java.lang.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 Classes Modifier and Type Class Description protected static class
MethodDelegation.ImplementationDelegate.ForField.WithInstance
An implementation target for a static field that is declared by the instrumented type and that is assigned an instance.protected static class
MethodDelegation.ImplementationDelegate.ForField.WithLookup
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.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 protected java.lang.String
fieldName
The name of the field that is target of the delegation.protected ElementMatcher<? super MethodDescription>
matcher
The matcher to use for filtering methods.protected MethodGraph.Compiler
methodGraphCompiler
The method graph compiler to use.protected java.util.List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>>
parameterBinders
The parameter binders to use.-
Fields inherited from interface net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate
FIELD_NAME_PREFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForField(java.lang.String fieldName, MethodGraph.Compiler methodGraphCompiler, java.util.List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher)
Creates a new implementation delegate for a field delegation.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MethodDelegation.ImplementationDelegate.Compiled
compile(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 Detail
-
fieldName
protected final java.lang.String fieldName
The name of the field that is target of the delegation.
-
methodGraphCompiler
protected final MethodGraph.Compiler methodGraphCompiler
The method graph compiler to use.
-
parameterBinders
protected final java.util.List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders
The parameter binders to use.
-
matcher
protected final ElementMatcher<? super MethodDescription> matcher
The matcher to use for filtering methods.
-
-
Constructor Detail
-
ForField
protected ForField(java.lang.String fieldName, MethodGraph.Compiler methodGraphCompiler, java.util.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 Detail
-
compile
public MethodDelegation.ImplementationDelegate.Compiled compile(TypeDescription instrumentedType)
Compiles this implementation delegate.- Specified by:
compile
in interfaceMethodDelegation.ImplementationDelegate
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- A compiled implementation delegate.
-
resolve
protected abstract FieldDescription resolve(TypeDescription instrumentedType)
Resolves the field to which is delegated.- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The field that is the delegation target.
-
-