Package jetbrains.mps.smodel
Class RegularModelDescriptor
- java.lang.Object
 - 
- jetbrains.mps.extapi.model.SModelDescriptorStub
 - 
- jetbrains.mps.extapi.model.SModelBase
 - 
- jetbrains.mps.smodel.RegularModelDescriptor
 
 
 
 
- 
- All Implemented Interfaces:
 ModelWithDisposeInfo,FastNodeFinder.Factory,SModelInternal,SModel
- Direct Known Subclasses:
 EditableModelDescriptor,JavaClassStubModelDescriptor,ProjectStructureModule.ProjectStructureSModelDescriptor
public abstract class RegularModelDescriptor extends SModelBase
General [openapi]SModel implementation, with proper synchronization and loading notifications, with factory methodcreateModel()for subclasses to override. IMPLEMENTATION NOTES: Bears 'ModelDescriptor' name to keep it consistent, where model data is smodel.SModel, and openapi.SModel implementation is merely a proxy to model data. Once I can do similar implementation using API classes only, shall switch to use 'Model' for these proxies (openapi.SModel) and stick to various XXXModelData for smodel.SModel. Lives in j.m.smodel, not j.m.extapi.model as it depends from smodel.SModel now, and I want API to use API classes only. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.jetbrains.mps.openapi.model.SModel
SModel.Problem 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected ObjectmyLoadLockleft protected for subclasses that need extended control over loading process (i.e. 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedRegularModelDescriptor(SModelReference modelReference, DataSource dataSource) 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ModelLoadResult<SModel>createModel()protected voiddoUnload()Perform actual dispose of model data andSModelBase.setLoadingState(ModelLoadingState)changes loading state}.protected SModelgetCurrentModelInternal()Likely, shall return SModelData eventuallySModelgetSModelInternal()Migration to 3.0.protected voidreplace(ModelLoadResult<SModel> newModel)Handy utility when the new model data is known/obtained beforehand, not through #createModel() factory- 
Methods inherited from class jetbrains.mps.extapi.model.SModelBase
addAccessListener, addChangeListener, addModelListener, addRootNode, assertCanChange, assertCanRead, attach, changeModelReference, createNode, createNode, detach, fireBeforeModelRenamed, fireConflictDetected, fireModelRenamed, fireModelReplaced, fireModelSaved, fireModelStateChanged, fireProblemsDetected, getLoadingState, getModelData, getModelId, getModelName, getModelRoot, getModule, getName, getNode, getNodeEventDispatch, getProblems, getReference, getRepository, getRootNodes, getSource, isLoaded, isReadOnly, load, removeAccessListener, removeChangeListener, removeModelListener, removeRootNode, replaceModelAndFireEvent, setLoadingState, setModelRoot, setModule, unload 
- 
Methods inherited from class jetbrains.mps.extapi.model.SModelDescriptorStub
addDevKit, addEngagedOnGenerationLanguage, addLanguage, addModelImport, addModelListener, clearListeners, createNodeFinder, deleteDevKit, deleteLanguageId, deleteModelImport, fireBeforeModelDisposed, fireBeforeModelFileChanged, fireBeforeModelRenamed, fireModelFileChanged, fireModelRenamed, fireModelStateChanged, getDisposedStacktrace, getLanguageImportVersion, getLanguagesEngagedOnGeneration, getModelDepsManager, getModelImports, getModelListeners, getSModel, importedDevkits, importedLanguageIds, isDisposed, removeEngagedOnGenerationLanguage, removeModelListener, setLanguageImportVersion, updateExternalReferences 
 - 
 
 - 
 
- 
- 
Field Detail
- 
myLoadLock
protected final Object myLoadLock
left protected for subclasses that need extended control over loading process (i.e. partial/sequential model loading) 
 - 
 
- 
Constructor Detail
- 
RegularModelDescriptor
protected RegularModelDescriptor(@NotNull SModelReference modelReference, @NotNull DataSource dataSource)
 
 - 
 
- 
Method Detail
- 
getSModelInternal
public final SModel getSModelInternal()
Description copied from class:SModelDescriptorStubMigration to 3.0. Loads and returns model data. FIXME Replace uses of this method with getSModel(), make it abstract and implement in SModelBase subclasses. The name getSModelInternal is misleading as it clashes with SModelInternal interface this class implements. Though getSModel is not much better, at least in the context of SModelDescriptor it makes more sense.- Specified by:
 getSModelInternalin classSModelDescriptorStub
 
- 
getCurrentModelInternal
@Nullable protected final SModel getCurrentModelInternal()
Description copied from class:SModelBaseLikely, shall return SModelData eventually- Specified by:
 getCurrentModelInternalin classSModelBase- Returns:
 - actual model data or 
nullif not initialized yet 
 
- 
createModel
@NotNull protected abstract ModelLoadResult<SModel> createModel()
- Returns:
 - new model data and level it was loaded to
 
 
- 
doUnload
protected void doUnload()
Description copied from class:SModelBasePerform actual dispose of model data andSModelBase.setLoadingState(ModelLoadingState)changes loading state}. No loading state event is sent (responsibility ofSModelBase.unload(). Subclasses shall override to clean instance fields and generally shall delegate to this implementation first to dispose model data.- Overrides:
 doUnloadin classSModelBase
 
- 
replace
protected void replace(@NotNull ModelLoadResult<SModel> newModel)
Handy utility when the new model data is known/obtained beforehand, not through #createModel() factory 
 - 
 
 -