Package jetbrains.mps.generator
Class TransientModelsModule.TransientSModelDescriptor
- java.lang.Object
 - 
- jetbrains.mps.extapi.model.SModelDescriptorStub
 - 
- jetbrains.mps.extapi.model.SModelBase
 - 
- jetbrains.mps.extapi.model.EditableSModelBase
 - 
- jetbrains.mps.generator.TransientModelsModule.TransientSModelDescriptor
 
 
 
 
 
- 
- All Implemented Interfaces:
 ModelWithAttributes,ModelWithDisposeInfo,TransientSModel,FastNodeFinder.Factory,SModelInternal,EditableSModel,SModel
- Enclosing class:
 - TransientModelsModule
 
public final class TransientModelsModule.TransientSModelDescriptor extends EditableSModelBase implements TransientSModel, ModelWithAttributes
 
- 
- 
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 TransientSModelmySModel- 
Fields inherited from class jetbrains.mps.extapi.model.EditableSModelBase
myTimestampTracker 
 - 
 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassertCanChange()Invoked to check if it's legal to modify the model.protected voiddoUnload()Perform actual dispose of model data andSModelBase.setLoadingState(ModelLoadingState)changes loading state}.voidforEach(BiConsumer<String,String> action)Iterate over all available attributes.StringgetAttribute(String key)Retrieve extra model data.intgetBranchSerial()protected SModelgetCurrentModelInternal()Likely, shall return SModelData eventuallySModulegetModule()TODO make finalSModelgetSModelInternal()Migration to 3.0.booleanisChanged()voidmakeRefsMature()protected voidreloadContents()voidrename(String newModelName, boolean changeFile)protected booleansaveModel()returns true if the content should be reloaded from storage after savevoidsetAttribute(String key, String value)Record extra data with a model- 
Methods inherited from class jetbrains.mps.extapi.model.EditableSModelBase
addChangeListener, addRootNode, attach, detach, isReadOnly, needsReloading, reloadFromSource, removeChangeListener, removeRootNode, resolveDiskConflict, save, setChanged, toString, unload, updateTimestamp 
- 
Methods inherited from class jetbrains.mps.extapi.model.SModelBase
addAccessListener, addModelListener, assertCanRead, changeModelReference, createNode, createNode, fireBeforeModelRenamed, fireConflictDetected, fireModelRenamed, fireModelReplaced, fireModelSaved, fireModelStateChanged, fireProblemsDetected, getLoadingState, getModelData, getModelId, getModelName, getModelRoot, getName, getNode, getNodeEventDispatch, getProblems, getReference, getRepository, getRootNodes, getSource, isLoaded, load, removeAccessListener, removeModelListener, replaceModelAndFireEvent, setLoadingState, setModelRoot, setModule 
- 
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 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface jetbrains.mps.extapi.model.ModelWithAttributes
getAttribute 
- 
Methods inherited from interface org.jetbrains.mps.openapi.model.SModel
addAccessListener, addChangeListener, addModelListener, addRootNode, createNode, createNode, getModelId, getModelName, getModelRoot, getName, getNode, getProblems, getReference, getRepository, getRootNodes, getSource, isLoaded, isReadOnly, load, removeAccessListener, removeChangeListener, removeModelListener, removeRootNode, unload 
 - 
 
 - 
 
- 
- 
Field Detail
- 
mySModel
protected volatile TransientSModel mySModel
 
 - 
 
- 
Method Detail
- 
getBranchSerial
public int getBranchSerial()
 
- 
getCurrentModelInternal
protected SModel getCurrentModelInternal()
Description copied from class:SModelBaseLikely, shall return SModelData eventually- Specified by:
 getCurrentModelInternalin classSModelBase- Returns:
 - actual model data or 
nullif not initialized yet 
 
- 
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
 
- 
assertCanChange
protected void assertCanChange()
Description copied from class:SModelDescriptorStubInvoked to check if it's legal to modify the model. By default, is no-op, subclasses shall override to enforce proper policy- Overrides:
 assertCanChangein classSModelBase
 
- 
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
 
- 
getModule
public SModule getModule()
Description copied from class:SModelBaseTODO make final- Specified by:
 getModulein interfaceSModel- Overrides:
 getModulein classSModelBase
 
- 
isChanged
public boolean isChanged()
- Specified by:
 isChangedin interfaceEditableSModel- Overrides:
 isChangedin classEditableSModelBase
 
- 
saveModel
protected boolean saveModel()
Description copied from class:EditableSModelBasereturns true if the content should be reloaded from storage after save- Specified by:
 saveModelin classEditableSModelBase
 
- 
rename
public void rename(String newModelName, boolean changeFile)
- Specified by:
 renamein interfaceEditableSModel- Overrides:
 renamein classEditableSModelBase
 
- 
reloadContents
protected void reloadContents()
- Specified by:
 reloadContentsin classEditableSModelBase
 
- 
makeRefsMature
public void makeRefsMature()
 
- 
setAttribute
public void setAttribute(@NotNull String key, @Nullable String value)
Description copied from interface:ModelWithAttributesRecord extra data with a model- Specified by:
 setAttributein interfaceModelWithAttributes- Parameters:
 key- attribute identityvalue- attribute value, ornulldo remove an attribute, if any.
 
- 
getAttribute
@Nullable public String getAttribute(@NotNull String key)
Description copied from interface:ModelWithAttributesRetrieve extra model data.- Specified by:
 getAttributein interfaceModelWithAttributes- Parameters:
 key- attribute identity. There's no penalty if the key is unknown/unsupported with this model implementation- Returns:
 nullif there's no value for the key.
 
- 
forEach
public void forEach(@NotNull BiConsumer<String,String> action)
Description copied from interface:ModelWithAttributesIterate over all available attributes. Generally, not present attributes are not reported, however, clients shall expect null values, and implementation may report missing/deleted attributes. For now, the contract isactionshall not modify attributes, we might relax this in future (i.e. iterate over a copy of internal storage), if there are scenarios we find it handy.- Specified by:
 forEachin interfaceModelWithAttributes- Parameters:
 action- action to perform for each key-value attribute pair
 
 - 
 
 -