Package gw.internal.gosu.parser
Class TypeLord
java.lang.Object
gw.internal.gosu.parser.TypeLord
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAllClassesInClassHierarchy(IType type, Set<IType> set) static voidaddAllClassesInClassHierarchy(IType type, Set<IType> set, boolean bForce) static voidaddAllClassesInClassHierarchy(Class entityClass, Set<Class> set) static voidaddNamespace(Set<String> namespaces, String strType) static voidstatic booleanstatic ITypeboundTypes(IType type, List<IType> typesToBound) static ITypeboundTypes(IType type, List<IType> typesToBound, boolean bKeepTypeVars) static ITypederiveParameterizedTypeFromContext(IType type, IType contextType) static booleanstatic booleanenclosingTypeInstanceInScope(IType type, IGosuClassInternal inner) static ITypefindGreatestLowerBound(IType t1, IType t2) static ITypefindLeastUpperBound(List<? extends IType> types) static ITypefindParameterizedStructureType(IType structureType, IType from) static ITypefindParameterizedType(IType sourceType, IType rawGenericType) Finds a parameterized type in the ancestry of a given type.static ITypefindParameterizedType(IType sourceType, IType rawGenericType, boolean bForAssignability) static ITypefindParameterizedType_Reverse(IType sourceType, IType targetType) static ITypefindParameterizedTypeInHierarchy(IType sourceType, IType rawGenericType) static ITypegetActualType(IType type, TypeVarToTypeMap actualParamByVarName) static ITypegetActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) static ITypegetActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, Set<IType> visited) static ITypegetActualType(IAsmType type, TypeVarToTypeMap actualParamByVarName) static ITypegetActualType(IAsmType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, LinkedHashSet<IAsmType> recursiveTypes) static ITypegetActualType(Type type, TypeVarToTypeMap actualParamByVarName) static ITypegetActualType(Type type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) static ITypegetActualType(Type type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, LinkedHashSet<Type> recursiveTypes) getArrayVersionsOfEachType(Set componentTypes) static ITypegetBoxedTypeFromPrimitiveType(IType primitiveType) static ITypegetConcreteType(IType type) static ITypegetCoreType(IType type) static ITypestatic ITypestatic ITypestatic ITypegetDefaultParameterizedTypeWithTypeVars(IType type, TypeVarToTypeMap map, Set<IType> visited) static ITypestatic ITypegetExpandableComponentType(IType type, boolean bCore) static ITypegetFunctionalInterface(IFunctionType funcType) static ITypestatic StringgetNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType) static StringgetNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType, boolean bIncludeModule) getNamespacesFromTypeNames(Set<? extends CharSequence> typeNames, Set<String> namespaces) static StringgetNameWithBoundQualifiedTypeVariables(IType type, boolean includeModules) static StringgetNameWithQualifiedTypeVariables(IType type, boolean includeModules) static ITypegetOuterMostEnclosingClass(IType innerClass) static IJavaClassInfogetOuterMostEnclosingClass(IJavaClassInfo innerClass) static <E extends IType>
EgetPureGenericType(E type) static ITypegetRootType(IType type) static ITypegetTopLevelType(IType type) static List<ITypeVariableType> getTypeVariables(IType type) static booleangetTypeVariables(IType type, Predicate<ITypeVariableType> cb) static booleanhasTypeVariable(IType type) static voidinferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap inferenceMap) static voidinferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap inferenceMap, HashSet<ITypeVariableType> inferredInCallStack, boolean bReverse) static voidinferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse(IType genParamType, IType argType, TypeVarToTypeMap inferenceMap) static booleanisDelegatableInterface(IType declaringType, IType iface) static booleanisEvalProgram(IType type) static booleanisExpandable(IType type) static booleanisParameterizedType(IType type) static booleanisParameterizedWith(IType type, TypeVariableType typeVar) static booleanisRecursiveType(IType declaringClass) static booleanisRecursiveType(ITypeVariableType subject, IType... types) static booleanisRecursiveType(IJavaType javaType) static booleanisRecursiveTypeFromBase(IType rootType) static booleanstatic ITypestatic ITypemakeParameteredType(IType genType, TypeVarToTypeMap inferenceMap) static TypeVarToTypeMapmapTypeByVarName(IType ownersType, IType declaringType) static ITypeparseType(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName) static ITypeparseType(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) static ITypeLiteralExpressionparseTypeLiteral(String strParameterizedTypeName, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) static ITypestatic ITypestatic ITypereplaceTypeVariableTypeParametersWithBoundingTypes(IType type, IType enclType)
-
Constructor Details
-
TypeLord
public TypeLord()
-
-
Method Details
-
getAllClassesInClassHierarchyAsIntrinsicTypes
-
getAllClassesInClassHierarchyAsIntrinsicTypes
-
encloses
-
enclosingTypeInstanceInScope
-
getArrayVersionsOfEachType
-
getActualType
-
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
-
getActualType
public static IType getActualType(IAsmType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars, LinkedHashSet<IAsmType> recursiveTypes) -
getActualType
-
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
-
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
-
makeParameteredType
-
getNameWithQualifiedTypeVariables
-
getNameWithBoundQualifiedTypeVariables
-
getNameOfParams
-
getNameOfParams
-
isDelegatableInterface
-
findParameterizedStructureType
-
getFunctionalInterface
-
findParameterizedType
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
-
findParameterizedType_Reverse
-
findParameterizedTypeInHierarchy
-
addAllClassesInClassHierarchy
-
addAllClassesInClassHierarchy
-
addAllClassesInClassHierarchy
-
getPureGenericType
-
deriveParameterizedTypeFromContext
-
makeDefaultParameterizedType
-
replaceTypeVariableTypeParametersWithBoundingTypes
-
replaceTypeVariableTypeParametersWithBoundingTypes
-
replaceRawGenericTypesWithDefaultParameterizedTypes
-
getDefaultParameterizedType
-
getDefaultParameterizedTypeWithTypeVars
-
getDefaultParameterizedTypeWithTypeVars
-
getDefaultParameterizedTypeWithTypeVars
public static IType getDefaultParameterizedTypeWithTypeVars(IType type, TypeVarToTypeMap map, Set<IType> visited) -
isRecursiveTypeFromBase
-
isRecursiveType
-
isSubtype
-
areGenericOrParameterizedTypesAssignable
-
getNamespacesFromTypeNames
-
addNamespace
-
getRootType
-
findGreatestLowerBound
-
findLeastUpperBound
-
getLeastUpperBoundForPrimitiveTypes
-
isRecursiveType
-
isRecursiveType
-
getOuterMostEnclosingClass
-
getOuterMostEnclosingClass
-
isParameterizedType
-
isEvalProgram
-
addReferencedTypeVarsThatAreNotInMap
-
hasTypeVariable
-
getTypeVariables
-
getTypeVariables
-
isExpandable
-
getExpandableComponentType
-
getExpandableComponentType
-
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
-
getCoreType
-
getBoxedTypeFromPrimitiveType
-
boundTypes
-
boundTypes
-
getTopLevelType
-