D
-泛型声明,宣布基本类型变量的类型。
public interface TypeVariable<D extends GenericDeclaration> extends Type, AnnotatedElement
多个对象可以在运行时实例化,代表一个给定类型的变量。即使一个类型变量只创建一次,但这并不意味着对表示类型变量的缓存实例的任何要求。然而,所有的实例代表一个类型的变量必须equal()彼此。因此,类型变量的用户不能依赖于实现此接口的类的实例的身份。
Modifier and Type | Method and Description |
---|---|
AnnotatedType[] |
getAnnotatedBounds()
返回annotatedtype对象表示表示该型变量表示的类型参数的上界类型使用一个数组。
|
Type[] |
getBounds()
返回表示上限
Type 对象数组(S)这种类型的变量。
|
D |
getGenericDeclaration()
返回表示泛型声明
GenericDeclaration 这类型变量声明的对象。
|
String |
getName()
返回此类型变量的名称,因为它发生在源代码中。
|
getTypeName
getAnnotation, getAnnotations, getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotations, getDeclaredAnnotationsByType, isAnnotationPresent
Type[] getBounds()
Type
对象数组(S)这种类型的变量。请注意,如果没有上限,明确宣布,上限是
Object
。
为每个上限B:
ParameterizedType
)。Type
s代表上界的数组(S)这种类型的变量
TypeNotPresentException
-如果有任何的界限是指一个不存在的类型声明
MalformedParameterizedTypeException
-如果有任何的界限是一个参数化的类型不能被实例化的任何理由
D getGenericDeclaration()
GenericDeclaration
这类型变量声明的对象。
String getName()
AnnotatedType[] getAnnotatedBounds()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.