Package com.fasterxml.classmate.types
Class ResolvedRecursiveType
- java.lang.Object
-
- com.fasterxml.classmate.ResolvedType
-
- com.fasterxml.classmate.types.ResolvedRecursiveType
-
- All Implemented Interfaces:
Type
public class ResolvedRecursiveType extends ResolvedType
Specialized type placeholder used in cases where type definition is recursive; to avoid infinite loop, reference that would be "back" in hierarchy is represented by an instance of this class. Underlying information is achievable (for full resolution), but not exposed using super type (parent) accessors; and has special handling when used for constructing descriptions.
-
-
Field Summary
Fields Modifier and Type Field Description protected ResolvedType_referencedTypeActual fully resolved type; assigned once resolution is complete-
Fields inherited from class com.fasterxml.classmate.ResolvedType
_erasedType, _typeBindings, NO_CONSTRUCTORS, NO_FIELDS, NO_METHODS, NO_TYPES
-
-
Constructor Summary
Constructors Constructor Description ResolvedRecursiveType(Class<?> erased, TypeBindings bindings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringBuilderappendBriefDescription(StringBuilder sb)StringBuilderappendErasedSignature(StringBuilder sb)StringBuilderappendFullDescription(StringBuilder sb)StringBuilderappendSignature(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.booleanequals(Object o)ResolvedTypegetArrayElementType()To avoid infinite loops, will return null typeList<RawConstructor>getConstructors()List<ResolvedType>getImplementedInterfaces()To avoid infinite loops, will return empty listList<RawField>getMemberFields()List<RawMethod>getMemberMethods()ResolvedTypegetParentClass()To avoid infinite loops, will return null;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>).List<RawField>getStaticFields()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.voidsetReference(ResolvedType ref)-
Methods inherited from class com.fasterxml.classmate.ResolvedType
_appendClassDescription, _appendClassName, _appendClassSignature, _appendErasedClassSignature, _getConstructors, _getFields, _getMethods, canCreateSubtype, findSupertype, getBriefDescription, getErasedSignature, getErasedType, getFullDescription, getSignature, getTypeBindings, getTypeParameters, hashCode, isConcrete, isInstanceOf, toString, typeParametersFor
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.reflect.Type
getTypeName
-
-
-
-
Field Detail
-
_referencedType
protected ResolvedType _referencedType
Actual fully resolved type; assigned once resolution is complete
-
-
Constructor Detail
-
ResolvedRecursiveType
public ResolvedRecursiveType(Class<?> erased, TypeBindings bindings)
-
-
Method Detail
-
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
-
setReference
public void setReference(ResolvedType ref)
-
getParentClass
public ResolvedType getParentClass()
To avoid infinite loops, will return null;- 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 List<ResolvedType> getImplementedInterfaces()
To avoid infinite loops, will return empty list- Specified by:
getImplementedInterfacesin classResolvedType- Returns:
- List of interfaces this type implements, if any; empty list if none
-
getArrayElementType
public ResolvedType getArrayElementType()
To avoid infinite loops, will return null type- Specified by:
getArrayElementTypein classResolvedType
-
isInterface
public boolean isInterface()
- Specified by:
isInterfacein classResolvedType
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstractin classResolvedType
-
isArray
public boolean isArray()
Description copied from class:ResolvedTypeMethod that indicates whether this type is an array type.- Specified by:
isArrayin classResolvedType
-
isPrimitive
public 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 List<RawField> getMemberFields()
- Overrides:
getMemberFieldsin classResolvedType
-
getStaticFields
public List<RawField> getStaticFields()
- Overrides:
getStaticFieldsin classResolvedType
-
getStaticMethods
public List<RawMethod> getStaticMethods()
- Overrides:
getStaticMethodsin classResolvedType
-
getMemberMethods
public List<RawMethod> getMemberMethods()
- Overrides:
getMemberMethodsin classResolvedType
-
getConstructors
public List<RawConstructor> getConstructors()
- Overrides:
getConstructorsin classResolvedType
-
appendSignature
public StringBuilder appendSignature(StringBuilder sb)
- Specified by:
appendSignaturein classResolvedType
-
appendErasedSignature
public StringBuilder appendErasedSignature(StringBuilder sb)
- Specified by:
appendErasedSignaturein classResolvedType
-
appendBriefDescription
public StringBuilder appendBriefDescription(StringBuilder sb)
- Specified by:
appendBriefDescriptionin classResolvedType
-
appendFullDescription
public StringBuilder appendFullDescription(StringBuilder sb)
- Specified by:
appendFullDescriptionin classResolvedType
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classResolvedType
-
-