VariableElementpublic interface VariableElement implements ElementRepresents a field, {@code enum} constant, method or constructor
parameter, local variable, or exception parameter. |
Methods Summary |
---|
public java.lang.Object | getConstantValue()Returns the value of this variable if this is a {@code final}
field initialized to a compile-time constant. Returns {@code
null} otherwise. The value will be of a primitive type or a
{@code String}. If the value is of a primitive type, it is
wrapped in the appropriate wrapper class (such as {@link
Integer}).
Note that not all {@code final} fields will have
constant values. In particular, {@code enum} constants are
not considered to be compile-time constants. To have a
constant value, a field's type must be either a primitive type
or {@code String}.
|
|