variableelement.java

来自「java1.6众多例子参考」· Java 代码 · 共 51 行

JAVA
51
字号
/* * @(#)VariableElement.java	1.4 06/10/05 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.lang.model.element;import javax.lang.model.type.TypeMirror;import javax.lang.model.util.Elements;/** * Represents a field, {@code enum} constant, method or constructor * parameter, local variable, or exception parameter. * * @author Joseph D. Darcy * @author Scott Seligman * @author Peter von der Ah&eacute; * @version 1.4 06/10/05 * @since 1.6 */public interface VariableElement extends Element {    /**     * 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}).     *     * <p>Note that not all {@code final} fields will have     * constant values.  In particular, {@code enum} constants are     * <em>not</em> considered to be compile-time constants.  To have a     * constant value, a field's type must be either a primitive type     * or {@code String}.     *     * @return the value of this variable if this is a {@code final}     * field initialized to a compile-time constant, or {@code null}     * otherwise     *     * @see Elements#getConstantExpression(Object)     * @jls3 15.28 Constant Expression     * @jls3 4.12.4 final Variables     */    Object getConstantValue();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?