Package net.bytebuddy.implementation
Class MethodCall.FieldSetting
- java.lang.Object
-
- net.bytebuddy.implementation.MethodCall.FieldSetting
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,Implementation
,Implementation.Composable
- Enclosing class:
- MethodCall
@Enhance public static class MethodCall.FieldSetting extends java.lang.Object implements Implementation.Composable
AMethodCall
that sets the call's result as the value of a field.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
MethodCall.FieldSetting.Appender
A byte code appender to implement a field-setting method call.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
-
-
Field Summary
Fields Modifier and Type Field Description private MethodCall
methodCall
The represented method call.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldSetting(MethodCall methodCall)
Creates a new field setting method call.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Implementation
andThen(Implementation implementation)
Appends the supplied implementation to this implementation.Implementation.Composable
andThen(Implementation.Composable implementation)
Appends the supplied composable implementation to this implementation.ByteCodeAppender
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.Implementation.Composable
withAssigner(Assigner assigner, Assigner.Typing typing)
Defines an assigner to be used for assigning values to the parameters of the invoked method.
-
-
-
Field Detail
-
methodCall
private final MethodCall methodCall
The represented method call.
-
-
Constructor Detail
-
FieldSetting
protected FieldSetting(MethodCall methodCall)
Creates a new field setting method call.- Parameters:
methodCall
- The represented method call.
-
-
Method Detail
-
withAssigner
public Implementation.Composable withAssigner(Assigner assigner, Assigner.Typing typing)
Defines an assigner to be used for assigning values to the parameters of the invoked method. This assigner is also used for assigning the invoked method's return value to the field being set.- Parameters:
assigner
- The assigner to use.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.- Returns:
- This field-setting method call using the provided assigner.
-
prepare
public InstrumentedType prepare(InstrumentedType instrumentedType)
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.
-
appender
public ByteCodeAppender appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.- Specified by:
appender
in interfaceImplementation
- Parameters:
implementationTarget
- The target of the current implementation.- Returns:
- A byte code appender for implementing methods delegated to this implementation. This byte code appender
is also responsible for handling methods that were added by this implementation on the call to
InstrumentedType.Prepareable.prepare(InstrumentedType)
.
-
andThen
public Implementation andThen(Implementation implementation)
Appends the supplied implementation to this implementation.- Specified by:
andThen
in interfaceImplementation.Composable
- Parameters:
implementation
- The subsequent implementation.- Returns:
- An implementation that combines this implementation with the provided one.
-
andThen
public Implementation.Composable andThen(Implementation.Composable implementation)
Appends the supplied composable implementation to this implementation.- Specified by:
andThen
in interfaceImplementation.Composable
- Parameters:
implementation
- The subsequent composable implementation.- Returns:
- A composable implementation that combines this implementation with the provided one.
-
-