-
- All Known Subinterfaces:
AnnotatedType,AnnotationTypeDoc,ClassDoc,ParameterizedType,TypeVariable,WildcardType
@Deprecated(since="9", forRemoval=true) public interface Type
Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.Returns this type as aAnnotatedTypeif it represents an annotated type.AnnotationTypeDocasAnnotationTypeDoc()Deprecated, for removal: This API element is subject to removal in a future version.Return this type as anAnnotationTypeDocif it represents an annotation type.ClassDocasClassDoc()Deprecated, for removal: This API element is subject to removal in a future version.Return this type as aClassDocif it represents a class or interface.ParameterizedTypeasParameterizedType()Deprecated, for removal: This API element is subject to removal in a future version.Return this type as aParameterizedTypeif it represents an invocation of a generic class or interface.TypeVariableasTypeVariable()Deprecated, for removal: This API element is subject to removal in a future version.Return this type as aTypeVariableif it represents a type variable.WildcardTypeasWildcardType()Deprecated, for removal: This API element is subject to removal in a future version.Return this type as aWildcardTypeif it represents a wildcard type.Stringdimension()Deprecated, for removal: This API element is subject to removal in a future version.Return the type's dimension information, as a string.TypegetElementType()Deprecated, for removal: This API element is subject to removal in a future version.If this type is an array type, return the element type of the array.booleanisPrimitive()Deprecated, for removal: This API element is subject to removal in a future version.Return true if this type represents a primitive type.StringqualifiedTypeName()Deprecated, for removal: This API element is subject to removal in a future version.Return qualified name of type excluding any dimension information.StringsimpleTypeName()Deprecated, for removal: This API element is subject to removal in a future version.Return the simple name of this type excluding any dimension information.StringtoString()Deprecated, for removal: This API element is subject to removal in a future version.Return a string representation of the type.StringtypeName()Deprecated, for removal: This API element is subject to removal in a future version.Return unqualified name of type excluding any dimension information.
-
-
-
Method Detail
-
typeName
String typeName()
Deprecated, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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, for removal: This API element is subject to removal in a future version.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
-
-