Annotation Interface CConstant


@Retention(RUNTIME) @Target(METHOD) public @interface CConstant
Denotes a method as a C constant value.

Calls to the method are replaced with a compile time constant. The constant value is extracted from the C header file during native image generation.

The class containing the annotated method must be annotated with CContext.

Since:
19.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Allows access to the value of a CConstant during image generation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the name of the C constant.
  • Element Details

    • value

      String value
      Specifies the name of the C constant. If no name is provided, the method name is used as the field name. A possible "get" prefix of the method name is removed.
      Since:
      19.0
      Default:
      ""