Package com.fasterxml.classmate.types
Class ResolvedObjectType
- java.lang.Object
-
- com.fasterxml.classmate.ResolvedType
-
- com.fasterxml.classmate.types.ResolvedObjectType
-
- All Implemented Interfaces:
java.lang.reflect.Type
public class ResolvedObjectType extends ResolvedType
Type implementation for classes that do not represent interfaces, primitive or array types.
-
-
Field Summary
Fields Modifier and Type Field Description protected RawConstructor[]_constructorsConstructors declared by the resolved Object class.protected RawField[]_memberFieldsprotected RawMethod[]_memberMethodsprotected int_modifiersModifiers of the underlying class.protected RawField[]_staticFieldsprotected RawMethod[]_staticMethodsprotected ResolvedType_superClassWhile fundamentally super class has to beResolvedObjectType(or null forObject), we may need to hold on to aResolvedRecursiveTypeoccasionally.protected ResolvedType[]_superInterfacesList of interfaces this type implements; may be empty but never null-
Fields inherited from class com.fasterxml.classmate.ResolvedType
_erasedType, _typeBindings, NO_CONSTRUCTORS, NO_FIELDS, NO_METHODS, NO_TYPES
-
-
Constructor Summary
Constructors Constructor Description ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, ResolvedType[] interfaces)ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, java.util.List<ResolvedType> interfaces)ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedObjectType superClass, ResolvedType[] interfaces)Deprecated.ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedObjectType superClass, java.util.List<ResolvedType> interfaces)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringBuilderappendBriefDescription(java.lang.StringBuilder sb)java.lang.StringBuilderappendErasedSignature(java.lang.StringBuilder sb)java.lang.StringBuilderappendFullDescription(java.lang.StringBuilder sb)java.lang.StringBuilderappendSignature(java.lang.StringBuilder sb)booleancanCreateSubtypes()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.static ResolvedObjectTypecreate(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, java.util.List<ResolvedType> interfaces)ResolvedTypegetArrayElementType()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.java.util.List<RawConstructor>getConstructors()java.util.List<ResolvedType>getImplementedInterfaces()Returns ordered list of interfaces (in declaration order) that this type implements.java.util.List<RawField>getMemberFields()java.util.List<RawMethod>getMemberMethods()ResolvedObjectTypegetParentClass()Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object typeObject.ResolvedTypegetSelfReferencedType()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>).java.util.List<RawField>getStaticFields()java.util.List<RawMethod>getStaticMethods()booleanisAbstract()booleanisArray()Method that indicates whether this type is an array type.booleanisInterface()booleanisPrimitive()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.-
Methods inherited from class com.fasterxml.classmate.ResolvedType
_appendClassDescription, _appendClassName, _appendClassSignature, _appendErasedClassSignature, _getConstructors, _getFields, _getMethods, canCreateSubtype, equals, findSupertype, getBriefDescription, getErasedSignature, getErasedType, getFullDescription, getSignature, getTypeBindings, getTypeParameters, hashCode, isConcrete, isInstanceOf, toString, typeParametersFor
-
-
-
-
Field Detail
-
_superClass
protected final ResolvedType _superClass
While fundamentally super class has to beResolvedObjectType(or null forObject), we may need to hold on to aResolvedRecursiveTypeoccasionally.
-
_superInterfaces
protected final ResolvedType[] _superInterfaces
List of interfaces this type implements; may be empty but never null
-
_modifiers
protected final int _modifiers
Modifiers of the underlying class.
-
_constructors
protected RawConstructor[] _constructors
Constructors declared by the resolved Object class.
-
_memberFields
protected RawField[] _memberFields
-
_staticFields
protected RawField[] _staticFields
-
_memberMethods
protected RawMethod[] _memberMethods
-
_staticMethods
protected RawMethod[] _staticMethods
-
-
Constructor Detail
-
ResolvedObjectType
public ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, java.util.List<ResolvedType> interfaces)
-
ResolvedObjectType
public ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, ResolvedType[] interfaces)
-
ResolvedObjectType
@Deprecated public ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedObjectType superClass, java.util.List<ResolvedType> interfaces)Deprecated.
-
ResolvedObjectType
@Deprecated public ResolvedObjectType(java.lang.Class<?> erased, TypeBindings bindings, ResolvedObjectType superClass, ResolvedType[] interfaces)Deprecated.
-
-
Method Detail
-
create
public static ResolvedObjectType create(java.lang.Class<?> erased, TypeBindings bindings, ResolvedType superClass, java.util.List<ResolvedType> interfaces)
-
canCreateSubtypes
public boolean canCreateSubtypes()
Description copied from class:ResolvedTypeMethod 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.- Specified by:
canCreateSubtypesin classResolvedType
-
getParentClass
public ResolvedObjectType getParentClass()
Description copied from class:ResolvedTypeReturns 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.- Specified by:
getParentClassin classResolvedType
-
getSelfReferencedType
public ResolvedType getSelfReferencedType()
Description copied from class:ResolvedTypeAccessor 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.- Specified by:
getSelfReferencedTypein classResolvedType
-
getImplementedInterfaces
public java.util.List<ResolvedType> getImplementedInterfaces()
Description copied from class:ResolvedTypeReturns ordered list of interfaces (in declaration order) that this type implements.- Specified by:
getImplementedInterfacesin classResolvedType- Returns:
- List of interfaces this type implements, if any; empty list if none
-
getArrayElementType
public final ResolvedType getArrayElementType()
Description copied from class:ResolvedTypeMethod 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.- Specified by:
getArrayElementTypein classResolvedType
-
isInterface
public final boolean isInterface()
- Specified by:
isInterfacein classResolvedType
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin classResolvedType
-
isArray
public final boolean isArray()
Description copied from class:ResolvedTypeMethod that indicates whether this type is an array type.- Specified by:
isArrayin classResolvedType
-
isPrimitive
public final boolean isPrimitive()
Description copied from class:ResolvedTypeMethod 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.- Specified by:
isPrimitivein classResolvedType
-
getMemberFields
public java.util.List<RawField> getMemberFields()
- Overrides:
getMemberFieldsin classResolvedType
-
getStaticFields
public java.util.List<RawField> getStaticFields()
- Overrides:
getStaticFieldsin classResolvedType
-
getMemberMethods
public java.util.List<RawMethod> getMemberMethods()
- Overrides:
getMemberMethodsin classResolvedType
-
getStaticMethods
public java.util.List<RawMethod> getStaticMethods()
- Overrides:
getStaticMethodsin classResolvedType
-
getConstructors
public java.util.List<RawConstructor> getConstructors()
- Overrides:
getConstructorsin classResolvedType
-
appendSignature
public java.lang.StringBuilder appendSignature(java.lang.StringBuilder sb)
- Specified by:
appendSignaturein classResolvedType
-
appendErasedSignature
public java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
- Specified by:
appendErasedSignaturein classResolvedType
-
appendBriefDescription
public java.lang.StringBuilder appendBriefDescription(java.lang.StringBuilder sb)
- Specified by:
appendBriefDescriptionin classResolvedType
-
appendFullDescription
public java.lang.StringBuilder appendFullDescription(java.lang.StringBuilder sb)
- Specified by:
appendFullDescriptionin classResolvedType
-
-