public interface ParameterizedType extends Type
参数化类型是第一次创建的,它是由一个反射的方法所需要的,在这个包中指定的。当一个参数化的类型P创建,P是解决实例化泛型类型声明,以及所有类型的参数创建递归。看到在类型变量的创建过程中的细节TypeVariable
。重复创建一个参数化的类型没有影响。
实现该接口的类的实例必须实现一个equals()方法等同于任何两个实例共享相同的泛型类型声明和具有相同的类型参数。
字符串>Modifier and Type | Method and Description |
---|---|
Type[] |
getActualTypeArguments()
返回的对象的实际类型参数
Type 代表这种类型的数组。
|
Type |
getOwnerType()
返回一个表示该类型的成员
Type 对象类型。
|
Type |
getRawType()
返回表示的类或接口声明此类型的
Type 对象。
|
getTypeName
Type[] getActualTypeArguments()
Type
对象数组。
请注意,在某些情况下,返回的数组是空的。如果这种类型表示在参数化类型中嵌套的非参数化类型,可能会发生这种类型的。
Type
对象数组
TypeNotPresentException
-如果有任何的实际类型参数指向一个不存在的类型声明
MalformedParameterizedTypeException
-如果有任何的实际类型参数是参数化类型,不能实例化的任何理由
Type getRawType()
Type
对象。
Type
对象
Type getOwnerType()
Type
对象类型。例如,如果这是
O<T>.I<S>
,返回
O<T>
表示。
如果这种类型的顶级类型,null
返回。
Type
对象。如果这种类型的顶级类型,
null
返回
TypeNotPresentException
-如果业主型指的是一个不存在的类型声明
MalformedParameterizedTypeException
如果所有者类型是参数化类型,不能实例化的任何理由
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.