Package jetbrains.mps.smodel
Class SModelOperations
- java.lang.Object
 - 
- jetbrains.mps.smodel.SModelOperations
 
 
- 
public class SModelOperations extends Object
 
- 
- 
Constructor Summary
Constructors Constructor Description SModelOperations() 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static List<SModel>allImportedModels(SModel model)Deprecated.useModelDependencyResolverinsteadstatic Set<SLanguage>getAllLanguageImports(SModel model)Deprecated.useModelDependencyResolverinsteadstatic List<SModelReference>getImportedModelUIDs(SModel sModel)static List<SNode>getNodes(SModel model, SAbstractConcept concept)Plain code (i.e.static IFilegetOutputCacheLocation(SModel model)Pair method togetOutputLocation(SModel), responsible for model cache file location.static IFilegetOutputLocation(SModel model)Tell output folder of a model based on its kind and code generation facets active for model's module.static SNodegetRootByName(SModel model, String name)static booleanisReadOnly(SModel model) 
 - 
 
- 
- 
Method Detail
- 
getOutputLocation
@Nullable public static IFile getOutputLocation(@NotNull SModel model)
Tell output folder of a model based on its kind and code generation facets active for model's module. PROVISIONAL CODE. Needed for transition from cumbersomeFileGenerationUtilto facet-backed output locations. Doesn't support facets other thanJavaModuleFacetandTestsFacet- Returns:
 nullif model is not capable to produce output for a model (e.g. deployed/packaged module)- See Also:
 JavaModuleFacet,TestsFacet
 
- 
getOutputCacheLocation
@Nullable public static IFile getOutputCacheLocation(@NotNull SModel model)
Pair method togetOutputLocation(SModel), responsible for model cache file location. PROVISIONAL CODE. Same considerations as forgetOutputLocation(SModel)apply. 
- 
getNodes
public static List<SNode> getNodes(SModel model, @NotNull SAbstractConcept concept)
Plain code (i.e. BaseLanguage and SModel) counterpart for model.nodes(Concept) (i.e. from smodel language) which is translated intoSModelOperations.nodes(SModel, SAbstractConcept)Primary purpose of this method is to prevent using of FastNodeFinderManager from BL code.- Parameters:
 model- where to look for concept instances, toleratenullconcept- concept (with sub-concepts) to look up- Returns:
 - empty collection if model is 
nullor no concept instances found. 
 
- 
isReadOnly
public static boolean isReadOnly(SModel model)
 
- 
getAllLanguageImports
@Deprecated @NotNull public static Set<SLanguage> getAllLanguageImports(@NotNull SModel model)
Deprecated.useModelDependencyResolverinsteadTell used languages of a model the way user specified them in model dependencies. Doesn't look at actual model content (i.e. what concept instances are there).To obtain closure including extended/extending languages, use
SLanguageHierarchyIMPORTANT: For a
modelthat is not attached to a repository, set of used languages may be incomplete (MPS needs to resolve used DevKit modules to tell languages they expose).- Returns:
 - set of languages imported by the model, either directly or through devkit
 - Since:
 - 3.3
 
 
- 
allImportedModels
@Deprecated public static List<SModel> allImportedModels(SModel model)
Deprecated.useModelDependencyResolverinstead 
- 
getImportedModelUIDs
@NotNull public static List<SModelReference> getImportedModelUIDs(SModel sModel)
 
 - 
 
 -