Class TypeLord


  • public class TypeLord
    extends Object
    • Constructor Detail

      • TypeLord

        public TypeLord()
    • Method Detail

      • getAllClassesInClassHierarchyAsIntrinsicTypes

        public static Set<IType> getAllClassesInClassHierarchyAsIntrinsicTypes​(IJavaClassInfo cls)
      • getAllClassesInClassHierarchyAsIntrinsicTypes

        public static Set<IType> getAllClassesInClassHierarchyAsIntrinsicTypes​(IType type)
      • encloses

        public static boolean encloses​(IType type,
                                       IType inner)
      • enclosingTypeInstanceInScope

        public static boolean enclosingTypeInstanceInScope​(IType type,
                                                           IGosuClassInternal inner)
      • getArrayVersionsOfEachType

        public static Set<IType> getArrayVersionsOfEachType​(Set componentTypes)
      • getActualType

        public static IType getActualType​(Type type,
                                          TypeVarToTypeMap actualParamByVarName,
                                          boolean bKeepTypeVars)
      • getActualType

        public static IType getActualType​(IType type,
                                          TypeVarToTypeMap actualParamByVarName,
                                          boolean bKeepTypeVars)
      • isParameterizedWith

        public static boolean isParameterizedWith​(IType type,
                                                  TypeVariableType typeVar)
      • getNameWithQualifiedTypeVariables

        public static String getNameWithQualifiedTypeVariables​(IType type,
                                                               boolean includeModules)
      • getNameWithBoundQualifiedTypeVariables

        public static String getNameWithBoundQualifiedTypeVariables​(IType type,
                                                                    boolean includeModules)
      • getNameOfParams

        public static String getNameOfParams​(IType[] paramTypes,
                                             boolean bRelative,
                                             boolean bWithEnclosingType)
      • getNameOfParams

        public static String getNameOfParams​(IType[] paramTypes,
                                             boolean bRelative,
                                             boolean bWithEnclosingType,
                                             boolean bIncludeModule)
      • isDelegatableInterface

        public static boolean isDelegatableInterface​(IType declaringType,
                                                     IType iface)
      • findParameterizedStructureType

        public static IType findParameterizedStructureType​(IType structureType,
                                                           IType from)
      • getFunctionalInterface

        public static IType getFunctionalInterface​(IFunctionType funcType)
      • findParameterizedType

        public static IType findParameterizedType​(IType sourceType,
                                                  IType rawGenericType)
        Finds a parameterized type in the ancestry of a given type. For instance, given the type for ArrayList<Person> as the sourceType and List as the rawGenericType, returns List<Person>.
        Parameters:
        sourceType - The type to search in.
        rawGenericType - The raw generic type of the parameterized type to search for e.g., List is the raw generic type of List<String>.
        Returns:
        A parameterization of rawGenericType corresponding with the type params of sourceType.
      • findParameterizedType

        public static IType findParameterizedType​(IType sourceType,
                                                  IType rawGenericType,
                                                  boolean bForAssignability)
      • findParameterizedType_Reverse

        public static IType findParameterizedType_Reverse​(IType sourceType,
                                                          IType targetType)
      • findParameterizedTypeInHierarchy

        public static IType findParameterizedTypeInHierarchy​(IType sourceType,
                                                             IType rawGenericType)
      • addAllClassesInClassHierarchy

        public static void addAllClassesInClassHierarchy​(Class entityClass,
                                                         Set<Class> set)
      • addAllClassesInClassHierarchy

        public static void addAllClassesInClassHierarchy​(IType type,
                                                         Set<IType> set)
      • addAllClassesInClassHierarchy

        public static void addAllClassesInClassHierarchy​(IType type,
                                                         Set<IType> set,
                                                         boolean bForce)
      • getPureGenericType

        public static <E extends IType> E getPureGenericType​(E type)
      • deriveParameterizedTypeFromContext

        public static IType deriveParameterizedTypeFromContext​(IType type,
                                                               IType contextType)
      • makeDefaultParameterizedType

        public static IType makeDefaultParameterizedType​(IType type)
      • replaceTypeVariableTypeParametersWithBoundingTypes

        public static IType replaceTypeVariableTypeParametersWithBoundingTypes​(IType type)
      • replaceTypeVariableTypeParametersWithBoundingTypes

        public static IType replaceTypeVariableTypeParametersWithBoundingTypes​(IType type,
                                                                               IType enclType)
      • replaceRawGenericTypesWithDefaultParameterizedTypes

        public static IType replaceRawGenericTypesWithDefaultParameterizedTypes​(IType type)
      • getDefaultParameterizedType

        public static IType getDefaultParameterizedType​(IType type)
      • getDefaultParameterizedTypeWithTypeVars

        public static IType getDefaultParameterizedTypeWithTypeVars​(IType type)
      • getDefaultParameterizedTypeWithTypeVars

        public static IType getDefaultParameterizedTypeWithTypeVars​(IType type,
                                                                    TypeVarToTypeMap map)
      • isRecursiveTypeFromBase

        public static boolean isRecursiveTypeFromBase​(IType rootType)
      • isRecursiveType

        public static boolean isRecursiveType​(IType declaringClass)
      • isSubtype

        public static boolean isSubtype​(IType subtype,
                                        IType supertype)
      • areGenericOrParameterizedTypesAssignable

        public static boolean areGenericOrParameterizedTypesAssignable​(IType to,
                                                                       IType from)
      • addNamespace

        public static void addNamespace​(Set<String> namespaces,
                                        String strType)
      • getRootType

        public static IType getRootType​(IType type)
      • findGreatestLowerBound

        public static IType findGreatestLowerBound​(IType t1,
                                                   IType t2)
      • findLeastUpperBound

        public static IType findLeastUpperBound​(List<? extends IType> types)
      • getLeastUpperBoundForPrimitiveTypes

        public static IType getLeastUpperBoundForPrimitiveTypes​(IType t0,
                                                                IType t1)
      • isRecursiveType

        public static boolean isRecursiveType​(IJavaType javaType)
      • getOuterMostEnclosingClass

        public static IType getOuterMostEnclosingClass​(IType innerClass)
      • isParameterizedType

        public static boolean isParameterizedType​(IType type)
      • isEvalProgram

        public static boolean isEvalProgram​(IType type)
      • addReferencedTypeVarsThatAreNotInMap

        public static void addReferencedTypeVarsThatAreNotInMap​(IType type,
                                                                TypeVarToTypeMap map)
      • hasTypeVariable

        public static boolean hasTypeVariable​(IType type)
      • isExpandable

        public static boolean isExpandable​(IType type)
      • getExpandableComponentType

        public static IType getExpandableComponentType​(IType type)
      • getExpandableComponentType

        public static IType getExpandableComponentType​(IType type,
                                                       boolean bCore)
      • inferTypeVariableTypesFromGenParamTypeAndConcreteType

        public static void inferTypeVariableTypesFromGenParamTypeAndConcreteType​(IType genParamType,
                                                                                 IType argType,
                                                                                 TypeVarToTypeMap inferenceMap)
      • inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse

        public static void inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse​(IType genParamType,
                                                                                         IType argType,
                                                                                         TypeVarToTypeMap inferenceMap)
      • inferTypeVariableTypesFromGenParamTypeAndConcreteType

        public static void inferTypeVariableTypesFromGenParamTypeAndConcreteType​(IType genParamType,
                                                                                 IType argType,
                                                                                 TypeVarToTypeMap inferenceMap,
                                                                                 HashSet<ITypeVariableType> inferredInCallStack,
                                                                                 boolean bReverse)
      • getConcreteType

        public static IType getConcreteType​(IType type)
      • getCoreType

        public static IType getCoreType​(IType type)
      • getBoxedTypeFromPrimitiveType

        public static IType getBoxedTypeFromPrimitiveType​(IType primitiveType)
      • boundTypes

        public static IType boundTypes​(IType type,
                                       List<IType> typesToBound,
                                       boolean bKeepTypeVars)
      • getTopLevelType

        public static IType getTopLevelType​(IType type)