Package com.fasterxml.classmate
Class ResolvedType
java.lang.Object
com.fasterxml.classmate.ResolvedType
- All Implemented Interfaces:
Type
- Direct Known Subclasses:
ResolvedArrayType
,ResolvedInterfaceType
,ResolvedObjectType
,ResolvedPrimitiveType
,ResolvedRecursiveType
,TypePlaceHolder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class
<?> protected final TypeBindings
Type bindings active when resolving members (methods, fields, constructors) of this typeprotected static final RawConstructor[]
protected static final RawField[]
protected static final RawMethod[]
static final ResolvedType[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuilder
protected StringBuilder
protected StringBuilder
protected StringBuilder
protected RawConstructor[]
protected RawField[]
_getFields
(boolean statics) protected RawMethod[]
_getMethods
(boolean statics) abstract StringBuilder
abstract StringBuilder
abstract StringBuilder
abstract StringBuilder
final boolean
canCreateSubtype
(Class<?> subtype) Method that can be used to check if call toTypeResolver.resolveSubtype(ResolvedType, Class)
will succeed for specific type; if false, it will fail with an exception; if tru it will succeed.abstract boolean
Method that can be used to check if call toTypeResolver.resolveSubtype(ResolvedType, Class)
may ever succeed; if false, it will fail with an exception, if true, it may succeed.boolean
findSupertype
(Class<?> erasedSupertype) Method for finding super type of this type that has specified type erased signature.abstract ResolvedType
Method that can be used to access element type of array types; will return null for non-array types, and non-null type for array types.Human-readable brief description of type, which does not include information about super types.Method that returns type erased signature of the type; suitable as non-generic signature some packages needClass
<?> Returns type-erased Class<?> that this resolved type has.Human-readable full description of type, which includes specification of super types (in brief format)abstract List
<ResolvedType> Returns ordered list of interfaces (in declaration order) that this type implements.abstract ResolvedType
Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object typeObject
.abstract ResolvedType
Accessor that must be used to find out actual type in case of "self-reference"; case where type refers recursive to itself (like,T implements Comparable<T>
).Method that returns full generic signature of the type; suitable as signature for things like ASM package.Method for accessing bindings of type variables to resolved types in context of this type.Returns list of generic type declarations for this type, in order they are declared in class description.int
hashCode()
abstract boolean
abstract boolean
isArray()
Method that indicates whether this type is an array type.final boolean
final boolean
isInstanceOf
(Class<?> type) abstract boolean
abstract boolean
Method that indicates whether this type is one of small number of primitive Java types; not including array types of primitive types but just basic primitive types.toString()
typeParametersFor
(Class<?> erasedSupertype) Method that will try to find type parameterization this type has for specified super typeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.reflect.Type
getTypeName
-
Field Details
-
NO_TYPES
-
NO_CONSTRUCTORS
-
NO_FIELDS
-
NO_METHODS
-
_erasedType
-
_typeBindings
Type bindings active when resolving members (methods, fields, constructors) of this type
-
-
Constructor Details
-
ResolvedType
-
-
Method Details
-
canCreateSubtypes
public abstract boolean canCreateSubtypes()Method that can be used to check if call toTypeResolver.resolveSubtype(ResolvedType, Class)
may ever succeed; if false, it will fail with an exception, if true, it may succeed. -
canCreateSubtype
Method that can be used to check if call toTypeResolver.resolveSubtype(ResolvedType, Class)
will succeed for specific type; if false, it will fail with an exception; if tru it will succeed. -
getErasedType
Returns type-erased Class<?> that this resolved type has. -
getParentClass
Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object typeObject
. Also, placeholders for cyclic (recursive) types return null for this method. -
getSelfReferencedType
Accessor that must be used to find out actual type in case of "self-reference"; case where type refers recursive to itself (like,T implements Comparable<T>
). For all other types returns null but for self-references "real" type. Separate accessor is provided to avoid accidental infinite loops. -
getArrayElementType
Method that can be used to access element type of array types; will return null for non-array types, and non-null type for array types. -
getImplementedInterfaces
Returns ordered list of interfaces (in declaration order) that this type implements.- Returns:
- List of interfaces this type implements, if any; empty list if none
-
getTypeParameters
Returns list of generic type declarations for this type, in order they are declared in class description. -
getTypeBindings
Method for accessing bindings of type variables to resolved types in context of this type. It has same number of entries as return List ofgetTypeParameters()
, accessible using declared name to which they bind; for example,Map
has 2 type bindings; one for key type (name "K", from Map.java) and one for value type (name "V", from Map.java). -
typeParametersFor
Method that will try to find type parameterization this type has for specified super type- Returns:
- List of type parameters for specified supertype (which may be empty, if supertype is not a parametric type); null if specified type is not a super type of this type
-
findSupertype
Method for finding super type of this type that has specified type erased signature. If supertype is an interface which is implemented using multiple inheritance paths, preference is given to interfaces implemented "highest up the stack" (directly implemented interfaces over interfaces superclass implements). -
isInterface
public abstract boolean isInterface() -
isConcrete
public final boolean isConcrete() -
isAbstract
public abstract boolean isAbstract() -
isArray
public abstract boolean isArray()Method that indicates whether this type is an array type. -
isPrimitive
public abstract boolean isPrimitive()Method that indicates whether this type is one of small number of primitive Java types; not including array types of primitive types but just basic primitive types. -
isInstanceOf
-
getConstructors
-
getMemberFields
-
getMemberMethods
-
getStaticFields
-
getStaticMethods
-
getSignature
Method that returns full generic signature of the type; suitable as signature for things like ASM package. -
getErasedSignature
Method that returns type erased signature of the type; suitable as non-generic signature some packages need -
getFullDescription
Human-readable full description of type, which includes specification of super types (in brief format) -
getBriefDescription
Human-readable brief description of type, which does not include information about super types. -
appendBriefDescription
-
appendFullDescription
-
appendSignature
-
appendErasedSignature
-
toString
-
hashCode
public int hashCode() -
equals
-
_appendClassSignature
-
_appendErasedClassSignature
-
_appendClassDescription
-
_appendClassName
-
_getFields
- Parameters:
statics
- Whether to return static methods (true) or member methods (false)
-
_getMethods
- Parameters:
statics
- Whether to return static methods (true) or member methods (false)
-
_getConstructors
-