Package com.fasterxml.classmate.types
Class ResolvedRecursiveType
- java.lang.Object
-
- com.fasterxml.classmate.ResolvedType
-
- com.fasterxml.classmate.types.ResolvedRecursiveType
-
- All Implemented Interfaces:
java.lang.reflect.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(java.lang.Class<?> erased, TypeBindings bindings)
-
Method Summary
All 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.booleanequals(java.lang.Object o)ResolvedTypegetArrayElementType()To avoid infinite loops, will return null typejava.util.List<RawConstructor>getConstructors()java.util.List<ResolvedType>getImplementedInterfaces()To avoid infinite loops, will return empty listjava.util.List<RawField>getMemberFields()java.util.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>).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.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
-
-
-
-
Field Detail
-
_referencedType
protected ResolvedType _referencedType
Actual fully resolved type; assigned once resolution is complete
-
-
Constructor Detail
-
ResolvedRecursiveType
public ResolvedRecursiveType(java.lang.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 java.util.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 java.util.List<RawField> getMemberFields()
- Overrides:
getMemberFieldsin classResolvedType
-
getStaticFields
public java.util.List<RawField> getStaticFields()
- Overrides:
getStaticFieldsin classResolvedType
-
getStaticMethods
public java.util.List<RawMethod> getStaticMethods()
- Overrides:
getStaticMethodsin classResolvedType
-
getMemberMethods
public java.util.List<RawMethod> getMemberMethods()
- Overrides:
getMemberMethodsin 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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classResolvedType
-
-