Home » openjdk-7 » javax.lang » model » element » [javadoc | source]
javax.lang.model.element
public interface: VariableElement [javadoc | source]

All Implemented Interfaces:
    Element

Represents a field, {@code enum} constant, method or constructor parameter, local variable, resource variable, or exception parameter.
Method from javax.lang.model.element.VariableElement Summary:
getConstantValue
Method from javax.lang.model.element.VariableElement Detail:
 public 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 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}.