S - The annotation type.public abstract static class Advice.DynamicValue.ForFixedValue<S extends Annotation> extends Object implements Advice.DynamicValue<S>
A Advice.DynamicValue implementation that always binds a fixed 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.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Advice.DynamicValue.ForFixedValue.OfAnnotationProperty
A dynamic value binding for an annotation property of an annotation on the bound parameter.
|
protected static class |
Advice.DynamicValue.ForFixedValue.OfConstant
A fixed value binding for a constant pool value.
|
Advice.DynamicValue.ForFieldValue, Advice.DynamicValue.ForFixedValue<S extends Annotation>, Advice.DynamicValue.ForParameterValue, Advice.DynamicValue.ForSerializedValue| Constructor and Description |
|---|
ForFixedValue() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Object |
doResolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<S> annotation,
Assigner assigner,
boolean initialized)
Resolves a constant value that is mapped to a parameter that is annotated with a custom bound annotation.
|
StackManipulation |
resolve(TypeDescription instrumentedType,
MethodDescription instrumentedMethod,
ParameterDescription.InDefinedShape target,
AnnotationDescription.Loadable<S> 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.
|
public StackManipulation resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<S> annotation, Assigner assigner, boolean initialized)
Advice.DynamicValueResolves 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.resolve in interface Advice.DynamicValue<S extends Annotation>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.protected abstract Object doResolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<S> annotation, Assigner assigner, boolean initialized)
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.