Package org.jetbrains.mps.openapi.module
Interface SModule
- 
 public interface SModuleA module represents a language or a solution.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddModuleListener(SModuleListener listener)Listener can be added only once, the second time it's just not addedIterable<SDependency>getDeclaredDependencies()All dependencies on modules of all kinds.<T extends SModuleFacet>
 TgetFacet(Class<T> clazz)Returns facet of the specified class.Iterable<SModuleFacet>getFacets()Retrieves all instantiated facets.SModelgetModel(SModelId id)FIXME document whether this method required model read Retrieves a module's model by idIterable<ModelRoot>getModelRoots()Iterable<SModel>getModels()Retrieves all module's models Contract: if the module was not changed the order of the models which this method returns stays the same.SModuleIdgetModuleId()The repository-wide unique identifierStringgetModuleName()Identical to getModuleReference.getModuleName()SModuleReferencegetModuleReference()A reference to the module, which persists between subsequent read/write actions.SRepositorygetRepository()The repository module has been registered with.Set<SLanguage>getUsedLanguages()Returns all used languages by this moduleintgetUsedLanguageVersion(SLanguage usedLanguage)Returns version of used languagebooleanisPackaged()The module has been imported as a compiled library, not sources.booleanisReadOnly()No updates are permittedvoidremoveModuleListener(SModuleListener listener)
 
- 
- 
- 
Method Detail- 
getModuleIdSModuleId getModuleId() The repository-wide unique identifier
 - 
getModuleNameString getModuleName() Identical to getModuleReference.getModuleName()
 - 
getModuleReference@NotNull SModuleReference getModuleReference() A reference to the module, which persists between subsequent read/write actions.
 - 
isReadOnlyboolean isReadOnly() No updates are permitted
 - 
isPackagedboolean isPackaged() The module has been imported as a compiled library, not sources. Implies read only.
 - 
getRepository@Nullable SRepository getRepository() The repository module has been registered with. Note, you can rely on non-nullvalue to indicate module is still in the repository only if you do so during model read/write. Otherwise, if you ask for module's repository outside of model lock, you may get stale value, e.g. if some other thread detach the module from the repository, so that in your thread:SRepository repo = module.getRepository(); repo.getModelAccess().runReadAction(() -> { SModule actualModule = repo.resolve(module.getModuleReference()); if (actualModule == null) { // legitimate case, module's repo might become stale if obtained outside of model lock } } );
 - 
getDeclaredDependenciesIterable<SDependency> getDeclaredDependencies() All dependencies on modules of all kinds. Includes only dependencies declared in this model. See also GlobalModuleDependenciesManager [not yet in API]
 - 
getUsedLanguageVersionint getUsedLanguageVersion(@NotNull SLanguage usedLanguage) Returns version of used language
 - 
getModel@Nullable SModel getModel(SModelId id) FIXME document whether this method required model read Retrieves a module's model by id
 - 
getModels@NotNull Iterable<SModel> getModels() Retrieves all module's models Contract: if the module was not changed the order of the models which this method returns stays the same.
 - 
getFacets@NotNull Iterable<SModuleFacet> getFacets() Retrieves all instantiated facets. (seeSModuleFacet)
 - 
getFacet@Nullable <T extends SModuleFacet> T getFacet(@NotNull Class<T> clazz) Returns facet of the specified class. If there is more than one facet instance that conforms specified class, it's unspecified which one is returned, usegetFacets()instead and filter as appropriate.
 - 
addModuleListenervoid addModuleListener(SModuleListener listener) Listener can be added only once, the second time it's just not added
 - 
removeModuleListenervoid removeModuleListener(SModuleListener listener) 
 
- 
 
-