< prev index next >

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

Print this page

        

@@ -58,10 +58,29 @@
  * @see DeclaredType
  * @since 1.6
  */
 public interface TypeElement extends Element, Parameterizable, QualifiedNameable {
     /**
+     * Returns the type defined by this type element, returning the
+     * <i>prototypical</i> type for an element representing a generic type.
+     *
+     * <p>A generic element defines a family of types, not just one.
+     * If this is a generic element, a prototypical type is
+     * returned which has the element's invocation on the
+     * type variables corresponding to its own formal type parameters.
+     * For example,
+     * for the generic class element {@code C<N extends Number>},
+     * the parameterized type {@code C<N>} is returned.
+     * The {@link Types} utility interface has more general methods
+     * for obtaining the full range of types defined by an element.
+     *
+     * @return the type defined by this type element
+     */
+    @Override
+    TypeMirror asType();
+
+    /**
      * Returns the fields, methods, constructors, and member types
      * that are directly declared in this class or interface.
      *
      * This includes any {@linkplain Elements.Origin#MANDATED
      * mandated} elements such as the (implicit) default constructor
< prev index next >