Package gw.lang.reflect
Interface ITypeSystem
-
- All Superinterfaces:
IPluginHost
,IService
- All Known Implementing Classes:
TypeLoaderAccess
public interface ITypeSystem extends IService
-
-
Method Summary
-
Methods inherited from interface gw.plugin.IPluginHost
getInterface
-
-
-
-
Method Detail
-
get
IType get(Class<?> javaClass)
Gets the intrinsic type for a given class.javaClass
to 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(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(String relativeName) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getByRelativeName
IType getByRelativeName(String relativeName, ITypeUsesMap typeUses) throws 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:
ClassNotFoundException
- if the specified name doesn't correspond to any type
-
getByFullName
IType getByFullName(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:
RuntimeException
- if the specified name doesn't correspond to any type
-
getByFullNameIfValid
IType getByFullNameIfValid(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
-
refresh
void refresh(ITypeRef typeRef)
-
refresh
void refresh(boolean bRefreshCaches)
-
refresh
void refresh(IModule module)
-
refreshed
void refreshed(IResource file, String typeName, RefreshKind refreshKind)
-
shutdown
void shutdown()
-
getRefreshChecksum
int getRefreshChecksum()
-
getSingleRefreshChecksum
int getSingleRefreshChecksum()
-
parseType
IType parseType(String typeString) throws IllegalArgumentException
Converts a String name of a type into an IType.- Throws:
IllegalArgumentException
- if the type string doesn't correspond to any known IType
-
parseType
IType parseType(String typeString, ITypeUsesMap typeUsesMap) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
parseType
IType parseType(String typeString, TypeVarToTypeMap actualParamByVarName)
-
parseType
IType parseType(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap)
-
parseTypeExpression
ITypeLiteralExpression parseTypeExpression(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws ParseResultsException
- Throws:
ParseResultsException
-
getNamespace
INamespaceType getNamespace(String strFqNamespace)
-
getAllTypeNames
Set<? extends CharSequence> getAllTypeNames()
Returns all type names in the system for all type loaders.- Returns:
- all type names in the system.
-
getOrCreateTypeVariableType
ITypeVariableType getOrCreateTypeVariableType(String strName, IType boundingType, IType enclosingType)
-
getOrCreateFunctionType
IFunctionType getOrCreateFunctionType(IMethodInfo mi)
-
getOrCreateFunctionType
IFunctionType getOrCreateFunctionType(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(String strErrantName)
-
getErrorType
IErrorType getErrorType(ParseResultsException pe)
-
getDefaultTypeLoader
IDefaultTypeLoader getDefaultTypeLoader()
-
addTypeLoaderListenerAsWeakRef
void addTypeLoaderListenerAsWeakRef(ITypeLoaderListener listener)
-
getNamespacesFromTypeNames
Set<String> getNamespacesFromTypeNames(Set<? extends CharSequence> allTypeNames, Set<String> namespaces)
-
pushTypeLoader
void pushTypeLoader(ITypeLoader loader)
-
pushTypeLoader
void pushTypeLoader(IModule module, ITypeLoader loader)
-
removeTypeLoader
void removeTypeLoader(Class<? extends ITypeLoader> loader)
-
pushIncludeAll
void pushIncludeAll()
-
popIncludeAll
void popIncludeAll()
-
isIncludeAll
boolean isIncludeAll()
-
getCurrentCompilingType
IType getCurrentCompilingType()
-
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(Class<? extends T> loaderClass, IModule module)
-
getNameOfParams
String getNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType)
-
getCompiledGosuClassSymbolTable
ISymbolTable getCompiledGosuClassSymbolTable()
-
getAllTypeLoaders
List<ITypeLoader> getAllTypeLoaders()
-
removeTypeLoaderListener
void removeTypeLoaderListener(ITypeLoaderListener listener)
-
getExecutionEnvironment
IExecutionEnvironment getExecutionEnvironment()
-
getExecutionEnvironment
IExecutionEnvironment getExecutionEnvironment(IProject project)
-
getCurrentModule
IModule getCurrentModule()
-
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(String gosucProjectFile, ICustomParser custParser)
-
isParameterizedWith
boolean isParameterizedWith(IType type, ITypeVariableType... typeVar)
-
getFunctionalInterface
IType getFunctionalInterface(IFunctionType type)
-
-