Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VariableElement extends Element
Represents a field, enum
constant, method or constructor
parameter, local variable, or exception parameter.
Modifier and Type | Method and Description |
---|---|
Object |
getConstantValue()
Returns the value of this variable if this is a final
field initialized to a compile-time constant. |
Methods inherited from interface javax.lang.model.element.Element |
---|
accept, asType, equals, getAnnotation, getAnnotationMirrors, getEnclosedElements, getEnclosingElement, getKind, getModifiers, getSimpleName, hashCode |
Method Detail |
---|
Object getConstantValue()
final
field initialized to a compile-time constant. Returns null
otherwise. The value will be of a primitive type or a
String
. If the value is of a primitive type, it is
wrapped in the appropriate wrapper class (such as Integer
).
Note that not all final
fields will have
constant values. In particular, 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 String
.
final
field initialized to a compile-time constant, or null
otherwiseElements.getConstantExpression(Object)
|
Java™ Platform Standard Ed. 7 DRAFT ea-b118 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1993, 2010, Oracle Corporation. All rights reserved.