Class JavaClassStubsModelRoot
- java.lang.Object
 - 
- jetbrains.mps.extapi.persistence.ModelRootBase
 - 
- jetbrains.mps.extapi.persistence.FileBasedModelRoot
 - 
- jetbrains.mps.persistence.java.library.JavaClassStubsModelRoot
 
 
 
 
- 
- All Implemented Interfaces:
 CopyableModelRoot<JavaClassStubsModelRoot>,FileListener,FileSystemListener,ModelRoot
public class JavaClassStubsModelRoot extends FileBasedModelRoot implements CopyableModelRoot<JavaClassStubsModelRoot>
 
- 
- 
Field Summary
- 
Fields inherited from class jetbrains.mps.extapi.persistence.FileBasedModelRoot
CONTENT_PATH, EXCLUDED, LOCATION, SOURCE_ROOTS 
 - 
 
- 
Constructor Summary
Constructors Constructor Description JavaClassStubsModelRoot() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCreateModel(String string)booleancanCreateModels()There are model roots which are read-only and fix the result ofModelRoot.getModels()right away from the construction FIXME it is strange to have two similar methods: we are better to merge this method into the methodModelRoot.canCreateModel(java.lang.String).voidcopyTo(JavaClassStubsModelRoot targetModelRoot)Copies this model root contents to thetargetModelRoot .SModelcreateModel(String string)Creates a new model with the given name.SModelgetModel(SModelId id)voidgetModelDescriptors(List<SModel> result, IFile file, String prefix, SModule module)StringgetType()A customizable categorization identifier, such as JavaStubsvoidload(Memento memento)Allows the model root to read its previously saved configuration informationIterable<SModel>loadModels()returns all models under the model root if some model is already loaded and registered, it is recommended to return the loaded one instead of loading another timevoidsave(Memento memento)Gives the model root the opportunity to persist into the supplied memento whatever configuration information may be needed to restore the models in the future.- 
Methods inherited from class jetbrains.mps.extapi.persistence.FileBasedModelRoot
addFile, addSourceRoot, attach, containsFile, deleteFile, dispose, equals, getContentDirectory, getContentRoot, getFiles, getFileSystem, getFileToListen, getPresentation, getSourceRoots, getSupportedFileKinds, getSupportedFileKinds1, hashCode, relativize, relativize, removeSourceRoot, setContentDirectory, setContentRoot, update 
- 
Methods inherited from class jetbrains.mps.extapi.persistence.ModelRootBase
assertCanChange, assertCanRead, getModels, getModule, getRepository, isRegistered, registerModel, setModule, toString, update 
- 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface jetbrains.mps.vfs.refresh.FileListener
listeningPreferences 
- 
Methods inherited from interface jetbrains.mps.vfs.refresh.FileSystemListener
getListenerDependencies 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getType
public String getType()
Description copied from interface:ModelRootA customizable categorization identifier, such as JavaStubs 
- 
load
public void load(@NotNull Memento memento)
Description copied from interface:ModelRootAllows the model root to read its previously saved configuration information- Specified by:
 loadin interfaceModelRoot- Overrides:
 loadin classFileBasedModelRoot
 
- 
save
public void save(@NotNull Memento memento)
Description copied from interface:ModelRootGives the model root the opportunity to persist into the supplied memento whatever configuration information may be needed to restore the models in the future.- Specified by:
 savein interfaceModelRoot- Overrides:
 savein classFileBasedModelRoot
 
- 
loadModels
@NotNull public Iterable<SModel> loadModels()
Description copied from class:ModelRootBasereturns all models under the model root if some model is already loaded and registered, it is recommended to return the loaded one instead of loading another time- Specified by:
 loadModelsin classModelRootBase- Returns:
 - a sequence of models
 
 
- 
canCreateModels
public boolean canCreateModels()
Description copied from interface:ModelRootThere are model roots which are read-only and fix the result ofModelRoot.getModels()right away from the construction FIXME it is strange to have two similar methods: we are better to merge this method into the methodModelRoot.canCreateModel(java.lang.String).- Specified by:
 canCreateModelsin interfaceModelRoot- Overrides:
 canCreateModelsin classModelRootBase- Returns:
 - whether this model root is read-only in the way described above
 
 
- 
canCreateModel
public boolean canCreateModel(@NotNull String string)
- Specified by:
 canCreateModelin interfaceModelRoot- Parameters:
 string- -- the same as in theModelRoot.createModel(String)- Returns:
 - whether a model with a name 
modelNamecan be created under this model root. 
 
- 
createModel
public SModel createModel(@NotNull String string)
Description copied from interface:ModelRootCreates a new model with the given name. The new model will be contained in this model root (methods #getModel, #getModels).- Specified by:
 createModelin interfaceModelRoot- Parameters:
 string- -- might fq name or just simple short model name. Up to implementor- See Also:
 // * @deprecated // * @return null if failed, for instance returned false.
 
- 
getModelDescriptors
public void getModelDescriptors(List<SModel> result, IFile file, String prefix, SModule module)
 
- 
copyTo
public void copyTo(@NotNull JavaClassStubsModelRoot targetModelRoot) throws CopyNotSupportedException
Description copied from interface:CopyableModelRootCopies this model root contents to thetargetModelRoot . the resulting model root must be equal to the prototype- Specified by:
 copyToin interfaceCopyableModelRoot<JavaClassStubsModelRoot>- Throws:
 CopyNotSupportedException
 
 - 
 
 -