Package gw.internal.gosu.parser
Class TypeLord
- java.lang.Object
-
- gw.internal.gosu.parser.TypeLord
-
public class TypeLord extends Object
-
-
Constructor Summary
Constructors Constructor Description TypeLord()
-
Method Summary
-
-
-
Method Detail
-
getAllClassesInClassHierarchyAsIntrinsicTypes
public static Set<IType> getAllClassesInClassHierarchyAsIntrinsicTypes(IJavaClassInfo cls)
-
getAllClassesInClassHierarchyAsIntrinsicTypes
public static Set<IType> getAllClassesInClassHierarchyAsIntrinsicTypes(IType type)
-
enclosingTypeInstanceInScope
public static boolean enclosingTypeInstanceInScope(IType type, IGosuClassInternal inner)
-
getActualType
public static IType getActualType(Type type, TypeVarToTypeMap actualParamByVarName)
-
getActualType
public static IType getActualType(Type type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
-
getActualType
public static IType getActualType(Type type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, LinkedHashSet<Type> recursiveTypes)
-
getActualType
public static IType getActualType(IAsmType type, TypeVarToTypeMap actualParamByVarName)
-
getActualType
public static IType getActualType(IAsmType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, LinkedHashSet<IAsmType> recursiveTypes)
-
getActualType
public static IType getActualType(IType type, TypeVarToTypeMap actualParamByVarName)
-
getActualType
public static IType getActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
-
getActualType
public static IType getActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, Set<IType> visited)
-
isParameterizedWith
public static boolean isParameterizedWith(IType type, TypeVariableType typeVar)
-
parseType
public static IType parseType(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName)
-
parseType
public static IType parseType(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap)
-
parseTypeLiteral
public static ITypeLiteralExpression parseTypeLiteral(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws ParseResultsException
- Throws:
ParseResultsException
-
mapTypeByVarName
public static TypeVarToTypeMap mapTypeByVarName(IType ownersType, IType declaringType)
-
makeParameteredType
public static IType makeParameteredType(IType genType, TypeVarToTypeMap inferenceMap)
-
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)
-
replaceTypeVariableTypeParametersWithBoundingTypes
public static IType replaceTypeVariableTypeParametersWithBoundingTypes(IType type)
-
replaceTypeVariableTypeParametersWithBoundingTypes
public static IType replaceTypeVariableTypeParametersWithBoundingTypes(IType type, IType enclType)
-
replaceRawGenericTypesWithDefaultParameterizedTypes
public static IType replaceRawGenericTypesWithDefaultParameterizedTypes(IType type)
-
getDefaultParameterizedTypeWithTypeVars
public static IType getDefaultParameterizedTypeWithTypeVars(IType type)
-
getDefaultParameterizedTypeWithTypeVars
public static IType getDefaultParameterizedTypeWithTypeVars(IType type, TypeVarToTypeMap map)
-
getDefaultParameterizedTypeWithTypeVars
public static IType getDefaultParameterizedTypeWithTypeVars(IType type, TypeVarToTypeMap map, Set<IType> visited)
-
isRecursiveTypeFromBase
public static boolean isRecursiveTypeFromBase(IType rootType)
-
isRecursiveType
public static boolean isRecursiveType(IType declaringClass)
-
areGenericOrParameterizedTypesAssignable
public static boolean areGenericOrParameterizedTypesAssignable(IType to, IType from)
-
getNamespacesFromTypeNames
public static Set<String> getNamespacesFromTypeNames(Set<? extends CharSequence> typeNames, Set<String> namespaces)
-
getLeastUpperBoundForPrimitiveTypes
public static IType getLeastUpperBoundForPrimitiveTypes(IType t0, IType t1)
-
isRecursiveType
public static boolean isRecursiveType(IJavaType javaType)
-
isRecursiveType
public static boolean isRecursiveType(ITypeVariableType subject, IType... types)
-
getOuterMostEnclosingClass
public static IJavaClassInfo getOuterMostEnclosingClass(IJavaClassInfo 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)
-
getTypeVariables
public static List<ITypeVariableType> getTypeVariables(IType type)
-
getTypeVariables
public static boolean getTypeVariables(IType type, Predicate<ITypeVariableType> cb)
-
isExpandable
public static boolean isExpandable(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)
-
getBoxedTypeFromPrimitiveType
public static IType getBoxedTypeFromPrimitiveType(IType primitiveType)
-
boundTypes
public static IType boundTypes(IType type, List<IType> typesToBound, boolean bKeepTypeVars)
-
-