Package com.fasterxml.classmate.types
Class TypePlaceHolder
- java.lang.Object
-
- com.fasterxml.classmate.ResolvedType
-
- com.fasterxml.classmate.types.TypePlaceHolder
-
- All Implemented Interfaces:
java.lang.reflect.Type
public class TypePlaceHolder extends ResolvedType
Placeholder used for resolving type assignments to figure out type parameters for subtypes.
-
-
Field Summary
Fields Modifier and Type Field Description protected ResolvedType
_actualType
Type assigned during wildcard resolution (which follows type structure resolution)protected int
_ordinal
-
Fields inherited from class com.fasterxml.classmate.ResolvedType
_erasedType, _typeBindings, NO_CONSTRUCTORS, NO_FIELDS, NO_METHODS, NO_TYPES
-
-
Constructor Summary
Constructors Constructor Description TypePlaceHolder(int ordinal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResolvedType
actualType()
void
actualType(ResolvedType t)
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()
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<ResolvedType>
getImplementedInterfaces()
Returns ordered list of interfaces (in declaration order) that this type implements.ResolvedType
getParentClass()
Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object typeObject
.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>
).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.-
Methods inherited from class com.fasterxml.classmate.ResolvedType
_appendClassDescription, _appendClassName, _appendClassSignature, _appendErasedClassSignature, _getConstructors, _getFields, _getMethods, canCreateSubtype, findSupertype, getBriefDescription, getConstructors, getErasedSignature, getErasedType, getFullDescription, getMemberFields, getMemberMethods, getSignature, getStaticFields, getStaticMethods, getTypeBindings, getTypeParameters, hashCode, isConcrete, isInstanceOf, toString, typeParametersFor
-
-
-
-
Field Detail
-
_ordinal
protected final int _ordinal
-
_actualType
protected ResolvedType _actualType
Type assigned during wildcard resolution (which follows type structure resolution)
-
-
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
-
actualType
public ResolvedType actualType()
-
actualType
public void actualType(ResolvedType t)
-
getParentClass
public ResolvedType getParentClass()
Description copied from class:ResolvedType
Returns 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:
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()
Description copied from class:ResolvedType
Returns ordered list of interfaces (in declaration order) that this type implements.- Specified by:
getImplementedInterfaces
in classResolvedType
- Returns:
- List of interfaces this type implements, if any; empty list if none
-
getArrayElementType
public ResolvedType getArrayElementType()
Description copied from class:ResolvedType
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.- 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
-
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
-
-