Package jetbrains.mps.util
Class SNodeOperations
- java.lang.Object
 - 
- jetbrains.mps.util.SNodeOperations
 
 
- 
public class SNodeOperations extends Object
 
- 
- 
Constructor Summary
Constructors Constructor Description SNodeOperations() 
- 
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcopyProperties(SNode from, SNode to)Deprecated.use node/../.copy or copy manuallystatic voidcopyUserObjects(SNode from, SNode to)Deprecated.don't use user objects, store them separatelystatic SNodefindParent(SNode node, Condition<SNode> condition)Deprecated.use node/../.ancestors.wherestatic SNodegetChild(SNode node, String role)Deprecated.rewrite using SContainmentLink, don't use by-string rolesstatic SNodegetChild(SNode node, SContainmentLink role)Deprecated.use node/../.child or SNode.getChildrenstatic List<SNode>getChildren(SNode n)Deprecated.use SNode.getChildrenstatic List<SNode>getChildren(SNode node, boolean includeAttributes)Deprecated.there is no full equivalent to this, use SNode.getChildren or node/../.children operations if possiblestatic Set<String>getChildRoles(SNode n)Deprecated.rewrite to SContainmentLink, don't use by-name roles, use SNode methodsstatic Set<SContainmentLink>getChildRoles(SNode n, boolean includeAttributeRoles)Deprecated.use either SNode.getChildren.select(it->it.role) or SNode.getConcept.getContainmentLinks depending on what you want to getstatic StringgetDebugText(SNode node)Deprecated.use SNode.getName, SNode.getModel or whatever info you really need.static StringgetModelLongName(SModel model)Deprecated.inlinestatic StringgetModelStereotype(SModel model)Deprecated.inlinestatic Map<String,String>getProperties(SNode node)Deprecated.rewrite to SProperty, don't use stringsstatic Set<String>getReferenceRoles(SNode n)Deprecated.use either SNode.getReference.select(it->it.role) or SNode.getConcept.getReferenceLinks depending on what you want to getstatic List<SReference>getReferences(SNode n)Deprecated.use SNode.getReferencesstatic StringgetResolveInfo(SNode n)Deprecated.use SNodeUtil.getResolveInfo (note it does not return name in case of !isInstanceOf(IResolveInfo))static SNodegetTargetNodeSilently(SReference ref)Deprecated.not supposed to be used not in MPS core.static booleanisAncestor(SNode ancestor, SNode node)Deprecated.use .ancestors.contains() in smodel languagestatic booleanisGeneratable(SModel model)Deprecated.not supposed to be used outside of MPS core, inline if you use itstatic booleanisModelDisposed(SModel model)Deprecated.use model.getRepository!=null.static booleanisRegistered(SModel model)Deprecated.use model.getRepository!=nullstatic booleanisRoot(SNode n)Deprecated.SNode.getParent!=null mostly (if done in "user" code which operates with nodes inside models)static intnodesCount(SModel model)Deprecated.inline 
 - 
 
- 
- 
Method Detail
- 
isAncestor
@Deprecated public static boolean isAncestor(SNode ancestor, SNode node)
Deprecated.use .ancestors.contains() in smodel language 
- 
getChildren
@Deprecated public static List<SNode> getChildren(SNode node, boolean includeAttributes)
Deprecated.there is no full equivalent to this, use SNode.getChildren or node/../.children operations if possible 
- 
findParent
@Deprecated public static SNode findParent(SNode node, Condition<SNode> condition)
Deprecated.use node/../.ancestors.where 
- 
getProperties
@Deprecated public static Map<String,String> getProperties(SNode node)
Deprecated.rewrite to SProperty, don't use strings 
- 
getChildRoles
@Deprecated public static Set<String> getChildRoles(SNode n)
Deprecated.rewrite to SContainmentLink, don't use by-name roles, use SNode methodstodo rewrite the code using this 
- 
getReferences
@Deprecated public static List<SReference> getReferences(SNode n)
Deprecated.use SNode.getReferencestodo rewrite the code using this 
- 
getChildren
@Deprecated public static List<SNode> getChildren(SNode n)
Deprecated.use SNode.getChildrentodo rewrite the code using this 
- 
getReferenceRoles
@Deprecated public static Set<String> getReferenceRoles(SNode n)
Deprecated.use either SNode.getReference.select(it->it.role) or SNode.getConcept.getReferenceLinks depending on what you want to gettodo rewrite the code using this 
- 
isRoot
@Deprecated public static boolean isRoot(SNode n)
Deprecated.SNode.getParent!=null mostly (if done in "user" code which operates with nodes inside models)todo rewrite the code using this 
- 
getDebugText
@Deprecated public static String getDebugText(SNode node)
Deprecated.use SNode.getName, SNode.getModel or whatever info you really need.this is an utility method common to all nodes but needed only for our debug purposes, so we don't put it into SNode 
- 
getChildRoles
@Deprecated public static Set<SContainmentLink> getChildRoles(SNode n, boolean includeAttributeRoles)
Deprecated.use either SNode.getChildren.select(it->it.role) or SNode.getConcept.getContainmentLinks depending on what you want to get 
- 
getChild
@Deprecated public static SNode getChild(SNode node, SContainmentLink role)
Deprecated.use node/../.child or SNode.getChildren 
- 
getChild
@Deprecated public static SNode getChild(SNode node, String role)
Deprecated.rewrite using SContainmentLink, don't use by-string roles 
- 
getResolveInfo
@Deprecated public static String getResolveInfo(SNode n)
Deprecated.use SNodeUtil.getResolveInfo (note it does not return name in case of !isInstanceOf(IResolveInfo))This will be replaced by getting resolve info from a reference in a context containing it 
- 
copyProperties
@Deprecated public static void copyProperties(SNode from, SNode to)
Deprecated.use node/../.copy or copy manually 
- 
copyUserObjects
@Deprecated public static void copyUserObjects(SNode from, SNode to)
Deprecated.don't use user objects, store them separately 
- 
getTargetNodeSilently
@Deprecated public static SNode getTargetNodeSilently(SReference ref)
Deprecated.not supposed to be used not in MPS core. Use ref.getTargetNode 
- 
getModelStereotype
@Deprecated public static String getModelStereotype(SModel model)
Deprecated.inline 
- 
getModelLongName
@Deprecated public static String getModelLongName(SModel model)
Deprecated.inline 
- 
isModelDisposed
@Deprecated public static boolean isModelDisposed(SModel model)
Deprecated.use model.getRepository!=null. AP: I tried and it is not the same. Why? 
- 
nodesCount
@Deprecated public static int nodesCount(SModel model)
Deprecated.inline 
- 
isRegistered
@Deprecated public static boolean isRegistered(SModel model)
Deprecated.use model.getRepository!=null 
- 
isGeneratable
@Deprecated public static boolean isGeneratable(SModel model)
Deprecated.not supposed to be used outside of MPS core, inline if you use it 
 - 
 
 -