IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
 
[Sommaire]  [Top 50]  [F.A.Q.]  [ Java SE ]  [ Java EE ]  [Javadoc standard]  [Contact]
[ 1.4.2 ]  [ 5.0 ]  [ 6.0
Rechercher   
Dans
Options   sensible à la casse
étendre la recherche aux descriptions
Préférences
fr en 
 
Moteurs de recherche
JavaTM 2 Platform Std. Ed. v1.6.0

javax.lang.model.element
Interface VariableElement

All Superinterfaces:
Element

public interface VariableElement
extends Element

Represents a field, enum constant, method or constructor parameter, local variable, or exception parameter.

Since:
1.6

Method Summary
 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

getConstantValue

Object getConstantValue()
Returns the value of this variable if this is a 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.

Returns:
the value of this variable if this is a final field initialized to a compile-time constant, or null otherwise
See Also:
Elements.getConstantExpression(Object)
See The Java Language Specification, Third Edition:
15.28 Constant Expression, 4.12.4 final Variables

Copyright 2003 Sun Microsystems, Inc. All rights reserved