Package jetbrains.mps.scope
Class SimpleRoleScope
- java.lang.Object
 - 
- jetbrains.mps.scope.Scope
 - 
- jetbrains.mps.scope.SimpleRoleScope
 
 
 
- 
public abstract class SimpleRoleScope extends Scope
 
- 
- 
Constructor Summary
Constructors Constructor Description SimpleRoleScope(SNode node, SContainmentLink link)SimpleRoleScope(SNode node, SContainmentLink link, SAbstractConcept concept) 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SimpleRoleScopeforNamedElements(SNode node, SContainmentLink linkDeclaration)Iterable<SNode>getAvailableElements(String prefix)Returns all available elements in the scope.abstract StringgetName(SNode child)StringgetReferenceText(SNode contextNode, SNode node)Creates textual reference for scope element.SNoderesolve(SNode contextNode, String refText)Resolves element by reference text. 
 - 
 
- 
- 
Constructor Detail
- 
SimpleRoleScope
public SimpleRoleScope(SNode node, SContainmentLink link, SAbstractConcept concept)
 
- 
SimpleRoleScope
public SimpleRoleScope(SNode node, SContainmentLink link)
 
 - 
 
- 
Method Detail
- 
resolve
public SNode resolve(SNode contextNode, @NotNull String refText)
Description copied from class:ScopeResolves element by reference text. Invariant: getReferenceText(contextNode, resolve(contextNode, refText)) == refText 
- 
getAvailableElements
public Iterable<SNode> getAvailableElements(@Nullable String prefix)
Description copied from class:ScopeReturns all available elements in the scope.- Specified by:
 getAvailableElementsin classScope- Parameters:
 prefix- (if not null) filters out elements whose reference text doesn't start with prefix- Returns:
 - list of nodes in the scope
 
 
- 
getReferenceText
public String getReferenceText(SNode contextNode, SNode node)
Description copied from class:ScopeCreates textual reference for scope element. If element has no textual representation for the reference, returns null. Invariant: resolve(contextNode, getReferenceText(contextNode, node)) == node- Specified by:
 getReferenceTextin classScope- Parameters:
 contextNode- source node for the reference, or its nearest parent node (if source node is unavailable)node- element from the current scope (contains(node) == true)- Returns:
 - reference text for the node element in the current scope
 
 
- 
forNamedElements
public static SimpleRoleScope forNamedElements(SNode node, SContainmentLink linkDeclaration)
 
 - 
 
 -