Annotation Interface RecomputeFieldValue


@Retention(RUNTIME) @Target(FIELD) public @interface RecomputeFieldValue
Supported API is available to replace this non-API annotation: Use 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.

Since:
22.3
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The kind of the recomputation performed.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The class parameter for the recomputation.
    The class parameter for the recomputation.
    boolean
    Treat the value as final, to enforce constant folding already during static analysis.
    The name parameter for the recomputation.
  • Element Details

    • kind

      The kind of the recomputation performed.
      Since:
      22.3
    • declClass

      Class<?> declClass
      The class parameter for the recomputation. If this attribute is not specified, then the class specified by declClassName() is used. If neither declClass() nor declClassName() is specified, then the class specified by the TargetClass annotation is used.
      Since:
      22.3
      Default:
      com.oracle.svm.core.annotate.RecomputeFieldValue.class
    • declClassName

      String declClassName
      The class parameter for the recomputation. If this attribute is not specified, then the class specified by declClass() is used. If neither declClass() nor declClassName() is specified, then the class specified by the TargetClass annotation is used.
      Since:
      22.3
      Default:
      ""
    • name

      String name
      The name parameter for the recomputation.
      Since:
      22.3
      Default:
      ""
    • isFinal

      boolean isFinal
      Treat the value as final, to enforce constant folding already during static analysis.
      Since:
      22.3
      Default:
      false