Top Fields Constructors Methods
com.fasterxml.classmate

public abstract Class ResolvedType

extends Object
implements Type
Class Inheritance
All Implemented Interfaces
java.lang.reflect.Type
Known Direct Subclasses
com.fasterxml.classmate.types.ResolvedArrayType, com.fasterxml.classmate.types.ResolvedInterfaceType, com.fasterxml.classmate.types.ResolvedObjectType, com.fasterxml.classmate.types.ResolvedPrimitiveType, com.fasterxml.classmate.types.ResolvedRecursiveType, com.fasterxml.classmate.types.TypePlaceHolder
Imports
java.lang.reflect.Constructor, .Field, .Method, .Modifier, .Type, java.util.*, com.fasterxml.classmate.members.*

Field Summary

Modifier and TypeField and Description
protected final Class<?>
protected final TypeBindings
_typeBindings

Type bindings active when resolving members (methods, fields, constructors) of this type

protected static final RawConstructor[]
protected static final RawField[]
protected static final RawMethod[]
public static final ResolvedType[]

Constructor Summary

AccessConstructor and Description
protected
ResolvedType(Class<?> cls, TypeBindings bindings)

Method Summary

Modifier and TypeMethod and Description
protected StringBuilder
protected StringBuilder
protected StringBuilder
protected StringBuilder
protected RawConstructor[]
protected RawField[]
_getFields(boolean
Whether to return static methods (true) or member methods (false)
statics
)

protected RawMethod[]
_getMethods(boolean
Whether to return static methods (true) or member methods (false)
statics
)

public abstract StringBuilder
public abstract StringBuilder
public abstract StringBuilder
public abstract StringBuilder
public final boolean
canCreateSubtype(Class<?> subtype)

Method that can be used to check if call to TypeResolver#resolveSubtype(ResolvedType, Class) will succeed for specific type; if false, it will fail with an exception; if tru it will succeed.

public abstract boolean
canCreateSubtypes()

Method that can be used to check if call to TypeResolver#resolveSubtype(ResolvedType, Class) may ever succeed; if false, it will fail with an exception, if true, it may succeed.

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public ResolvedType
findSupertype(Class<?> erasedSupertype)

Method for finding super type of this type that has specified type erased signature.

public abstract ResolvedType
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.

public String
getBriefDescription()

Human-readable brief description of type, which does not include information about super types.

public List<RawConstructor>
public String
getErasedSignature()

Method that returns type erased signature of the type; suitable as non-generic signature some packages need

public Class<?>
getErasedType()

Returns type-erased Class<?

public String
getFullDescription()

Human-readable full description of type, which includes specification of super types (in brief format)

public abstract List<ResolvedType>

Returns:

List of interfaces this type implements, if any; empty list if none (never null).
getImplementedInterfaces
()

Returns ordered list of interfaces (in declaration order) that this type directly implements.

public List<RawField>
public List<RawMethod>
public abstract ResolvedType
getParentClass()

Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object type java.lang.Object.

public abstract ResolvedType
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>).

public String
getSignature()

Method that returns full generic signature of the type; suitable as signature for things like ASM package.

public List<RawField>
public List<RawMethod>
public TypeBindings
getTypeBindings()

Method for accessing bindings of type variables to resolved types in context of this type.

public List<ResolvedType>
getTypeParameters()

Returns list of generic type declarations for this type, in order they are declared in class description.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public abstract boolean
public abstract boolean
isArray()

Method that indicates whether this type is an array type.

public final boolean
public final boolean
public abstract boolean
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.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public List<ResolvedType>

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
typeParametersFor
(Class<?> erasedSupertype)

Method that will try to find type parameterization this type has for specified super type

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

_erasedTypeback to summary
protected final Class<?> _erasedType
_typeBindingsback to summary
protected final TypeBindings _typeBindings

Type bindings active when resolving members (methods, fields, constructors) of this type

NO_CONSTRUCTORSback to summary
protected static final RawConstructor[] NO_CONSTRUCTORS
NO_FIELDSback to summary
protected static final RawField[] NO_FIELDS
NO_METHODSback to summary
protected static final RawMethod[] NO_METHODS
NO_TYPESback to summary
public static final ResolvedType[] NO_TYPES

Constructor Detail

ResolvedTypeback to summary
protected ResolvedType(Class<?> cls, TypeBindings bindings)

Method Detail

