Package net.bytebuddy.implementation
Class MethodDelegation.ImplementationDelegate.ForMethodReturn
java.lang.Object
net.bytebuddy.implementation.MethodDelegation.ImplementationDelegate.ForMethodReturn
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodDelegation.ImplementationDelegate
- Enclosing interface:
MethodDelegation.ImplementationDelegate
@Enhance
public static class MethodDelegation.ImplementationDelegate.ForMethodReturn
extends Object
implements MethodDelegation.ImplementationDelegate
An implementation delegate for invoking a delegation target on the another methods return value.
-
Nested Class Summary
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 ElementMatcher
<? super MethodDescription> The matcher to use for filtering methods.private final MethodGraph.Compiler
The method graph compiler to use.private final String
The name of the method to invoke.private 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
ForMethodReturn
(String name, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher) Creates a new implementation delegate for a method return value delegation. -
Method Summary
Modifier and TypeMethodDescriptioncompile
(TypeDescription instrumentedType) Compiles this implementation delegate.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.
-
Field Details
-
name
The name of the method to invoke. -
methodGraphCompiler
The method graph compiler to use. -
parameterBinders
private final List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBindersThe parameter binders to use. -
matcher
The matcher to use for filtering methods.
-
-
Constructor Details
-
ForMethodReturn
protected ForMethodReturn(String name, MethodGraph.Compiler methodGraphCompiler, List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders, ElementMatcher<? super MethodDescription> matcher) Creates a new implementation delegate for a method return value delegation.- Parameters:
name
- The name of the method to invoke.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.
-
prepare
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-