类 ParameterizedTypeImpl
java.lang.Object
com.citrsw.common.ParameterizedTypeImpl
- 所有已实现的接口:
ParameterizedType,Type
拷贝的JDK中的类
- 版本:
- 1.0
- 作者:
- 李振峰
-
方法概要
修饰符和类型方法说明booleanType[]Returns an array ofTypeobjects representing the actual type arguments to this type.Returns aTypeobject representing the type that this type is a member of.Class<?>Returns theTypeobject representing the class or interface that declared this type.inthashCode()static ParameterizedTypeImplStatic factory.toString()从接口继承的方法 java.lang.reflect.Type
getTypeName
-
方法详细资料
-
make
public static ParameterizedTypeImpl make(Class<?> rawType, Type[] actualTypeArguments, Type ownerType) Static factory. Given a (generic) class, actual type arguments and an owner type, creates a parameterized type. This class can be instantiated with a raw type that does not represent a generic type, provided the list of actual type arguments is empty. If the ownerType argument is null, the declaring class of the raw type is used as the owner type.This method throws a MalformedParameterizedTypeException under the following circumstances: If the number of actual type arguments (i.e., the size of the array
typeArgs) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.- 参数:
rawType- the Class representing the generic type declaration being instantiatedactualTypeArguments- a (possibly empty) array of types representing the actual type arguments to the parameterized typeownerType- the enclosing type, if known.- 返回:
- An instance of
ParameterizedType - 抛出:
MalformedParameterizedTypeException- if the instantiation is invalid
-
getActualTypeArguments
Returns an array ofTypeobjects representing the actual type arguments to this type.Note that in some cases, the returned array be empty. This can occur if this type represents a non-parameterized type nested within a parameterized type.
- 指定者:
getActualTypeArguments在接口中ParameterizedType- 返回:
- an array of
Typeobjects representing the actual type arguments to this type - 抛出:
TypeNotPresentException- if any of the actual type arguments refers to a non-existent type declarationMalformedParameterizedTypeException- if any of the actual type parameters refer to a parameterized type that cannot be instantiated for any reason- 从以下版本开始:
- 1.5
-
getRawType
Returns theTypeobject representing the class or interface that declared this type.- 指定者:
getRawType在接口中ParameterizedType- 返回:
- the
Typeobject representing the class or interface that declared this type
-
getOwnerType
Returns aTypeobject representing the type that this type is a member of. For example, if this type isO<T>.I<S>, return a representation ofO<T>.If this type is a top-level type,
nullis returned.- 指定者:
getOwnerType在接口中ParameterizedType- 返回:
- a
Typeobject representing the type that this type is a member of. If this type is a top-level type,nullis returned - 抛出:
TypeNotPresentException- if the owner type refers to a non-existent type declarationMalformedParameterizedTypeException- if the owner type refers to a parameterized type that cannot be instantiated for any reason
-
equals
-
hashCode
public int hashCode() -
toString
-