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
_referencedType
Actual 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.StringBuilder
appendBriefDescription(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendErasedSignature(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendFullDescription(java.lang.StringBuilder sb)
java.lang.StringBuilder
appendSignature(java.lang.StringBuilder sb)
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.boolean
equals(java.lang.Object o)
ResolvedType
getArrayElementType()
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()
ResolvedType
getParentClass()
To avoid infinite loops, will return null;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>
).java.util.List<RawField>
getStaticFields()
java.util.List<RawMethod>
getStaticMethods()
boolean
isAbstract()
boolean
isArray()
Method that indicates whether this type is an array type.boolean
isInterface()
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.void
setReference(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:ResolvedType
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.- Specified by:
canCreateSubtypes
in classResolvedType
-
setReference
public void setReference(ResolvedType ref)
-
getParentClass
public ResolvedType getParentClass()
To avoid infinite loops, will return null;- Specified by:
getParentClass
in classResolvedType
-
getSelfReferencedType
public ResolvedType getSelfReferencedType()
Description copied from class: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>
). For all other types returns null but for self-references "real" type. Separate accessor is provided to avoid accidental infinite loops.- Specified by:
getSelfReferencedType
in classResolvedType
-
getImplementedInterfaces
public java.util.List<ResolvedType> getImplementedInterfaces()
To avoid infinite loops, will return empty list- Specified by:
getImplementedInterfaces
in 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:
getArrayElementType
in classResolvedType
-
isInterface
public boolean isInterface()
- Specified by:
isInterface
in classResolvedType
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in classResolvedType
-
isArray
public boolean isArray()
Description copied from class:ResolvedType
Method that indicates whether this type is an array type.- Specified by:
isArray
in classResolvedType
-
isPrimitive
public boolean isPrimitive()
Description copied from class:ResolvedType
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.- Specified by:
isPrimitive
in classResolvedType
-
getMemberFields
public java.util.List<RawField> getMemberFields()
- Overrides:
getMemberFields
in classResolvedType
-
getStaticFields
public java.util.List<RawField> getStaticFields()
- Overrides:
getStaticFields
in classResolvedType
-
getStaticMethods
public java.util.List<RawMethod> getStaticMethods()
- Overrides:
getStaticMethods
in classResolvedType
-
getMemberMethods
public java.util.List<RawMethod> getMemberMethods()
- Overrides:
getMemberMethods
in classResolvedType
-
getConstructors
public java.util.List<RawConstructor> getConstructors()
- Overrides:
getConstructors
in classResolvedType
-
appendSignature
public java.lang.StringBuilder appendSignature(java.lang.StringBuilder sb)
- Specified by:
appendSignature
in classResolvedType
-
appendErasedSignature
public java.lang.StringBuilder appendErasedSignature(java.lang.StringBuilder sb)
- Specified by:
appendErasedSignature
in classResolvedType
-
appendBriefDescription
public java.lang.StringBuilder appendBriefDescription(java.lang.StringBuilder sb)
- Specified by:
appendBriefDescription
in classResolvedType
-
appendFullDescription
public java.lang.StringBuilder appendFullDescription(java.lang.StringBuilder sb)
- Specified by:
appendFullDescription
in classResolvedType
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classResolvedType
-
-