Package net.bytebuddy.implementation
Class InvokeDynamic.InvocationProvider.ArgumentProvider.ForField
java.lang.Object
net.bytebuddy.implementation.InvokeDynamic.InvocationProvider.ArgumentProvider.ForField
- All Implemented Interfaces:
InvokeDynamic.InvocationProvider.ArgumentProvider
- Direct Known Subclasses:
InvokeDynamic.InvocationProvider.ArgumentProvider.ForField.WithExplicitType
- Enclosing interface:
- InvokeDynamic.InvocationProvider.ArgumentProvider
@Enhance
public static class InvokeDynamic.InvocationProvider.ArgumentProvider.ForField
extends Object
implements InvokeDynamic.InvocationProvider.ArgumentProvider
Provides an argument from an existing field.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An argument provider for a field value with an explicit type.Nested classes/interfaces inherited from interface net.bytebuddy.implementation.InvokeDynamic.InvocationProvider.ArgumentProvider
InvokeDynamic.InvocationProvider.ArgumentProvider.ConstantPoolWrapper, InvokeDynamic.InvocationProvider.ArgumentProvider.ForBooleanConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForByteConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForCharacterConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForClassConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForDoubleConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForEnumerationValue, InvokeDynamic.InvocationProvider.ArgumentProvider.ForField, InvokeDynamic.InvocationProvider.ArgumentProvider.ForFloatConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance, InvokeDynamic.InvocationProvider.ArgumentProvider.ForIntegerConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInterceptedMethodInstanceAndParameters, InvokeDynamic.InvocationProvider.ArgumentProvider.ForInterceptedMethodParameters, InvokeDynamic.InvocationProvider.ArgumentProvider.ForJavaConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForLongConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForMethodParameter, InvokeDynamic.InvocationProvider.ArgumentProvider.ForNullValue, InvokeDynamic.InvocationProvider.ArgumentProvider.ForShortConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForStringConstant, InvokeDynamic.InvocationProvider.ArgumentProvider.ForThisInstance, InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FieldLocator.Factory
The field locator factory to use.protected final String
The name of the field. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForField
(String fieldName, FieldLocator.Factory fieldLocatorFactory) Creates a new argument provider that loads the value of an existing field. -
Method Summary
Modifier and TypeMethodDescriptiondoResolve
(StackManipulation access, TypeDescription.Generic type, Assigner assigner, Assigner.Typing typing) Resolves this argument provider.prepare
(InstrumentedType instrumentedType) Prepares the instrumented type.resolve
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) Resolves an argument provider.
-
Field Details
-
fieldName
The name of the field. -
fieldLocatorFactory
The field locator factory to use.
-
-
Constructor Details
-
ForField
Creates a new argument provider that loads the value of an existing field.- Parameters:
fieldName
- The name of the field.fieldLocatorFactory
- The field locator factory to use.
-
-
Method Details
-
resolve
public InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) Resolves an argument provider.- Specified by:
resolve
in interfaceInvokeDynamic.InvocationProvider.ArgumentProvider
- Parameters:
instrumentedType
- The instrumented type.instrumentedMethod
- The instrumented method.assigner
- The assigner to be used.typing
- Indicates if dynamic type castings should be attempted for incompatible assignments.- Returns:
- A resolved version of this argument provider.
-
doResolve
protected InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved doResolve(StackManipulation access, TypeDescription.Generic type, Assigner assigner, Assigner.Typing typing) Resolves this argument provider.- Parameters:
access
- The stack manipulation for accessing the argument value.type
- The type of the loaded value.assigner
- The assigner to use.typing
- The typing required.- Returns:
- A resolved version of this arguments provider.
-
prepare
Prepares the instrumented type.- Specified by:
prepare
in interfaceInvokeDynamic.InvocationProvider.ArgumentProvider
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The prepared instrumented type.
-