java.lang.Object
org.glassfish.pfl.dynamic.codegen.spi.Type

@Immutable public class Type extends Object
Representation of Types (no generic support) used for codegen API.
  • Field Details

    • name

      private String name
    • packageName

      private String packageName
    • className

      private String className
    • signature

      private String signature
    • size

      private int size
    • sort

      private Type.Sort sort
    • isNumber

      private boolean isNumber
    • wideningNumber

      private int wideningNumber
    • memberType

      private Type memberType
    • classInfo

      private ClassInfo classInfo
    • typeClass

      private Class<?> typeClass
    • classMap

      private static ThreadLocal<Map<Class,Type>> classMap
    • classNameMap

      private static ThreadLocal<Map<String,Type>> classNameMap
    • ptcToType

      private static Map<Class,Type> ptcToType
    • myVoid

      private static final Type myVoid
    • myNull

      private static final Type myNull
    • myBoolean

      private static final Type myBoolean
    • myByte

      private static final Type myByte
    • myChar

      private static final Type myChar
    • myShort

      private static final Type myShort
    • myInt

      private static final Type myInt
    • myLong

      private static final Type myLong
    • myFloat

      private static final Type myFloat
    • myDouble

      private static final Type myDouble
    • myObject

      private static final Type myObject
    • myString

      private static final Type myString
    • myClass

      private static final Type myClass
    • myCloneable

      private static final Type myCloneable
  • Constructor Details

    • Type

      private Type(String name, String signature, int size, boolean isNumber, Type.Sort sort, int wideningNumber, Type memberType)
    • Type

      private Type(String name, String signature, int size, boolean isNumber, Type.Sort sort, int wideningNumber)
  • Method Details

    • clearCaches

      public static final void clearCaches()
      This method is only intended for internal use. It is public because the implementation that needs this is in a different package.
    • _array

      public static Type _array(Type memberType)
    • _class

      public static Type _class(String name)
      Return a codegen Type representing a class with the given name. This is not bound to a specific Class object until/unless getTypeClass is called.
    • _classGenerator

      public static Type _classGenerator(ClassGenerator cg)
    • classIsStandard

      private static boolean classIsStandard(Class cls)
    • type

      public static Type type(Class cls)
      Return the codegen Type that corresponds to the Java (non-generic) Type represented by cls.
    • _void

      public static Type _void()
    • _null

      public static Type _null()
    • _boolean

      public static Type _boolean()
    • _byte

      public static Type _byte()
    • _char

      public static Type _char()
    • _short

      public static Type _short()
    • _int

      public static Type _int()
    • _long

      public static Type _long()
    • _float

      public static Type _float()
    • _double

      public static Type _double()
    • _Object

      public static Type _Object()
    • _String

      public static Type _String()
    • _Class

      public static Type _Class()
    • _Cloneable

      public static Type _Cloneable()
    • isPrimitive

      public boolean isPrimitive()
    • isArray

      public boolean isArray()
    • memberType

      public Type memberType()
    • size

      public int size()
      Number of 32 bit words occupied by this type if primitive, or 0 if non-primitive.
    • signature

      public String signature()
    • name

      public String name()
    • packageName

      public String packageName()
    • className

      public String className()
    • isNumber

      public boolean isNumber()
    • getTypeClass

      public Class<?> getTypeClass()
    • classInfo

      public ClassInfo classInfo()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hasPrimitiveNarrowingConversionFrom

      public boolean hasPrimitiveNarrowingConversionFrom(Type t)
      Return true iff there is a primitive narrowing conversion from Type t to this type.
    • hasPrimitiveWideningConversionFrom

      public boolean hasPrimitiveWideningConversionFrom(Type t)
      Return true iff there is a primitive widening conversion from Type t to this type.
    • returnTypeCollision

      private boolean returnTypeCollision(Set<MethodInfo> set1, Set<MethodInfo> set2)
    • noMethodConflicts

      private boolean noMethodConflicts(Type t1, Type t2)
    • isSubclass

      private boolean isSubclass(Type t)
    • isInterface

      private boolean isInterface()
    • modifiers

      private int modifiers()
    • hasReferenceNarrowingConversionFrom

      public boolean hasReferenceNarrowingConversionFrom(Type t)
      Return true iff there is a reference narrowing conversion from Type t to this type.
    • hasReferenceWideningConversionFrom

      public boolean hasReferenceWideningConversionFrom(Type t)
      Return true iff there is a reference widening conversion from Type t to this type.
    • isAssignmentConvertibleFrom

      public boolean isAssignmentConvertibleFrom(Type t)
      Return true iff there is an assignment conversion from Type t to this type.
    • isCastingConvertibleFrom

      public boolean isCastingConvertibleFrom(Type t)
      Return true iff there is a casting conversion from Type t to this type.
    • unaryPromotion

      public Type unaryPromotion()
      Return the type that is a unary promotion of this type.
    • binaryPromotion

      public Type binaryPromotion(Type t)
      Return the type that is the binary promotion of this type and Type t.
    • isMethodInvocationConvertibleFrom

      public boolean isMethodInvocationConvertibleFrom(Type t)
      Return true iff one of the following statements is true:
      1. this.equals( t ) .
      2. There is a widening primitive conversion from Type t to this Type (see JLS 5.1.2).
      3. There is a widening reference conversion from Type t to this Type (see JLS 5.1.4).
      This is similar to Class.isAssignmentCompatibleFrom, but also handles widening primitive conversions. Throws NullPointerException if t == null.