Class CConstant.ValueAccess
java.lang.Object
org.graalvm.nativeimage.c.constant.CConstant.ValueAccess
- Enclosing class:
CConstant
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TReturns the value of aCConstant, i.e., the same value that calling the annotated method would return.static <T> TReturns the value of aCEnum, i.e., the same value that calling the method annotated withCEnumValuewould return.
-
Method Details
-
get
Returns the value of aCConstant, i.e., the same value that calling the annotated method would return.This method is useful during native image generation, when the annotated method cannot be called.
- Parameters:
declaringClass- The class that contains the method.methodName- The name of the method annotated withCConstant.returnType- The desired type of the returned value. For integer-kind constants, the supported types areBoolean,Byte,Short,Character,Integer, andLong. For floating point constants, the supported types areDoubleandFloat. For string constants, the only supported types areStringandbyte[].- Returns:
- The value of the C constant.
- Since:
- 19.0
-
get
Returns the value of aCEnum, i.e., the same value that calling the method annotated withCEnumValuewould return.This method is useful during native image generation, when the annotated method cannot be called.
- Parameters:
cEnum- The enum value for which the C value should be returned. The enum type must be annotated withCEnum.methodName- The name of the method annotated withCEnumValue.- Returns:
- The value of the C constant.
- Since:
- 24.2
-