_appendClassDescriptionback to summary
protected StringBuilder _appendClassDescription(StringBuilder sb)
_appendClassNameback to summary
protected StringBuilder _appendClassName(StringBuilder sb)
_appendClassSignatureback to summary
protected StringBuilder _appendClassSignature(StringBuilder sb)
_appendErasedClassSignatureback to summary
protected StringBuilder _appendErasedClassSignature(StringBuilder sb)
_getConstructorsback to summary
protected RawConstructor[] _getConstructors()
_getFieldsback to summary
protected RawField[] _getFields(boolean statics)
Parameters
statics:boolean

Whether to return static methods (true) or member methods (false)

_getMethodsback to summary
protected RawMethod[] _getMethods(boolean statics)
Parameters
statics:boolean

Whether to return static methods (true) or member methods (false)

appendBriefDescriptionback to summary
public abstract StringBuilder appendBriefDescription(StringBuilder sb)
appendErasedSignatureback to summary
public abstract StringBuilder appendErasedSignature(StringBuilder sb)
appendFullDescriptionback to summary
public abstract StringBuilder appendFullDescription(StringBuilder sb)
appendSignatureback to summary
public abstract StringBuilder appendSignature(StringBuilder sb)
canCreateSubtypeback to summary
public final boolean canCreateSubtype(Class<?> subtype)

Method that can be used to check if call to TypeResolver#resolveSubtype(ResolvedType, Class) will succeed for specific type; if false, it will fail with an exception; if tru it will succeed.

canCreateSubtypesback to summary
public abstract boolean canCreateSubtypes()

Method that can be used to check if call to TypeResolver#resolveSubtype(ResolvedType, Class) may ever succeed; if false, it will fail with an exception, if true, it may succeed.

equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
findSupertypeback to summary
public ResolvedType findSupertype(Class<?> erasedSupertype)

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).

getArrayElementTypeback to summary
public abstract ResolvedType 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.

getBriefDescriptionback to summary
public String getBriefDescription()

Human-readable brief description of type, which does not include information about super types.

getConstructorsback to summary
public List<RawConstructor> getConstructors()
getErasedSignatureback to summary
public String getErasedSignature()

Method that returns type erased signature of the type; suitable as non-generic signature some packages need

getErasedTypeback to summary
public Class<?> getErasedType()

Returns type-erased Class<?> that this resolved type has.

getFullDescriptionback to summary
public String getFullDescription()

Human-readable full description of type, which includes specification of super types (in brief format)

getImplementedInterfacesback to summary
public abstract List<ResolvedType> getImplementedInterfaces()

Returns ordered list of interfaces (in declaration order) that this type directly implements.

Note

returned list does NOT include transitively implemented types (that is, interfaces implemented by parent classes or interfaces).

Returns:List<ResolvedType>

List of interfaces this type implements, if any; empty list if none (never null).

getMemberFieldsback to summary
public List<RawField> getMemberFields()
getMemberMethodsback to summary
public List<RawMethod> getMemberMethods()
getParentClassback to summary
public abstract ResolvedType getParentClass()

Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object type java.lang.Object. Also, placeholders for cyclic (recursive) types return null for this method.

getSelfReferencedTypeback to summary
public abstract ResolvedType 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.

getSignatureback to summary
public String getSignature()

Method that returns full generic signature of the type; suitable as signature for things like ASM package.

getStaticFieldsback to summary
public List<RawField> getStaticFields()
getStaticMethodsback to summary
public List<RawMethod> getStaticMethods()
getTypeBindingsback to summary
public TypeBindings 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 of getTypeParameters, accessible using declared name to which they bind; for example, java.util.Map has 2 type bindings; one for key type (name "K", from Map.java) and one for value type (name "V", from Map.java).

getTypeParametersback to summary
public List<ResolvedType> getTypeParameters()

Returns list of generic type declarations for this type, in order they are declared in class description.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isAbstractback to summary
public abstract boolean isAbstract()
isArrayback to summary
public abstract boolean isArray()

Method that indicates whether this type is an array type.

isConcreteback to summary
public final boolean isConcrete()
isInstanceOfback to summary
public final boolean isInstanceOf(Class<?> type)
isInterfaceback to summary
public abstract boolean isInterface()
isPrimitiveback to summary
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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
typeParametersForback to summary
public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype)

Method that will try to find type parameterization this type has for specified super type

Returns:List<ResolvedType>

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