While a TypeDeclaration represents the declaration of a class or interface, a {@link DeclaredType} represents a classor 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 {@code java.util.Set} corresponds to the parameterized types{@code java.util.Set {@link com.sun.mirror.util.DeclarationFilter}provides a simple way to select just the items of interest when a method returns a collection of declarations.
@author Joseph D. Darcy
@author Scott Seligman
@version 1.5 05/11/17
@see DeclaredType
@since 1.5
TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { Modifier } class Identifier [ extends Type] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { Modifier } interface Identifier [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }For JLS3, type parameters and reified modifiers (and annotations) were added, and the superclass type name and superinterface types names are generalized to type so that parameterized types can be referenced:
TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { ExtendedModifier } class Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type ] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { ExtendedModifier } interface Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }
When a Javadoc comment is present, the source range begins with the first character of the "/**" comment delimiter. When there is no Javadoc comment, the source range begins with the first character of the first modifier or annotation (if any), or the first character of the "class" or "interface" keyword (if no modifiers or annotations). The source range extends through the last character of the "}" token following the body declarations.
@since 2.0TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { Modifier } class Identifier [ extends Type] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { Modifier } interface Identifier [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }For JLS3, type parameters and reified modifiers (and annotations) were added, and the superclass type name and superinterface types names are generalized to type so that parameterized types can be referenced:
TypeDeclaration: ClassDeclaration InterfaceDeclaration ClassDeclaration: [ Javadoc ] { ExtendedModifier } class Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type ] [ implements Type { , Type } ] { { ClassBodyDeclaration | ; } } InterfaceDeclaration: [ Javadoc ] { ExtendedModifier } interface Identifier [ < TypeParameter { , TypeParameter } > ] [ extends Type { , Type } ] { { InterfaceBodyDeclaration | ; } }
When a Javadoc comment is present, the source range begins with the first character of the "/**" comment delimiter. When there is no Javadoc comment, the source range begins with the first character of the first modifier or annotation (if any), or the first character of the "class" or "interface" keyword (if no modifiers or annotations). The source range extends through the last character of the "}" token following the body declarations.
@since 2.0 @noinstantiate This class is not intended to be instantiated by clients.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|