接口 TypeReference
- 所有超级接口:
Comparable<TypeReference>
- 所有已知实现类:
AbstractTypeReference,GeneratedTypeReference,ReflectionTypeReference,SimpleTypeReference
Type abstraction that can be used to refer to types that are not available as
a
Class yet.- 从以下版本开始:
- 4.0
- 作者:
- Stephane Nicoll, Sebastien Deleuze, Harry Yang
-
方法概要
修饰符和类型方法说明Return the canonical name of this type reference.Return the enclosing type reference, ornullif this type reference does not have an enclosing type.getName()Return the fully qualified name of this type reference.Return the package name of this type.Return the simple name of this type reference.static List<TypeReference>Create a list oftype referencesmapped by the specified types.static TypeReferenceCreate an instance based on the specified type.static TypeReferenceCreate an instance based on the specified class name.从接口继承的方法 java.lang.Comparable
compareTo
-
方法详细资料
-
getName
String getName()Return the fully qualified name of this type reference.- 返回:
- the reflection target name
-
getCanonicalName
String getCanonicalName()Return the canonical name of this type reference.- 返回:
- the canonical name
-
getPackageName
String getPackageName()Return the package name of this type.- 返回:
- the package name
-
getSimpleName
String getSimpleName()Return the simple name of this type reference.- 返回:
- the simple name
-
getEnclosingType
Return the enclosing type reference, ornullif this type reference does not have an enclosing type.- 返回:
- the enclosing type, if any
-
of
Create an instance based on the specified type.- 参数:
type- the type to wrap- 返回:
- a type reference for the specified type
- 抛出:
IllegalArgumentException- if the specified type canonical name isnull
-
of
Create an instance based on the specified class name. The format of the class name must follow Class.getName(), in particular inner classes should be separated by a$.- 参数:
className- the class name of the type to wrap- 返回:
- a type reference for the specified class name
-
listOf
Create a list oftype referencesmapped by the specified types.- 参数:
types- the types to map- 返回:
- a list of type references
-