Interface ITypeSystem

All Superinterfaces:
IPluginHost, IService
All Known Implementing Classes:
TypeLoaderAccess

public interface ITypeSystem extends IService
  • Method Details

    • get

      IType get(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 class javaClass to get the type from. If you do have such an object, use getFromObject(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

      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:
    • 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 type
      typeUses - 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
    • getByFullNameIfValidNoJava

      IType getByFullNameIfValidNoJava(String fullyQualifiedName)
    • 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()
    • getTypesForFile

      String[] getTypesForFile(IModule module, IFile file)
    • 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
    • getComponentType

      IType getComponentType(IType valueType)
    • 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

    • getDefaultTypeLoader

      IDefaultTypeLoader getDefaultTypeLoader()
    • findParameterizedType

      IType findParameterizedType(IType type, IType rhsType)
    • 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()
    • getCompilingType

      IType getCompilingType(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(Class<? extends T> loaderClass, IModule module)
    • getNameOfParams

      String getNameOfParams(IType[] paramTypes, boolean bRelative, boolean bWithEnclosingType)
    • getCompiledGosuClassSymbolTable

      ISymbolTable getCompiledGosuClassSymbolTable()
    • getAllTypeLoaders

      List<ITypeLoader> getAllTypeLoaders()
    • getJavaType

      IType getJavaType(Class javaClass)
    • getNameWithQualifiedTypeVariables

      String getNameWithQualifiedTypeVariables(IType type)
    • getDefaultParameterizedType

      IType getDefaultParameterizedType(IType type)
    • getDefaultParameterizedTypeWithTypeVars

      IType getDefaultParameterizedTypeWithTypeVars(IType type)
    • canCast

      boolean canCast(IType lhsType, IType rhsType)
    • removeTypeLoaderListener

      void removeTypeLoaderListener(ITypeLoaderListener listener)
    • getPrimitiveType

      IJavaType getPrimitiveType(String name)
    • getPrimitiveType

      IType getPrimitiveType(IType boxType)
    • getBoxType

      IType getBoxType(IType primitiveType)
    • getExpandableComponentType

      IType getExpandableComponentType(IType type)
    • getExecutionEnvironment

      IExecutionEnvironment getExecutionEnvironment()
    • getExecutionEnvironment

      IExecutionEnvironment getExecutionEnvironment(IProject project)
    • getCurrentModule

      IModule getCurrentModule()
    • getOrCreateTypeReference

      ITypeRef getOrCreateTypeReference(IType type)
    • getTypeReference

      ITypeRef getTypeReference(IType type)
    • getTypeFromObject

      IType getTypeFromObject(Object obj)
    • isExpandable

      boolean isExpandable(IType type)
    • clearErrorTypes

      void clearErrorTypes()
    • boundTypes

      IType boundTypes(IType parameterType, List<IType> inferringTypes)
    • 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)
    • getCompoundType

      IType getCompoundType(Set<IType> types)
    • getFunctionalInterface

      IType getFunctionalInterface(IFunctionType type)