src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java

Print this page




  37  * Note that an {@linkplain EnumDeclaration enum} is a kind of class,
  38  * and an {@linkplain AnnotationTypeDeclaration annotation type} is
  39  * a kind of interface.
  40  *
  41  * <p> <a name="DECL_VS_TYPE"></a>
  42  * While a <tt>TypeDeclaration</tt> represents the <i>declaration</i>
  43  * of a class or interface, a {@link DeclaredType} represents a class
  44  * or interface <i>type</i>, the latter being a use
  45  * (or <i>invocation</i>) of the former.
  46  * The distinction is most apparent with generic types,
  47  * for which a single declaration can define a whole
  48  * family of types.  For example, the declaration of
  49  * {@code java.util.Set} corresponds to the parameterized types
  50  * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
  51  * (and many others), and to the raw type {@code java.util.Set}.
  52  *
  53  * <p> {@link com.sun.mirror.util.DeclarationFilter}
  54  * provides a simple way to select just the items of interest
  55  * when a method returns a collection of declarations.
  56  *





  57  * @author Joseph D. Darcy
  58  * @author Scott Seligman
  59  *
  60  * @see DeclaredType
  61  * @since 1.5
  62  */
  63 

  64 public interface TypeDeclaration extends MemberDeclaration {
  65 
  66     /**
  67      * Returns the package within which this type is declared.
  68      *
  69      * @return the package within which this type is declared
  70      */
  71     PackageDeclaration getPackage();
  72 
  73     /**
  74      * Returns the fully qualified name of this class or interface
  75      * declaration.  More precisely, it returns the <i>canonical</i>
  76      * name.
  77      * The name of a generic type does not include any reference
  78      * to its formal type parameters.
  79      * For example, the the fully qualified name of the interface declaration
  80      * {@code java.util.Set<E>} is <tt>"java.util.Set"</tt>.
  81      *
  82      * @return the fully qualified name of this class or interface declaration
  83      */




  37  * Note that an {@linkplain EnumDeclaration enum} is a kind of class,
  38  * and an {@linkplain AnnotationTypeDeclaration annotation type} is
  39  * a kind of interface.
  40  *
  41  * <p> <a name="DECL_VS_TYPE"></a>
  42  * While a <tt>TypeDeclaration</tt> represents the <i>declaration</i>
  43  * of a class or interface, a {@link DeclaredType} represents a class
  44  * or interface <i>type</i>, the latter being a use
  45  * (or <i>invocation</i>) of the former.
  46  * The distinction is most apparent with generic types,
  47  * for which a single declaration can define a whole
  48  * family of types.  For example, the declaration of
  49  * {@code java.util.Set} corresponds to the parameterized types
  50  * {@code java.util.Set<String>} and {@code java.util.Set<Number>}
  51  * (and many others), and to the raw type {@code java.util.Set}.
  52  *
  53  * <p> {@link com.sun.mirror.util.DeclarationFilter}
  54  * provides a simple way to select just the items of interest
  55  * when a method returns a collection of declarations.
  56  *
  57  * @deprecated All components of this API have been superseded by the
  58  * standardized annotation processing API.  The replacement for the
  59  * functionality of this interface is included in {@link
  60  * javax.lang.model.element.TypeElement}.
  61  *
  62  * @author Joseph D. Darcy
  63  * @author Scott Seligman
  64  *
  65  * @see DeclaredType
  66  * @since 1.5
  67  */
  68 @Deprecated
  69 @SuppressWarnings("deprecation")
  70 public interface TypeDeclaration extends MemberDeclaration {
  71 
  72     /**
  73      * Returns the package within which this type is declared.
  74      *
  75      * @return the package within which this type is declared
  76      */
  77     PackageDeclaration getPackage();
  78 
  79     /**
  80      * Returns the fully qualified name of this class or interface
  81      * declaration.  More precisely, it returns the <i>canonical</i>
  82      * name.
  83      * The name of a generic type does not include any reference
  84      * to its formal type parameters.
  85      * For example, the the fully qualified name of the interface declaration
  86      * {@code java.util.Set<E>} is <tt>"java.util.Set"</tt>.
  87      *
  88      * @return the fully qualified name of this class or interface declaration
  89      */