Package gw.lang.reflect
Interface ITypeSystem
-
- All Superinterfaces:
IPluginHost,IService
- All Known Implementing Classes:
TypeLoaderAccess
public interface ITypeSystem extends IService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddShutdownListener(TypeSystemShutdownListener listener)voidaddTypeLoaderListenerAsWeakRef(ITypeLoaderListener listener)ITypeboundTypes(IType parameterType, java.util.List<IType> inferringTypes)booleancanCast(IType lhsType, IType rhsType)voidclearErrorTypes()voiddumpGosuClassLoader()ITypefindParameterizedType(IType type, IType rhsType)ITypeget(IJavaClassInfo javaClassInfo)Gets the intrinsic type for a given class info object.ITypeget(java.lang.Class<?> javaClass)Gets the intrinsic type for a given class.ITypegetActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)java.util.List<ITypeLoader>getAllTypeLoaders()java.util.Set<? extends java.lang.CharSequence>getAllTypeNames()Returns all type names in the system for all type loaders.ITypegetBoxType(IType primitiveType)ITypegetByFullName(java.lang.String fullyQualifiedName)Gets an intrinsic type based on a fully-qualified name.ITypegetByFullNameIfValid(java.lang.String fullyQualifiedName)Gets a type based on a fully-qualified name.ITypegetByFullNameIfValidNoJava(java.lang.String fullyQualifiedName)ITypegetByRelativeName(java.lang.String relativeName)ITypegetByRelativeName(java.lang.String relativeName, ITypeUsesMap typeUses)Gets an intrinsic type based on a relative name.ISymbolTablegetCompiledGosuClassSymbolTable()ITypegetCompilingType(java.lang.String strName)ITypegetComponentType(IType valueType)ITypegetCompoundType(java.util.Set<IType> types)ITypegetCurrentCompilingType()IModulegetCurrentModule()ITypegetDefaultParameterizedType(IType type)ITypegetDefaultParameterizedTypeWithTypeVars(IType type)IMetaTypegetDefaultType()IDefaultTypeLoadergetDefaultTypeLoader()IErrorTypegetErrorType()IErrorTypegetErrorType(ParseResultsException pe)IErrorTypegetErrorType(java.lang.String strErrantName)IExecutionEnvironmentgetExecutionEnvironment()IExecutionEnvironmentgetExecutionEnvironment(IProject project)ITypegetExpandableComponentType(IType type)ITypegetFromObject(java.lang.Object object)Returns the intrinsic type for the given Object.ITypegetFunctionalInterface(IFunctionType type)IGosuClassLoadergetGosuClassLoader()ITypegetJavaType(java.lang.Class javaClass)java.lang.StringgetNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType)INamespaceTypegetNamespace(java.lang.String strFqNamespace)java.util.Set<java.lang.String>getNamespacesFromTypeNames(java.util.Set<? extends java.lang.CharSequence> allTypeNames, java.util.Set<java.lang.String> namespaces)java.lang.StringgetNameWithQualifiedTypeVariables(IType type)IFunctionTypegetOrCreateFunctionType(IMethodInfo mi)IFunctionTypegetOrCreateFunctionType(java.lang.String strFunctionName, IType retType, IType[] paramTypes)ITypeRefgetOrCreateTypeReference(IType type)ITypeVariableTypegetOrCreateTypeVariableType(java.lang.String strName, IType boundingType, IType enclosingType)ITypegetPrimitiveType(IType boxType)IJavaTypegetPrimitiveType(java.lang.String name)intgetRefreshChecksum()intgetSingleRefreshChecksum()ISymbolTablegetSymTableCtx()ITypegetTypeFromObject(java.lang.Object obj)<T extends ITypeLoader>
TgetTypeLoader(java.lang.Class<? extends T> loaderClass, IModule module)ITypeRefgetTypeReference(IType type)java.lang.String[]getTypesForFile(IModule module, IFile file)voidinferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap map)voidinferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse(IType genParamType, IType argType, TypeVarToTypeMap map)booleanisExpandable(IType type)booleanisIncludeAll()booleanisParameterizedWith(IType type, ITypeVariableType... typeVar)IGosucmakeGosucCompiler(java.lang.String gosucProjectFile, ICustomParser custParser)TypeVarToTypeMapmapTypeByVarName(IType ownersType, IType declaringType)ITypeparseType(java.lang.String typeString)Converts a String name of a type into an IType.ITypeparseType(java.lang.String typeString, ITypeUsesMap typeUsesMap)ITypeparseType(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName)ITypeparseType(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap)ITypeLiteralExpressionparseTypeExpression(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap)voidpopCompilingType()voidpopIncludeAll()voidpopModule(IModule gosuModule)voidpopSymTableCtx()voidpushCompilingType(IType type)voidpushIncludeAll()voidpushModule(IModule gosuModule)voidpushSymTableCtx(ISymbolTable ctx)voidpushTypeLoader(ITypeLoader loader)voidpushTypeLoader(IModule module, ITypeLoader loader)voidrefresh(boolean bRefreshCaches)voidrefresh(ITypeRef typeRef)voidrefresh(IModule module)voidrefreshed(IResource file, java.lang.String typeName, RefreshKind refreshKind)voidremoveTypeLoader(java.lang.Class<? extends ITypeLoader> loader)voidremoveTypeLoaderListener(ITypeLoaderListener listener)ITypereplaceTypeVariableTypeParametersWithBoundingTypes(IType iType, IType type)voidshutdown()-
Methods inherited from interface gw.plugin.IPluginHost
getInterface
-
-
-
-
Method Detail
-
get
IType get(java.lang.Class<?> javaClass)
Gets the intrinsic type for a given class.
Note: you should use this method only if you do not have an Object of classjavaClassto get the type from. If you do have such an object, usegetFromObject(java.lang.Object)instead.- Parameters:
javaClass- the Class to convert to an intrinsic type- Returns:
- the IType that corresponds to that class
- See Also:
getFromObject(Object)
-
get
IType get(IJavaClassInfo javaClassInfo)
Gets the intrinsic type for a given class info object.- Parameters:
javaClassInfo- the Class info object to convert to an intrinsic type- Returns:
- the IType that corresponds to that class
-
getFromObject
IType getFromObject(java.lang.Object object)
Returns the intrinsic type for the given Object.- Parameters:
object- the object to get an IType for- Returns:
- the IType for the object
- See Also:
get(Class)
-
getByRelativeName
IType getByRelativeName(java.lang.String relativeName) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
getByRelativeName
IType getByRelativeName(java.lang.String relativeName, ITypeUsesMap typeUses) throws java.lang.ClassNotFoundException
Gets an intrinsic type based on a relative name. This could either be the name of an entity, like "User", the name of a typekey, like "SystemPermission", or a class name, like "java.lang.String" (relative and fully qualified class names are the same as far as this factory is concerned). Names can have [] appended to them to create arrays, and multi-dimensional arrays are supported.- Parameters:
relativeName- the relative name of the typetypeUses- the map of used types to use when resolving- Returns:
- the corresponding IType
- Throws:
java.lang.ClassNotFoundException- if the specified name doesn't correspond to any type
-
getByFullName
IType getByFullName(java.lang.String fullyQualifiedName)
Gets an intrinsic type based on a fully-qualified name. This could either be the name of an entity, like "entity.User", the name of a typekey, like "typekey.SystemPermission", or a class name, like "java.lang.String". Names can have [] appended to them to create arrays, and multi-dimensional arrays are supported.- Parameters:
fullyQualifiedName- the fully qualified name of the type- Returns:
- the corresponding IType
- Throws:
java.lang.RuntimeException- if the specified name doesn't correspond to any type
-
getByFullNameIfValid
IType getByFullNameIfValid(java.lang.String fullyQualifiedName)
Gets a type based on a fully-qualified name. This could either be the name of an entity, like "entity.User", the name of a typekey, like "typekey.SystemPermission", or a class name, like "java.lang.String". Names can have [] appended to them to create arrays, and multi-dimensional arrays are supported. This method behaves the same as getByFullName execept instead of throwing it returns null.- Parameters:
fullyQualifiedName- the fully qualified name of the type- Returns:
- the corresponding IType or null if the type does not exist
-
getByFullNameIfValidNoJava
IType getByFullNameIfValidNoJava(java.lang.String fullyQualifiedName)
-
refresh
void refresh(ITypeRef typeRef)
-
refresh
void refresh(boolean bRefreshCaches)
-
refresh
void refresh(IModule module)
-
refreshed
void refreshed(IResource file, java.lang.String typeName, RefreshKind refreshKind)
-
shutdown
void shutdown()
-
getRefreshChecksum
int getRefreshChecksum()
-
getSingleRefreshChecksum
int getSingleRefreshChecksum()
-
parseType
IType parseType(java.lang.String typeString) throws java.lang.IllegalArgumentException
Converts a String name of a type into an IType.- Throws:
java.lang.IllegalArgumentException- if the type string doesn't correspond to any known IType
-
parseType
IType parseType(java.lang.String typeString, ITypeUsesMap typeUsesMap) throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
-
parseType
IType parseType(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName)
-
parseType
IType parseType(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap)
-
parseTypeExpression
ITypeLiteralExpression parseTypeExpression(java.lang.String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws ParseResultsException
- Throws:
ParseResultsException
-
getNamespace
INamespaceType getNamespace(java.lang.String strFqNamespace)
-
getAllTypeNames
java.util.Set<? extends java.lang.CharSequence> getAllTypeNames()
Returns all type names in the system for all type loaders.- Returns:
- all type names in the system.
-
getOrCreateTypeVariableType
ITypeVariableType getOrCreateTypeVariableType(java.lang.String strName, IType boundingType, IType enclosingType)
-
getOrCreateFunctionType
IFunctionType getOrCreateFunctionType(IMethodInfo mi)
-
getOrCreateFunctionType
IFunctionType getOrCreateFunctionType(java.lang.String strFunctionName, IType retType, IType[] paramTypes)
-
mapTypeByVarName
TypeVarToTypeMap mapTypeByVarName(IType ownersType, IType declaringType)
-
getActualType
IType getActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
-
inferTypeVariableTypesFromGenParamTypeAndConcreteType
void inferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap map)
-
inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse
void inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse(IType genParamType, IType argType, TypeVarToTypeMap map)
-
getErrorType
IErrorType getErrorType()
-
getErrorType
IErrorType getErrorType(java.lang.String strErrantName)
-
getErrorType
IErrorType getErrorType(ParseResultsException pe)
-
getDefaultTypeLoader
IDefaultTypeLoader getDefaultTypeLoader()
-
addTypeLoaderListenerAsWeakRef
void addTypeLoaderListenerAsWeakRef(ITypeLoaderListener listener)
-
getNamespacesFromTypeNames
java.util.Set<java.lang.String> getNamespacesFromTypeNames(java.util.Set<? extends java.lang.CharSequence> allTypeNames, java.util.Set<java.lang.String> namespaces)
-
pushTypeLoader
void pushTypeLoader(ITypeLoader loader)
-
pushTypeLoader
void pushTypeLoader(IModule module, ITypeLoader loader)
-
removeTypeLoader
void removeTypeLoader(java.lang.Class<? extends ITypeLoader> loader)
-
pushIncludeAll
void pushIncludeAll()
-
popIncludeAll
void popIncludeAll()
-
isIncludeAll
boolean isIncludeAll()
-
getCurrentCompilingType
IType getCurrentCompilingType()
-
getCompilingType
IType getCompilingType(java.lang.String strName)
-
pushCompilingType
void pushCompilingType(IType type)
-
popCompilingType
void popCompilingType()
-
pushSymTableCtx
void pushSymTableCtx(ISymbolTable ctx)
-
popSymTableCtx
void popSymTableCtx()
-
getSymTableCtx
ISymbolTable getSymTableCtx()
-
getTypeLoader
<T extends ITypeLoader> T getTypeLoader(java.lang.Class<? extends T> loaderClass, IModule module)
-
getNameOfParams
java.lang.String getNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType)
-
getCompiledGosuClassSymbolTable
ISymbolTable getCompiledGosuClassSymbolTable()
-
getAllTypeLoaders
java.util.List<ITypeLoader> getAllTypeLoaders()
-
getJavaType
IType getJavaType(java.lang.Class javaClass)
-
getNameWithQualifiedTypeVariables
java.lang.String getNameWithQualifiedTypeVariables(IType type)
-
removeTypeLoaderListener
void removeTypeLoaderListener(ITypeLoaderListener listener)
-
getPrimitiveType
IJavaType getPrimitiveType(java.lang.String name)
-
getExecutionEnvironment
IExecutionEnvironment getExecutionEnvironment()
-
getExecutionEnvironment
IExecutionEnvironment getExecutionEnvironment(IProject project)
-
getCurrentModule
IModule getCurrentModule()
-
getTypeFromObject
IType getTypeFromObject(java.lang.Object obj)
-
isExpandable
boolean isExpandable(IType type)
-
clearErrorTypes
void clearErrorTypes()
-
getGosuClassLoader
IGosuClassLoader getGosuClassLoader()
-
dumpGosuClassLoader
void dumpGosuClassLoader()
-
getDefaultType
IMetaType getDefaultType()
-
addShutdownListener
void addShutdownListener(TypeSystemShutdownListener listener)
-
pushModule
void pushModule(IModule gosuModule)
-
popModule
void popModule(IModule gosuModule)
-
replaceTypeVariableTypeParametersWithBoundingTypes
IType replaceTypeVariableTypeParametersWithBoundingTypes(IType iType, IType type)
-
makeGosucCompiler
IGosuc makeGosucCompiler(java.lang.String gosucProjectFile, ICustomParser custParser)
-
isParameterizedWith
boolean isParameterizedWith(IType type, ITypeVariableType... typeVar)
-
getFunctionalInterface
IType getFunctionalInterface(IFunctionType type)
-
-