< prev index next >

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

Print this page




  43  * for which a single element can define a whole
  44  * family of types.  For example, the element
  45  * {@code java.util.Set} corresponds to the parameterized types
  46  * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
  47  * (and many others), and to the raw type {@code java.util.Set}.
  48  *
  49  * <p> Each method of this interface that returns a list of elements
  50  * will return them in the order that is natural for the underlying
  51  * source of program information.  For example, if the underlying
  52  * source of information is Java source code, then the elements will be
  53  * returned in source code order.
  54  *
  55  * @author Joseph D. Darcy
  56  * @author Scott Seligman
  57  * @author Peter von der Ah&eacute;
  58  * @see DeclaredType
  59  * @since 1.6
  60  */
  61 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
  62     /**



















  63      * Returns the fields, methods, constructors, and member types
  64      * that are directly declared in this class or interface.
  65      *
  66      * This includes any {@linkplain Elements.Origin#MANDATED
  67      * mandated} elements such as the (implicit) default constructor
  68      * and the implicit {@code values} and {@code valueOf} methods of
  69      * an enum type.
  70      *
  71      * @apiNote As a particular instance of the {@linkplain
  72      * javax.lang.model.element general accuracy requirements} and the
  73      * ordering behavior required of this interface, the list of
  74      * enclosed elements will be returned in the natural order for the
  75      * originating source of information about the type.  For example,
  76      * if the information about the type is originating from a source
  77      * file, the elements will be returned in source code order.
  78      * (However, in that case the the ordering of {@linkplain
  79      * Elements.Origin#MANDATED implicitly declared} elements, such as
  80      * default constructors, is not specified.)
  81      *
  82      * @return the enclosed elements in proper order, or an empty list if none




  43  * for which a single element can define a whole
  44  * family of types.  For example, the element
  45  * {@code java.util.Set} corresponds to the parameterized types
  46  * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
  47  * (and many others), and to the raw type {@code java.util.Set}.
  48  *
  49  * <p> Each method of this interface that returns a list of elements
  50  * will return them in the order that is natural for the underlying
  51  * source of program information.  For example, if the underlying
  52  * source of information is Java source code, then the elements will be
  53  * returned in source code order.
  54  *
  55  * @author Joseph D. Darcy
  56  * @author Scott Seligman
  57  * @author Peter von der Ah&eacute;
  58  * @see DeclaredType
  59  * @since 1.6
  60  */
  61 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
  62     /**
  63      * Returns the type defined by this type element, returning the
  64      * <i>prototypical</i> type for an element representing a generic type.
  65      *
  66      * <p>A generic element defines a family of types, not just one.
  67      * If this is a generic element, a prototypical type is
  68      * returned which has the element's invocation on the
  69      * type variables corresponding to its own formal type parameters.
  70      * For example,
  71      * for the generic class element {@code C<N extends Number>},
  72      * the parameterized type {@code C<N>} is returned.
  73      * The {@link Types} utility interface has more general methods
  74      * for obtaining the full range of types defined by an element.
  75      *
  76      * @return the type defined by this type element
  77      */
  78     @Override
  79     TypeMirror asType();
  80 
  81     /**
  82      * Returns the fields, methods, constructors, and member types
  83      * that are directly declared in this class or interface.
  84      *
  85      * This includes any {@linkplain Elements.Origin#MANDATED
  86      * mandated} elements such as the (implicit) default constructor
  87      * and the implicit {@code values} and {@code valueOf} methods of
  88      * an enum type.
  89      *
  90      * @apiNote As a particular instance of the {@linkplain
  91      * javax.lang.model.element general accuracy requirements} and the
  92      * ordering behavior required of this interface, the list of
  93      * enclosed elements will be returned in the natural order for the
  94      * originating source of information about the type.  For example,
  95      * if the information about the type is originating from a source
  96      * file, the elements will be returned in source code order.
  97      * (However, in that case the the ordering of {@linkplain
  98      * Elements.Origin#MANDATED implicitly declared} elements, such as
  99      * default constructors, is not specified.)
 100      *
 101      * @return the enclosed elements in proper order, or an empty list if none


< prev index next >