src/share/classes/com/sun/mirror/type/DeclaredType.java

Print this page




  31 import com.sun.mirror.declaration.TypeDeclaration;
  32 
  33 
  34 /**
  35  * Represents a declared type, either a class type or an interface type.
  36  * This includes parameterized types such as {@code java.util.Set<String>}
  37  * as well as raw types.
  38  *
  39  * <p> While a <tt>TypeDeclaration</tt> represents the <i>declaration</i>
  40  * of a class or interface, a <tt>DeclaredType</tt> represents a class
  41  * or interface <i>type</i>, the latter being a use of the former.
  42  * See {@link TypeDeclaration} for more on this distinction.
  43  *
  44  * <p> A <tt>DeclaredType</tt> may represent a type
  45  * for which details (declaration, supertypes, <i>etc.</i>) are unknown.
  46  * This may be the result of a processing error, such as a missing class file,
  47  * and is indicated by {@link #getDeclaration()} returning <tt>null</tt>.
  48  * Other method invocations on such an unknown type will not, in general,
  49  * return meaningful results.
  50  *





  51  * @author Joseph D. Darcy
  52  * @author Scott Seligman
  53  * @since 1.5
  54  */
  55 

  56 public interface DeclaredType extends ReferenceType {
  57 
  58     /**
  59      * Returns the declaration of this type.
  60      *
  61      * <p> Returns null if this type's declaration is unknown.  This may
  62      * be the result of a processing error, such as a missing class file.
  63      *
  64      * @return the declaration of this type, or null if unknown
  65      */
  66     TypeDeclaration getDeclaration();
  67 
  68     /**
  69      * Returns the type that contains this type as a member.
  70      * Returns <tt>null</tt> if this is a top-level type.
  71      *
  72      * <p> For example, the containing type of {@code O.I<S>}
  73      * is the type {@code O}, and the containing type of
  74      * {@code O<T>.I<S>} is the type {@code O<T>}.
  75      *




  31 import com.sun.mirror.declaration.TypeDeclaration;
  32 
  33 
  34 /**
  35  * Represents a declared type, either a class type or an interface type.
  36  * This includes parameterized types such as {@code java.util.Set<String>}
  37  * as well as raw types.
  38  *
  39  * <p> While a <tt>TypeDeclaration</tt> represents the <i>declaration</i>
  40  * of a class or interface, a <tt>DeclaredType</tt> represents a class
  41  * or interface <i>type</i>, the latter being a use of the former.
  42  * See {@link TypeDeclaration} for more on this distinction.
  43  *
  44  * <p> A <tt>DeclaredType</tt> may represent a type
  45  * for which details (declaration, supertypes, <i>etc.</i>) are unknown.
  46  * This may be the result of a processing error, such as a missing class file,
  47  * and is indicated by {@link #getDeclaration()} returning <tt>null</tt>.
  48  * Other method invocations on such an unknown type will not, in general,
  49  * return meaningful results.
  50  *
  51  * @deprecated All components of this API have been superseded by the
  52  * standardized annotation processing API.  The replacement for the
  53  * functionality of this interface is included in {@link
  54  * javax.lang.model.type.DeclaredType}.
  55  *
  56  * @author Joseph D. Darcy
  57  * @author Scott Seligman
  58  * @since 1.5
  59  */
  60 @Deprecated
  61 @SuppressWarnings("deprecation")
  62 public interface DeclaredType extends ReferenceType {
  63 
  64     /**
  65      * Returns the declaration of this type.
  66      *
  67      * <p> Returns null if this type's declaration is unknown.  This may
  68      * be the result of a processing error, such as a missing class file.
  69      *
  70      * @return the declaration of this type, or null if unknown
  71      */
  72     TypeDeclaration getDeclaration();
  73 
  74     /**
  75      * Returns the type that contains this type as a member.
  76      * Returns <tt>null</tt> if this is a top-level type.
  77      *
  78      * <p> For example, the containing type of {@code O.I<S>}
  79      * is the type {@code O}, and the containing type of
  80      * {@code O<T>.I<S>} is the type {@code O<T>}.
  81      *