public class TypeSystem extends Object
| Modifier and Type | Field and Description |
|---|---|
static InvocationCounter |
tyeLoadingCounter |
static InvocationCounter |
tyeRequestCounter |
| Constructor and Description |
|---|
TypeSystem() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addShutdownListener(TypeSystemShutdownListener listener) |
static void |
addTypeLoaderListenerAsWeakRef(ITypeLoaderListener listener) |
static IType |
boundTypes(IType targetType,
List<IType> typesToBound) |
static IType[] |
boxPrimitiveTypeParams(IType[] typeParams) |
static boolean |
canCast(IType lhsType,
IType rhsType) |
static void |
clearErrorTypes() |
static void |
created(IResource resource) |
static void |
created(IResource resource,
String typeName) |
static void |
deleted(IResource resource) |
static void |
deleted(IResource resource,
String typeName) |
static void |
dumpGosuClassLoader() |
static IType |
findParameterizedType(IType type,
IType rhsType) |
static IType |
get(Class javaClass)
Gets the intrinsic type for a given class.
|
static IType |
get(Class javaClass,
IModule module) |
static IType |
get(IJavaClassInfo javaClassInfo) |
static IType |
get(IJavaClassInfo classInfo,
IModule module) |
static IType |
getActualType(IType type,
TypeVarToTypeMap actualParamByVarName,
boolean bKeepTypeVars) |
static List<ITypeLoader> |
getAllTypeLoaders() |
static Set<? extends CharSequence> |
getAllTypeNames()
Returns all type names in the system for all type loaders.
|
static IType |
getBoxType(IType primitiveType) |
static IType |
getByFullName(String fullyQualifiedName)
Gets an intrinsic type based on a fully-qualified name.
|
static IType |
getByFullName(String fullyQualifiedName,
IModule module) |
static IType |
getByFullName(String fullyQualifiedName,
String moduleName)
Deprecated.
call getByFullName( String, IModule )
|
static IType |
getByFullNameIfValid(String fullyQualifiedName)
Gets a type based on a fully-qualified name.
|
static IType |
getByFullNameIfValid(String typeName,
IModule module) |
static IType |
getByFullNameIfValidNoJava(String fullyQualifiedName) |
static IType |
getByRelativeName(String relativeName) |
static IType |
getByRelativeName(String relativeName,
ITypeUsesMap typeUses)
Gets an intrinsic type based on a relative name.
|
static ISymbolTable |
getCompiledGosuClassSymbolTable() |
static IType |
getCompilingType(String strName) |
static IType |
getComponentType(IType valueType) |
static IType |
getCompoundType(Set<IType> types) |
static IType |
getCurrentCompilingType() |
static IModule |
getCurrentModule() |
static Method[] |
getDeclaredMethods(Class cls) |
static IType |
getDefaultParameterizedType(IType type) |
static IType |
getDefaultParameterizedTypeWithTypeVars(IType type) |
static IMetaType |
getDefaultType() |
static IDefaultTypeLoader |
getDefaultTypeLoader() |
static ITypeUsesMap |
getDefaultTypeUsesMap() |
static IErrorType |
getErrorType() |
static IErrorType |
getErrorType(ParseResultsException pe) |
static IErrorType |
getErrorType(String strErrantName) |
static IExecutionEnvironment |
getExecutionEnvironment() |
static IExecutionEnvironment |
getExecutionEnvironment(IProject project) |
static IType |
getFromObject(Object object)
Returns the intrinsic type for the given Object.
|
static IType |
getFromObject(Object object,
IModule module) |
static IType |
getFunctionalInterface(IFunctionType type) |
static String |
getGenericName(IType type) |
static String |
getGenericName(IType type,
boolean bRelative,
boolean bRelativeBounds) |
static String |
getGenericRelativeName(IType type,
boolean bRelativeBounds) |
static Lock |
getGlobalLock() |
static IModule |
getGlobalModule() |
static IGosuClassLoader |
getGosuClassLoader() |
static IJavaClassInfo |
getJavaClassInfo(Class jClass) |
static IJavaClassInfo |
getJavaClassInfo(Class jClass,
IModule module) |
static IJavaClassInfo |
getJavaClassInfo(String fullyQualifiedName,
IModule module) |
static IType |
getJavaType(Class javaClass)
Deprecated.
|
static IModule |
getJreModule() |
static IType |
getKeyType() |
static List<? extends IMethodInfo> |
getMethods(ITypeInfo beanInfo,
IType ownersIntrinsicType) |
static IModule |
getModuleFromType(IType type) |
static String |
getNameOfParams(IType[] paramTypes,
boolean bRelative,
boolean bWithEnclosingType) |
static INamespaceType |
getNamespace(String strFqNamespace) |
static INamespaceType |
getNamespace(String strType,
IModule module) |
static Set<String> |
getNamespacesFromTypeNames(Set<? extends CharSequence> allTypeNames,
Set<String> namespaces) |
static String |
getNameWithQualifiedTypeVariables(IType type) |
static IFunctionType |
getOrCreateFunctionType(IMethodInfo mi) |
static IFunctionType |
getOrCreateFunctionType(String strFunctionName,
IType retType,
IType[] paramTypes) |
static ITypeRef |
getOrCreateTypeReference(IType type)
IMPORTANT: The only time you should call this method is:
1) within a class implementing IType, or
2) wrapping a call to a Type constructor, typically within a type loader
e.g., TypeSystem.getOrCreateTypeReference( new MyVeryOwnType() )
Gets or creates a type ref for the specified type.
|
static ITypeVariableType |
getOrCreateTypeVariableType(String strName,
IType boundingType,
IType enclosingType) |
static IType |
getPrimitiveType(IType boxType) |
static IJavaType |
getPrimitiveType(String name) |
static List<? extends IPropertyInfo> |
getProperties(ITypeInfo beanInfo,
IType classSource) |
static IPropertyInfo |
getPropertyInfo(IType classBean,
String strProperty,
IFeatureFilter filter,
IParserPart parserBase,
IScriptabilityModifier scriptabilityConstraint) |
static <E extends IType> |
getPureGenericType(E type) |
static int |
getRefreshChecksum() |
static int |
getSingleRefreshChecksum() |
static TypeSystemState |
getState() |
static ISymbolTable |
getSymTableCtx() |
static IType |
getTypeFromJavaBackedType(IType type) |
static IType |
getTypeFromJavaBasedType(IJavaBackedType javaType) |
static IType |
getTypeFromObject(Object obj) |
static <T extends ITypeLoader> |
getTypeLoader(Class<? extends T> loaderClass) |
static <T extends ITypeLoader> |
getTypeLoader(Class<? extends T> loaderClass,
IModule module) |
static ITypeRef |
getTypeReference(IType type)
IMPORTANT: The only time you should call this method is:
1) wrapping a call to a Type constructor, typically within a type loader
e.g., TypeSystem.getOrCreateTypeReference( new MyVeryOwnType() )
Do NOT call this when creating the type.
|
static String[] |
getTypesForFile(IModule module,
IFile file) |
static String |
getUnqualifiedClassName(IType cls) |
static void |
inferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType,
IType argType,
TypeVarToTypeMap map,
boolean bReverse) |
static boolean |
isBeanType(IType typeSource) |
static boolean |
isBoxedTypeFor(IType primitiveType,
IType boxedType) |
static boolean |
isBytecodeType(IType type) |
static boolean |
isDeleted(IType type) |
static boolean |
isExpandable(IType type) |
static boolean |
isIncludeAll() |
static boolean |
isNumericType(IType intrType) |
static boolean |
isParameterizedWith(IType type,
ITypeVariableType... typeVar) |
static void |
lock()
Acquires the global type-system lock
|
static TypeVarToTypeMap |
mapTypeByVarName(IType ownersType,
IType declaringType) |
static IType |
parseType(String typeString)
Converts a String name of a type into an IType.
|
static IType |
parseType(String typeString,
ITypeUsesMap typeUsesMap) |
static IType |
parseType(String typeString,
TypeVarToTypeMap actualParamByVarName) |
static IType |
parseType(String typeString,
TypeVarToTypeMap actualParamByVarName,
ITypeUsesMap typeUsesMap) |
static ITypeLiteralExpression |
parseTypeExpression(String typeString,
TypeVarToTypeMap actualParamByVarName,
ITypeUsesMap typeUsesMap) |
static IType |
parseTypeLiteral(String typeName)
Parses a type name such as Iterable<Claim>.
|
static void |
popCompilingType() |
static void |
popGlobalModule() |
static void |
popIncludeAll() |
static void |
popModule(IModule gosuModule) |
static void |
popSymTableCtx() |
static void |
pushCompilingType(IType type) |
static void |
pushGlobalModule() |
static void |
pushIncludeAll() |
static void |
pushModule(IModule gosuModule) |
static void |
pushSymTableCtx(ISymbolTable ctx) |
static void |
pushTypeLoader(IModule module,
ITypeLoader loader) |
static void |
refresh(boolean bRefreshCaches) |
static void |
refresh(IModule module) |
static void |
refresh(ITypeRef typeRef)
Refresh just the specified type i.e., a gosu editor calls this on changes
|
static void |
refreshed(IResource resource) |
static void |
refreshedFiles(String[] filePaths)
DO NOT USE OR DELETE.
|
static void |
removeTypeLoader(Class<? extends ITypeLoader> loader) |
static void |
removeTypeLoaderListener(ITypeLoaderListener listener) |
static IType |
replaceTypeVariableTypeParametersWithBoundingTypes(IType type,
IType enclosingType) |
static void |
shutdown(IExecutionEnvironment execEnv) |
static void |
unlock()
Releases the global type-system lock
|
public static InvocationCounter tyeRequestCounter
public static InvocationCounter tyeLoadingCounter
public static IType get(Class javaClass)
Note: you should use this method only if you do not have an Object of class
javaClass to get the type from. If you
do have such an object, use getFromObject(java.lang.Object) instead.javaClass - the Class to convert to an intrinsic typegetFromObject(Object)public static IType get(IJavaClassInfo javaClassInfo)
public static IType get(IJavaClassInfo classInfo, IModule module)
public static IType getFromObject(Object object)
object - the object to get an IType forget(Class)public static IType getByRelativeName(String relativeName) throws ClassNotFoundException
ClassNotFoundExceptionpublic static IType getByRelativeName(String relativeName, ITypeUsesMap typeUses) throws ClassNotFoundException
relativeName - the relative name of the typetypeUses - the map of used types to use when resolvingClassNotFoundException - if the specified name doesn't correspond to any typepublic static IType getByFullName(String fullyQualifiedName)
fullyQualifiedName - the fully qualified name of the typeRuntimeException - if the specified name doesn't correspond to any typepublic static IType getByFullName(String fullyQualifiedName, String moduleName)
public static void pushGlobalModule()
public static void popGlobalModule()
public static IType getByFullNameIfValid(String fullyQualifiedName)
fullyQualifiedName - the fully qualified name of the typepublic static IType getByFullNameIfValidNoJava(String fullyQualifiedName)
public static void clearErrorTypes()
public static int getRefreshChecksum()
public static int getSingleRefreshChecksum()
public static IType parseType(String typeString) throws IllegalArgumentException
typeString - the type name to parseIllegalArgumentException - if the type string doesn't correspond to any known ITypepublic static IType parseType(String typeString, ITypeUsesMap typeUsesMap) throws IllegalArgumentException
IllegalArgumentExceptionpublic static IType parseType(String typeString, TypeVarToTypeMap actualParamByVarName) throws IllegalArgumentException
IllegalArgumentExceptionpublic static IType parseType(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws IllegalArgumentException
IllegalArgumentExceptionpublic static ITypeLiteralExpression parseTypeExpression(String typeString, TypeVarToTypeMap actualParamByVarName, ITypeUsesMap typeUsesMap) throws ParseResultsException
ParseResultsExceptionpublic static void lock()
public static void unlock()
public static Lock getGlobalLock()
public static INamespaceType getNamespace(String strFqNamespace)
public static INamespaceType getNamespace(String strType, IModule module)
public static Set<? extends CharSequence> getAllTypeNames()
public static ITypeVariableType getOrCreateTypeVariableType(String strName, IType boundingType, IType enclosingType)
public static IFunctionType getOrCreateFunctionType(IMethodInfo mi)
public static IFunctionType getOrCreateFunctionType(String strFunctionName, IType retType, IType[] paramTypes)
public static <E extends IType> E getPureGenericType(E type)
public static boolean isBeanType(IType typeSource)
public static boolean isNumericType(IType intrType)
public static TypeVarToTypeMap mapTypeByVarName(IType ownersType, IType declaringType)
public static IType getActualType(IType type, TypeVarToTypeMap actualParamByVarName, boolean bKeepTypeVars)
public static void inferTypeVariableTypesFromGenParamTypeAndConcreteType(IType genParamType, IType argType, TypeVarToTypeMap map, boolean bReverse)
public static IErrorType getErrorType()
public static IErrorType getErrorType(String strErrantName)
public static IErrorType getErrorType(ParseResultsException pe)
public static IDefaultTypeLoader getDefaultTypeLoader()
public static void addTypeLoaderListenerAsWeakRef(ITypeLoaderListener listener)
public static Set<String> getNamespacesFromTypeNames(Set<? extends CharSequence> allTypeNames, Set<String> namespaces)
public static void pushTypeLoader(IModule module, ITypeLoader loader)
public static void removeTypeLoader(Class<? extends ITypeLoader> loader)
public static IType getKeyType()
public static void pushIncludeAll()
public static void popIncludeAll()
public static boolean isIncludeAll()
public static ITypeUsesMap getDefaultTypeUsesMap()
public static IType getCurrentCompilingType()
public static void pushCompilingType(IType type)
public static void popCompilingType()
public static void pushSymTableCtx(ISymbolTable ctx)
public static void popSymTableCtx()
public static ISymbolTable getSymTableCtx()
public static <T extends ITypeLoader> T getTypeLoader(Class<? extends T> loaderClass)
public static <T extends ITypeLoader> T getTypeLoader(Class<? extends T> loaderClass, IModule module)
public static String getNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType)
public static ISymbolTable getCompiledGosuClassSymbolTable()
public static List<ITypeLoader> getAllTypeLoaders()
public static String getGenericRelativeName(IType type, boolean bRelativeBounds)
public static String getGenericName(IType type, boolean bRelative, boolean bRelativeBounds)
public static IPropertyInfo getPropertyInfo(IType classBean, String strProperty, IFeatureFilter filter, IParserPart parserBase, IScriptabilityModifier scriptabilityConstraint) throws ParseException
ParseExceptionpublic static List<? extends IPropertyInfo> getProperties(ITypeInfo beanInfo, IType classSource)
public static List<? extends IMethodInfo> getMethods(ITypeInfo beanInfo, IType ownersIntrinsicType)
@Deprecated public static IType getJavaType(Class javaClass)
public static String getNameWithQualifiedTypeVariables(IType type)
public static IType getDefaultParameterizedTypeWithTypeVars(IType type)
public static void removeTypeLoaderListener(ITypeLoaderListener listener)
public static IExecutionEnvironment getExecutionEnvironment()
public static IExecutionEnvironment getExecutionEnvironment(IProject project)
public static IModule getCurrentModule()
public static ITypeRef getOrCreateTypeReference(IType type)
type - A raw or proxied type.public static ITypeRef getTypeReference(IType type)
type - A raw or proxied type.public static IType parseTypeLiteral(String typeName)
typeName - the name to parsepublic static boolean isExpandable(IType type)
public static IJavaClassInfo getJavaClassInfo(Class jClass)
public static IJavaClassInfo getJavaClassInfo(Class jClass, IModule module)
public static boolean isBytecodeType(IType type)
public static IType getTypeFromJavaBasedType(IJavaBackedType javaType)
public static IJavaClassInfo getJavaClassInfo(String fullyQualifiedName, IModule module)
public static void pushModule(IModule gosuModule)
public static void popModule(IModule gosuModule)
public static IGosuClassLoader getGosuClassLoader()
public static void dumpGosuClassLoader()
public static IModule getGlobalModule()
public static IMetaType getDefaultType()
public static void shutdown(IExecutionEnvironment execEnv)
public static void addShutdownListener(TypeSystemShutdownListener listener)
public static TypeSystemState getState()
public static void refresh(boolean bRefreshCaches)
public static void refresh(IModule module)
public static void refresh(ITypeRef typeRef)
public static void refreshedFiles(String[] filePaths)
filePaths - public static void refreshed(IResource resource)
public static void deleted(IResource resource)
public static void created(IResource resource)
public static boolean isDeleted(IType type)
public static IType replaceTypeVariableTypeParametersWithBoundingTypes(IType type, IType enclosingType)
public static boolean isParameterizedWith(IType type, ITypeVariableType... typeVar)
public static IModule getJreModule()
public static IType getFunctionalInterface(IFunctionType type)
Copyright © 2022. All rights reserved.