@Retention(value=RUNTIME) @Target(value=FIELD) public @interface RecomputeFieldValue
Feature.BeforeAnalysisAccess.registerFieldValueTransformer(java.lang.reflect.Field, org.graalvm.nativeimage.hosted.FieldValueTransformer)
.
Mechanism to change the value of a field. Normally, field values in the native image heap of the
Substrate VM are just taken from the host VM. This annotation allows the field value to be
intercepted and recomputed.
This annotation must be used on a field also annotated with Alias
to specify the field
whose value needs to be changed.
Modifier and Type | Required Element and Description |
---|---|
RecomputeFieldValue.Kind |
kind
The kind of the recomputation performed.
|
Modifier and Type | Optional Element and Description |
---|---|
Class<?> |
declClass
The class parameter for the recomputation.
|
String |
declClassName
The class parameter for the recomputation.
|
boolean |
disableCaching
If true, ignores previously computed values and calculates the value for every field read.
|
boolean |
isFinal
Treat the value as final, to enforce constant folding already during static analysis.
|
String |
name
The name parameter for the recomputation.
|
public abstract RecomputeFieldValue.Kind kind
public abstract Class<?> declClass
RecomputeFieldValue.declClassName()
is used. If neither RecomputeFieldValue.declClass()
nor
RecomputeFieldValue.declClassName()
is specified, then the class specified by the TargetClass
annotation is used.public abstract String declClassName
RecomputeFieldValue.declClass()
is used. If neither RecomputeFieldValue.declClass()
nor
RecomputeFieldValue.declClassName()
is specified, then the class specified by the TargetClass
annotation is used.public abstract String name