T - The type of the annotation this dynamic value requires to provide a mapping.public static interface Advice.DynamicValue<T extends Annotation>
A dynamic value allows to bind parameters of an Advice method to a custom, constant value.
The mapped value must be a constant value that can be embedded into a Java class file. This holds for all primitive types,
instances of String and for Class instances as well as their unloaded TypeDescription representations.
Advice.WithCustomMapping| Modifier and Type | Interface and Description |
|---|---|
static class |
Advice.DynamicValue.ForFieldValue
A dynamic value binding for a field value.
|
static class |
Advice.DynamicValue.ForFixedValue
A
Advice.DynamicValue implementation that always binds a fixed value. |
static class |
Advice.DynamicValue.ForParameterValue
A dynamic value binding for a method parameter.
|
static class |
Advice.DynamicValue.ForSerializedValue
A dynamic value binding that serializes the value as a string and deserializes this string on demand.
|
| Modifier and Type | Method and Description |
|---|---|
StackManipulation |
resolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<T> annotation,
Assigner assigner,
boolean initialized)
Resolves a constant value that is mapped to a parameter that is annotated with a custom bound annotation:
A primitive wrapper value allow binding of the primitive which is optionally boxed but never unboxed.
|
StackManipulation resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Assigner assigner, boolean initialized)
Resolves a constant value that is mapped to a parameter that is annotated with a custom bound annotation:
Class or TypeDescription indicate the binding of a type constant.FieldDescription indicates binding the field value. The field must be visible and be declared by a super type or
be static. A field value is optionally boxed but never unboxed,ParameterDescription indicates binding the assigned argument value. The parameter must be declared by the instrumented method.
The parameter value is optionally boxed but never unboxed,Serializable value is serialized and stored Base64 encoded in the constant pool.instrumentedType - The instrumented type.instrumentedMethod - The instrumented method onto which this advice is applied.target - The target parameter that is bound.annotation - The annotation that triggered this binding.assigner - The assigner to use.initialized - true if the method is initialized when the value is bound, i.e. that the value is not
supplied to a constructor before the super constructor was invoked.Copyright © 2014–2016. All rights reserved.