Package com.fasterxml.classmate.types
Class ResolvedPrimitiveType
java.lang.Object
com.fasterxml.classmate.ResolvedType
com.fasterxml.classmate.types.ResolvedPrimitiveType
- All Implemented Interfaces:
Type
Type used for Java primitive types (which does not include arrays here).
Since set of primitive types is bounded, constructor is defined as protected, and class final; that is, new primitive types are not to be constructed by calling applications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final String
Human-readable description should be simple as wellprotected final String
Primitive types have single-character Signature, easy and efficient to just store hereprivate static final ResolvedPrimitiveType
Fields inherited from class com.fasterxml.classmate.ResolvedType
_erasedType, _typeBindings, NO_CONSTRUCTORS, NO_FIELDS, NO_METHODS, NO_TYPES
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ResolvedPrimitiveType
(Class<?> erased, char sig, String desc) -
Method Summary
Modifier and TypeMethodDescriptionstatic List
<ResolvedPrimitiveType> all()
boolean
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.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.Method that returns type erased signature of the type; suitable as non-generic signature some packages needHuman-readable full description of type, which includes specification of super types (in brief format)Returns ordered list of interfaces (in declaration order) that this type implements.Returns parent class of this type, if it has one; primitive types and interfaces have no parent class, nor does Object typeObject
.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>
).Method that returns full generic signature of the type; suitable as signature for things like ASM package.boolean
boolean
isArray()
Method that indicates whether this type is an array type.boolean
boolean
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.static ResolvedPrimitiveType
voidType()
Methods inherited from class com.fasterxml.classmate.ResolvedType
_appendClassDescription, _appendClassName, _appendClassSignature, _appendErasedClassSignature, _getConstructors, _getFields, _getMethods, canCreateSubtype, equals, findSupertype, getBriefDescription, getConstructors, getErasedType, getMemberFields, getMemberMethods, getStaticFields, getStaticMethods, 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 Details
-
VOID
-
_signature
Primitive types have single-character Signature, easy and efficient to just store here -
_description
Human-readable description should be simple as well
-
-
Constructor Details
-
ResolvedPrimitiveType
-
-
Method Details
-
all
-
voidType
-
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
-
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
-
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
-
isInterface
public boolean isInterface()- Specified by:
isInterface
in classResolvedType
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in classResolvedType
-
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
-
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
-
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
-
getSignature
Description copied from class:ResolvedType
Method that returns full generic signature of the type; suitable as signature for things like ASM package.- Overrides:
getSignature
in classResolvedType
-
getErasedSignature
Description copied from class:ResolvedType
Method that returns type erased signature of the type; suitable as non-generic signature some packages need- Overrides:
getErasedSignature
in classResolvedType
-
getFullDescription
Description copied from class:ResolvedType
Human-readable full description of type, which includes specification of super types (in brief format)- Overrides:
getFullDescription
in classResolvedType
-
appendSignature
- Specified by:
appendSignature
in classResolvedType
-
appendErasedSignature
- Specified by:
appendErasedSignature
in classResolvedType
-
appendFullDescription
- Specified by:
appendFullDescription
in classResolvedType
-
appendBriefDescription
- Specified by:
appendBriefDescription
in classResolvedType
-