< prev index next >

src/java.compiler/share/classes/javax/lang/model/element/VariableElement.java

Print this page




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.lang.model.element;
  27 
  28 import javax.lang.model.util.Elements;
  29 import javax.lang.model.type.TypeMirror;
  30 import javax.lang.model.type.TypeKind;
  31 
  32 /**
  33  * Represents a field, {@code enum} constant, method or constructor
  34  * parameter, local variable, resource variable, or exception
  35  * parameter.
  36  *
  37  * @author Joseph D. Darcy
  38  * @author Scott Seligman
  39  * @author Peter von der Ah&eacute;
  40  * @since 1.6
  41  */
  42 public interface VariableElement extends Element {
  43     /**
  44      * Returns the type of this variable.
  45      *
  46      * Note that the types of variables range over {@linkplain
  47      * TypeKind many kinds} of types, including primitive types,
  48      * declared types, and array types, among others.
  49      *
  50      * @return the type of this variable
  51      *
  52      * @see TypeKind
  53      */
  54     @Override
  55     TypeMirror asType();


  80 
  81     /**
  82      * Returns the simple name of this variable element.
  83      *
  84      * <p>For method and constructor parameters, the name of each
  85      * parameter must be distinct from the names of all other
  86      * parameters of the same executable.  If the original source
  87      * names are not available, an implementation may synthesize names
  88      * subject to the distinctness requirement above.
  89      *
  90      * @return the simple name of this variable element
  91      */
  92     @Override
  93     Name getSimpleName();
  94 
  95     /**
  96      * Returns the enclosing element of this variable.
  97      *
  98      * The enclosing element of a method or constructor parameter is
  99      * the executable declaring the parameter.



 100      *
 101      * @return the enclosing element of this variable
 102      */
 103     @Override
 104     Element getEnclosingElement();
 105 }


  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.lang.model.element;
  27 
  28 import javax.lang.model.util.Elements;
  29 import javax.lang.model.type.TypeMirror;
  30 import javax.lang.model.type.TypeKind;
  31 
  32 /**
  33  * Represents a field, {@code enum} constant, method or constructor
  34  * parameter, local variable, resource variable, exception
  35  * parameter, or state component.
  36  *
  37  * @author Joseph D. Darcy
  38  * @author Scott Seligman
  39  * @author Peter von der Ah&eacute;
  40  * @since 1.6
  41  */
  42 public interface VariableElement extends Element {
  43     /**
  44      * Returns the type of this variable.
  45      *
  46      * Note that the types of variables range over {@linkplain
  47      * TypeKind many kinds} of types, including primitive types,
  48      * declared types, and array types, among others.
  49      *
  50      * @return the type of this variable
  51      *
  52      * @see TypeKind
  53      */
  54     @Override
  55     TypeMirror asType();


  80 
  81     /**
  82      * Returns the simple name of this variable element.
  83      *
  84      * <p>For method and constructor parameters, the name of each
  85      * parameter must be distinct from the names of all other
  86      * parameters of the same executable.  If the original source
  87      * names are not available, an implementation may synthesize names
  88      * subject to the distinctness requirement above.
  89      *
  90      * @return the simple name of this variable element
  91      */
  92     @Override
  93     Name getSimpleName();
  94 
  95     /**
  96      * Returns the enclosing element of this variable.
  97      *
  98      * The enclosing element of a method or constructor parameter is
  99      * the executable declaring the parameter.
 100      *
 101      * The enclosing element of a state component is the type
 102      * declaring the state component.
 103      *
 104      * @return the enclosing element of this variable
 105      */
 106     @Override
 107     Element getEnclosingElement();
 108 }
< prev index next >