-
- All Known Subinterfaces:
AnnotatedType,AnnotationTypeDoc,ClassDoc,ParameterizedType,TypeVariable,WildcardType
@Deprecated public interface Type
Deprecated.The declarations in this package have been superseded by those in the packagejdk.javadoc.doclet. For more information, see the Migration Guide in the documentation for that package.Represents a type. A type can be a class or interface, an invocation (likeList<String>) of a generic class or interface, a type variable, a wildcard type ("?"), or a primitive data type (likechar).- Since:
- 1.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description AnnotatedTypeasAnnotatedType()Deprecated.Returns this type as aAnnotatedTypeif it represents an annotated type.AnnotationTypeDocasAnnotationTypeDoc()Deprecated.Return this type as anAnnotationTypeDocif it represents an annotation type.ClassDocasClassDoc()Deprecated.Return this type as aClassDocif it represents a class or interface.ParameterizedTypeasParameterizedType()Deprecated.Return this type as aParameterizedTypeif it represents an invocation of a generic class or interface.TypeVariableasTypeVariable()Deprecated.Return this type as aTypeVariableif it represents a type variable.WildcardTypeasWildcardType()Deprecated.Return this type as aWildcardTypeif it represents a wildcard type.Stringdimension()Deprecated.Return the type's dimension information, as a string.TypegetElementType()Deprecated.If this type is an array type, return the element type of the array.booleanisPrimitive()Deprecated.Return true if this type represents a primitive type.StringqualifiedTypeName()Deprecated.Return qualified name of type excluding any dimension information.StringsimpleTypeName()Deprecated.Return the simple name of this type excluding any dimension information.StringtoString()Deprecated.Return a string representation of the type.StringtypeName()Deprecated.Return unqualified name of type excluding any dimension information.
-
-
-
Method Detail
-
typeName
String typeName()
Deprecated.Return unqualified name of type excluding any dimension information.For example, a two dimensional array of String returns "
String".- Returns:
- unqualified name of type excluding any dimension information.
-
qualifiedTypeName
String qualifiedTypeName()
Deprecated.Return qualified name of type excluding any dimension information.For example, a two dimensional array of String returns "
java.lang.String".- Returns:
- qualified name of this type excluding any dimension information.
-
simpleTypeName
String simpleTypeName()
Deprecated.Return the simple name of this type excluding any dimension information. This is the unqualified name of the type, except that for nested types only the identifier of the innermost type is included.For example, the class
Outer.Innerreturns "Inner".- Returns:
- the simple name of this type excluding any dimension information.
- Since:
- 1.5
-
dimension
String dimension()
Deprecated.Return the type's dimension information, as a string.For example, a two dimensional array of String returns "
[][]".- Returns:
- the type's dimension information as a string.
-
toString
String toString()
Deprecated.Return a string representation of the type. This includes any dimension information and type arguments.For example, a two dimensional array of String may return "
java.lang.String[][]", and the parameterized typeList<Integer>may return "java.util.List<java.lang.Integer>".
-
isPrimitive
boolean isPrimitive()
Deprecated.Return true if this type represents a primitive type.- Returns:
- true if this type represents a primitive type.
- Since:
- 1.5
-
asClassDoc
ClassDoc asClassDoc()
Deprecated.Return this type as aClassDocif it represents a class or interface. Array dimensions are ignored. If this type is aParameterizedType,TypeVariable, orWildcardType, return theClassDocof the type's erasure. If this is anAnnotationTypeDoc, return this as aClassDoc(but seeasAnnotationTypeDoc()). If this is a primitive type, return null.- Returns:
- the
ClassDocof this type, or null if it is a primitive type.
-
asParameterizedType
ParameterizedType asParameterizedType()
Deprecated.Return this type as aParameterizedTypeif it represents an invocation of a generic class or interface. Array dimensions are ignored.- Returns:
- a
ParameterizedTypeif the type is an invocation of a generic type, or null if it is not. - Since:
- 1.5
-
asTypeVariable
TypeVariable asTypeVariable()
Deprecated.Return this type as aTypeVariableif it represents a type variable. Array dimensions are ignored.- Returns:
- a
TypeVariableif the type is a type variable, or null if it is not. - Since:
- 1.5
-
asWildcardType
WildcardType asWildcardType()
Deprecated.Return this type as aWildcardTypeif it represents a wildcard type.- Returns:
- a
WildcardTypeif the type is a wildcard type, or null if it is not. - Since:
- 1.5
-
asAnnotatedType
AnnotatedType asAnnotatedType()
Deprecated.Returns this type as aAnnotatedTypeif it represents an annotated type.- Returns:
- a
AnnotatedTypeif the type if an annotated type, or null if it is not - Since:
- 1.8
-
asAnnotationTypeDoc
AnnotationTypeDoc asAnnotationTypeDoc()
Deprecated.Return this type as anAnnotationTypeDocif it represents an annotation type. Array dimensions are ignored.- Returns:
- an
AnnotationTypeDocif the type is an annotation type, or null if it is not. - Since:
- 1.5
-
getElementType
Type getElementType()
Deprecated.If this type is an array type, return the element type of the array. Otherwise, return null.- Returns:
- a
Typerepresenting the element type or null. - Since:
- 1.8
-
-