Interface SReferenceLink
-
- All Superinterfaces:
SAbstractLink
,SConceptFeature
,SElement
,SNamedElement
public interface SReferenceLink extends SAbstractLink
Reference links describe relations that do not follow the parent-child relationships pattern. Target nodes can physically lie anywhere in the AST (even in a different model).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SNode
getDeclarationNode()
Deprecated.String
getRoleName()
Deprecated.useSNamedElement.getName()
instead Returns a name of this reference Though in 3.2 the name is still used as id in some cases, it should be treated only as a user-friendly text representation.SScope
getScope(SNode referenceNode)
Builds and returns a scope for this reference in the given context.SScope
getScope(SNode contextNode, SContainmentLink link, int index)
This method allows to build a scope for the reference before its node has been registered in the repository.boolean
isMultiple()
Deprecated.-
Methods inherited from interface org.jetbrains.mps.openapi.language.SAbstractLink
getRole, getTargetConcept, isOptional, isReference
-
Methods inherited from interface org.jetbrains.mps.openapi.language.SConceptFeature
getOwner, isValid
-
Methods inherited from interface org.jetbrains.mps.openapi.language.SElement
getLanguage, getSourceNode
-
Methods inherited from interface org.jetbrains.mps.openapi.language.SNamedElement
getName
-
-
-
-
Method Detail
-
getRoleName
@Deprecated String getRoleName()
Deprecated.useSNamedElement.getName()
instead Returns a name of this reference Though in 3.2 the name is still used as id in some cases, it should be treated only as a user-friendly text representation.
-
isMultiple
@Deprecated boolean isMultiple()
Deprecated.Instance nodes can contain more than one target element.- Specified by:
isMultiple
in interfaceSAbstractLink
-
getDeclarationNode
@Nullable @Deprecated SNode getDeclarationNode()
Deprecated.
-
getScope
SScope getScope(SNode referenceNode)
Builds and returns a scope for this reference in the given context.- Parameters:
referenceNode
- node containing the reference, registered in the repository
-
getScope
SScope getScope(SNode contextNode, @Nullable SContainmentLink link, int index)
This method allows to build a scope for the reference before its node has been registered in the repository. In this case you must provide the nearest available ancestor node as a context node and the location within it where the reference will be placed. Example: while typing a new statement in the middle of a statement list, the context menu builds a scope before the statement has been created, in order to offer, among other things, all local variables defined up to this point in code. This is achieved by passing the statement list as a context node, "statement" link as the second parameter and the index of the statement within the statement list as the last parameter.- Parameters:
contextNode
- the nearest ancestor of the node containing the referencelink
- containment link in the contextNodeindex
- position within the link
-
-