Class ResolvedPrimitiveType

  • All Implemented Interfaces:
    java.lang.reflect.Type

    public final class ResolvedPrimitiveType
    extends ResolvedType
    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 Detail

      • _signature

        protected final java.lang.String _signature
        Primitive types have single-character Signature, easy and efficient to just store here
      • _description

        protected final java.lang.String _description
        Human-readable description should be simple as well
    • Constructor Detail

      • ResolvedPrimitiveType

        protected ResolvedPrimitiveType​(java.lang.Class<?> erased,
                                        char sig,
                                        java.lang.String desc)
    • Method Detail

      • 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 class ResolvedType
      • 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 type Object. Also, placeholders for cyclic (recursive) types return null for this method.
        Specified by:
        getParentClass in class ResolvedType
      • 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 class ResolvedType
      • isArray

        public boolean isArray()
        Description copied from class: ResolvedType
        Method that indicates whether this type is an array type.
        Specified by:
        isArray in class ResolvedType
      • 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 class ResolvedType
      • 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 class ResolvedType
        Returns:
        List of interfaces this type implements, if any; empty list if none
      • getSignature

        public java.lang.String 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 class ResolvedType
      • getErasedSignature

        public java.lang.String 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 class ResolvedType
      • getFullDescription

        public java.lang.String getFullDescription()
        Description copied from class: ResolvedType
        Human-readable full description of type, which includes specification of super types (in brief format)
        Overrides:
        getFullDescription in class ResolvedType
      • appendSignature

        public java.lang.StringBuilder appendSignature​(java.lang.StringBuilder sb)
        Specified by:
        appendSignature in class ResolvedType
      • appendErasedSignature

        public java.lang.StringBuilder appendErasedSignature​(java.lang.StringBuilder sb)
        Specified by:
        appendErasedSignature in class ResolvedType
      • appendFullDescription

        public java.lang.StringBuilder appendFullDescription​(java.lang.StringBuilder sb)
        Specified by:
        appendFullDescription in class ResolvedType
      • appendBriefDescription

        public java.lang.StringBuilder appendBriefDescription​(java.lang.StringBuilder sb)
        Specified by:
        appendBriefDescription in class ResolvedType