Package org.jetbrains.mps.openapi.model
Class SNodeUtil
- java.lang.Object
- 
- org.jetbrains.mps.openapi.model.SNodeUtil
 
- 
 public class SNodeUtil extends Object This class implement complex operations on the node structure. Unlike the SNode implementations, which may focus on their specific needs, this class should consider all cases, e.g. replacing a node with a root node from another model
- 
- 
Constructor SummaryConstructors Constructor Description SNodeUtil()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static Iterable<SNode>getDescendants(Iterable<SNode> roots)Iterate over subtrees of each node in a given sequence of 'root' nodesstatic Iterable<SNode>getDescendants(SModel model)Iterates over all nodes in the given model.static Iterable<SNode>getDescendants(SNode node)Iterates over the subtree starting at the given node.static Iterable<SNode>getDescendants(SNode node, Condition<SNode> condition, boolean includeFirst)Iterates over the subtree starting at the given node.static booleanisAccessible(SNode node, SRepository inRepository)Returns whether the given node belongs to the repository (or to one of its parent repositories).static booleanisInstanceOf(SNode node, SAbstractConcept concept)static SNodereplaceWithAnother(SNode node, SNode replacer)Replaces a node with another, preserving attributes
 
- 
- 
- 
Method Detail- 
isAccessiblepublic static boolean isAccessible(@NotNull SNode node, @NotNull SRepository inRepository) Returns whether the given node belongs to the repository (or to one of its parent repositories).
 - 
isInstanceOfpublic static boolean isInstanceOf(@Nullable SNode node, @NotNull SAbstractConcept concept) 
 - 
replaceWithAnotherpublic static SNode replaceWithAnother(@NotNull SNode node, SNode replacer) Replaces a node with another, preserving attributes
 - 
getDescendantspublic static Iterable<SNode> getDescendants(@NotNull SModel model) Iterates over all nodes in the given model.
 - 
getDescendants@NotNull public static Iterable<SNode> getDescendants(@NotNull SNode node) Iterates over the subtree starting at the given node.
 - 
getDescendants@NotNull public static Iterable<SNode> getDescendants(@NotNull SNode node, @Nullable Condition<SNode> condition, boolean includeFirst) Iterates over the subtree starting at the given node.- Parameters:
- condition- if not null, acts like a filter
- includeFirst- false to skip the root node from the returned sequence
 
 
- 
 
-