Modifier and Type | Method and Description |
---|---|
static <T> T |
get(Class<?> declaringClass,
String methodName,
Class<T> returnType)
Returns the value of a
CConstant , i.e., the same value that calling the annotated
method would return. |
public static <T> T get(Class<?> declaringClass, String methodName, Class<T> returnType)
CConstant
, 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.
declaringClass
- The class that contains the method annotated with CConstant
.methodName
- The name of the method annotated with CConstant
.returnType
- The desired type of the returned value. For integer-kind constants, the
supported types are Long
, Integer
, and Boolean
. For
floating point constants, the only supported type is Double
. For
string constants, the only supported type is String
.