Package net.bytebuddy.implementation
Class InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance
java.lang.Object
net.bytebuddy.implementation.InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance
- All Implemented Interfaces:
InvokeDynamic.InvocationProvider.ArgumentProvider
- Enclosing interface:
InvokeDynamic.InvocationProvider.ArgumentProvider
@Enhance
public static class InvokeDynamic.InvocationProvider.ArgumentProvider.ForInstance
extends Object
implements InvokeDynamic.InvocationProvider.ArgumentProvider
An argument provider for a value that is stored in a randomly named static field.
-
Nested Class Summary
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 TypeFieldDescriptionprivate static final String
The prefix of any field generated by this argument provider.private final TypeDescription
The type of the static field.private final String
The name of the field.private final Object
The value that is stored in the static field. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForInstance
(Object value, TypeDescription fieldType) Creates a new argument provider that stores the given value in a static field. -
Method Summary
Modifier and TypeMethodDescriptionprotected static InvokeDynamic.InvocationProvider.ArgumentProvider
Creates a new argument provider that stores the given value in a static field of the instance type.prepare
(InstrumentedType instrumentedType) Prepares the instrumented type.resolve
(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing) Resolves an argument provider.
-
Field Details
-
FIELD_PREFIX
The prefix of any field generated by this argument provider.- See Also:
-
value
The value that is stored in the static field. -
fieldType
The type of the static field. -
name
The name of the field.
-
-
Constructor Details
-
ForInstance
Creates a new argument provider that stores the given value in a static field.- Parameters:
value
- The value that is to be provided to the bootstrapped method.fieldType
- The type of the field which is also provided to the bootstrap method.
-
-
Method Details
-
of
Creates a new argument provider that stores the given value in a static field of the instance type.- Parameters:
value
- The value that is to be provided to the bootstrapped method.- Returns:
- A corresponding argument provider.
-
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.
-
prepare
Prepares the instrumented type.- Specified by:
prepare
in interfaceInvokeDynamic.InvocationProvider.ArgumentProvider
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The prepared instrumented type.
-