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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ForInstance(Object value, TypeDescription fieldType)
Creates a new argument provider that stores the given value in a static field.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static InvokeDynamic.InvocationProvider.ArgumentProvider
of(Object value)
Creates a new argument provider that stores the given value in a static field of the instance type.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.InvokeDynamic.InvocationProvider.ArgumentProvider.Resolved
resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Assigner.Typing typing)
Resolves an argument provider.
-
-
-
Constructor Detail
-
ForInstance
protected ForInstance(Object value, TypeDescription fieldType)
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 Detail
-
of
protected static InvokeDynamic.InvocationProvider.ArgumentProvider of(Object value)
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
public InstrumentedType prepare(InstrumentedType instrumentedType)
Prepares the instrumented type.- Specified by:
prepare
in interfaceInvokeDynamic.InvocationProvider.ArgumentProvider
- Parameters:
instrumentedType
- The instrumented type.- Returns:
- The prepared instrumented type.
-
-