com.sun.mirror.declaration

## Interface TypeDeclaration

- All Superinterfaces:
    Declaration, MemberDeclaration
  All Known Subinterfaces:
    AnnotationTypeDeclaration, ClassDeclaration, EnumDeclaration, InterfaceDeclaration

  Deprecated.
  All components of this API have been superseded by the standardized annotation processing API. The replacement for the functionality of this interface is included in `TypeElement`.

      @Deprecated
      public interface TypeDeclaration
      extends MemberDeclaration

  Represents the declaration of a class or interface. Provides access to information about the type and its members. Note that an enum is a kind of class, and an annotation type is a kind of interface.

  While a `TypeDeclaration` represents the declaration of a class or interface, a `DeclaredType` represents a class or interface type, the latter being a use (or invocation) of the former. The distinction is most apparent with generic types, for which a single declaration can define a whole family of types. For example, the declaration of `java.util.Set` corresponds to the parameterized types `java.util.Set<String>` and `java.util.Set<Number>` (and many others), and to the raw type `java.util.Set`.

  `DeclarationFilter` provides a simple way to select just the items of interest when a method returns a collection of declarations.

  Since:
    1.5
  See Also:
    `DeclaredType`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<FieldDeclaration>` | `getFields()` Deprecated. Returns the fields that are directly declared by this class or interface.
    `Collection<TypeParameterDeclaration>` | `getFormalTypeParameters()` Deprecated. Returns the formal type parameters of this class or interface.
    `Collection<? extends MethodDeclaration>` | `getMethods()` Deprecated. Returns the methods that are directly declared by this class or interface.
    `Collection<TypeDeclaration>` | `getNestedTypes()` Deprecated. Returns the declarations of the nested classes and interfaces that are directly declared by this class or interface.
    `PackageDeclaration` | `getPackage()` Deprecated. Returns the package within which this type is declared.
    `String` | `getQualifiedName()` Deprecated. Returns the fully qualified name of this class or interface declaration.
    `Collection<InterfaceType>` | `getSuperinterfaces()` Deprecated. Returns the interface types directly implemented by this class or extended by this interface.

    - ### Methods inherited from interface com.sun.mirror.declaration.MemberDeclaration

      `getDeclaringType`

    - ### Methods inherited from interface com.sun.mirror.declaration.Declaration

      `accept, equals, getAnnotation, getAnnotationMirrors, getDocComment, getModifiers, getPosition, getSimpleName`

- - ### Method Detail

    - #### getPackage

          PackageDeclaration getPackage()

      Deprecated.
      Returns the package within which this type is declared.
      Returns:
        the package within which this type is declared

    - #### getQualifiedName

          String getQualifiedName()

      Deprecated.
      Returns the fully qualified name of this class or interface declaration. More precisely, it returns the canonical name. The name of a generic type does not include any reference to its formal type parameters. For example, the the fully qualified name of the interface declaration `java.util.Set<E>` is `"java.util.Set"`.
      Returns:
        the fully qualified name of this class or interface declaration

    - #### getFormalTypeParameters

          Collection<TypeParameterDeclaration> getFormalTypeParameters()

      Deprecated.
      Returns the formal type parameters of this class or interface.
      Returns:
        the formal type parameters, or an empty collection if there are none

    - #### getSuperinterfaces

          Collection<InterfaceType> getSuperinterfaces()

      Deprecated.
      Returns the interface types directly implemented by this class or extended by this interface.
      Returns:
        the interface types directly implemented by this class or extended by this interface, or an empty collection if there are none
      See Also:
        `DeclarationFilter`

    - #### getFields

          Collection<FieldDeclaration> getFields()

      Deprecated.
      Returns the fields that are directly declared by this class or interface. Includes enum constants.
      Returns:
        the fields that are directly declared, or an empty collection if there are none
      See Also:
        `DeclarationFilter`

    - #### getMethods

          Collection<? extends MethodDeclaration> getMethods()

      Deprecated.
      Returns the methods that are directly declared by this class or interface. Includes annotation type elements. Excludes implicitly declared methods of an interface, such as `toString`, that correspond to the methods of `java.lang.Object`.
      Returns:
        the methods that are directly declared, or an empty collection if there are none
      See Also:
        `DeclarationFilter`

    - #### getNestedTypes

          Collection<TypeDeclaration> getNestedTypes()

      Deprecated.
      Returns the declarations of the nested classes and interfaces that are directly declared by this class or interface.
      Returns:
        the declarations of the nested classes and interfaces, or an empty collection if there are none
      See Also:
        `DeclarationFilter`

Copyright © 2004, 2015, Oracle and/or its affiliates. All rights reserved.