Package gw.lang.reflect
Interface ITypeSystem
- All Superinterfaces:
IPluginHost
,IService
- All Known Implementing Classes:
TypeLoaderAccess
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
boundTypes
(IType parameterType, List<IType> inferringTypes) boolean
void
void
findParameterizedType
(IType type, IType rhsType) get
(IJavaClassInfo javaClassInfo) Gets the intrinsic type for a given class info object.Gets the intrinsic type for a given class.getActualType
(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars) Set<? extends CharSequence>
Returns all type names in the system for all type loaders.getBoxType
(IType primitiveType) getByFullName
(String fullyQualifiedName) Gets an intrinsic type based on a fully-qualified name.getByFullNameIfValid
(String fullyQualifiedName) Gets a type based on a fully-qualified name.getByFullNameIfValidNoJava
(String fullyQualifiedName) getByRelativeName
(String relativeName) getByRelativeName
(String relativeName, ITypeUsesMap typeUses) Gets an intrinsic type based on a relative name.getCompilingType
(String strName) getComponentType
(IType valueType) getCompoundType
(Set<IType> types) getErrorType
(String strErrantName) getExecutionEnvironment
(IProject project) getFromObject
(Object object) Returns the intrinsic type for the given Object.getJavaType
(Class javaClass) getNameOfParams
(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType) getNamespace
(String strFqNamespace) getNamespacesFromTypeNames
(Set<? extends CharSequence> allTypeNames, Set<String> namespaces) getOrCreateFunctionType
(String strFunctionName, IType retType, IType[] paramTypes) getOrCreateTypeVariableType
(String strName, IType boundingType, IType enclosingType) getPrimitiveType
(IType boxType) getPrimitiveType
(String name) int
int
getTypeFromObject
(Object obj) <T extends ITypeLoader>
TgetTypeLoader
(Class<? extends T> loaderClass, IModule module) getTypeReference
(IType type) String[]
getTypesForFile
(IModule module, IFile file) void
inferTypeVariableTypesFromGenParamTypeAndConcreteType
(IType genParamType, IType argType, TypeVarToTypeMap map) void
inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse
(IType genParamType, IType argType, TypeVarToTypeMap map) boolean
isExpandable
(IType type) boolean
boolean
isParameterizedWith
(IType type, ITypeVariableType... typeVar) makeGosucCompiler
(String gosucProjectFile, ICustomParser custParser) mapTypeByVarName
(IType ownersType, IType declaringType) Converts a String name of a type into an IType.parseType
(String typeString, ITypeUsesMap typeUsesMap) parseType
(String typeString, TypeVarToTypeMap actualParamByVarName) parseType
(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) parseTypeExpression
(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) void
void
void
void
void
pushCompilingType
(IType type) void
void
pushModule
(IModule gosuModule) void
void
pushTypeLoader
(ITypeLoader loader) void
pushTypeLoader
(IModule module, ITypeLoader loader) void
refresh
(boolean bRefreshCaches) void
void
void
refreshed
(IResource file, String typeName, RefreshKind refreshKind) void
removeTypeLoader
(Class<? extends ITypeLoader> loader) void
removeTypeLoaderListener
(ITypeLoaderListener listener) replaceTypeVariableTypeParametersWithBoundingTypes
(IType iType, IType type) void
shutdown()
Methods inherited from interface gw.plugin.IPluginHost
getInterface
-
Method Details
-
get
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:
-
get
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
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:
-
getByRelativeName
- Throws:
ClassNotFoundException
-
getByRelativeName
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
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
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
-
refresh
-
refresh
void refresh(boolean bRefreshCaches) -
refresh
-
refreshed
-
shutdown
void shutdown() -
getTypesForFile
-
getRefreshChecksum
int getRefreshChecksum() -
getSingleRefreshChecksum
int getSingleRefreshChecksum() -
parseType
Converts a String name of a type into an IType.- Throws:
IllegalArgumentException
- if the type string doesn't correspond to any known IType
-
parseType
- Throws:
IllegalArgumentException
-
parseType
-
parseType
-
parseTypeExpression
ITypeLiteralExpression parseTypeExpression(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws ParseResultsException - Throws:
ParseResultsException
-
getComponentType
-
getNamespace
-
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
-
getOrCreateFunctionType
-
mapTypeByVarName
-
getActualType
-
inferTypeVariableTypesFromGenParamTypeAndConcreteType
void inferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap map) -
inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse
void inferTypeVariableTypesFromGenParamTypeAndConcreteType_Reverse(IType genParamType, IType argType, TypeVarToTypeMap map) -
getErrorType
IErrorType getErrorType() -
getErrorType
-
getErrorType
-
getDefaultTypeLoader
IDefaultTypeLoader getDefaultTypeLoader() -
findParameterizedType
-
addTypeLoaderListenerAsWeakRef
-
getNamespacesFromTypeNames
-
pushTypeLoader
-
pushTypeLoader
-
removeTypeLoader
-
pushIncludeAll
void pushIncludeAll() -
popIncludeAll
void popIncludeAll() -
isIncludeAll
boolean isIncludeAll() -
getCurrentCompilingType
IType getCurrentCompilingType() -
getCompilingType
-
pushCompilingType
-
popCompilingType
void popCompilingType() -
pushSymTableCtx
-
popSymTableCtx
void popSymTableCtx() -
getSymTableCtx
ISymbolTable getSymTableCtx() -
getTypeLoader
-
getNameOfParams
-
getCompiledGosuClassSymbolTable
ISymbolTable getCompiledGosuClassSymbolTable() -
getAllTypeLoaders
List<ITypeLoader> getAllTypeLoaders() -
getJavaType
-
getNameWithQualifiedTypeVariables
-
getDefaultParameterizedType
-
getDefaultParameterizedTypeWithTypeVars
-
canCast
-
removeTypeLoaderListener
-
getPrimitiveType
-
getPrimitiveType
-
getBoxType
-
getExpandableComponentType
-
getExecutionEnvironment
IExecutionEnvironment getExecutionEnvironment() -
getExecutionEnvironment
-
getCurrentModule
IModule getCurrentModule() -
getOrCreateTypeReference
-
getTypeReference
-
getTypeFromObject
-
isExpandable
-
clearErrorTypes
void clearErrorTypes() -
boundTypes
-
getGosuClassLoader
IGosuClassLoader getGosuClassLoader() -
dumpGosuClassLoader
void dumpGosuClassLoader() -
getDefaultType
IMetaType getDefaultType() -
addShutdownListener
-
pushModule
-
popModule
-
replaceTypeVariableTypeParametersWithBoundingTypes
-
makeGosucCompiler
-
isParameterizedWith
-
getCompoundType
-
getFunctionalInterface
-