Package org.jetbrains.mps.openapi.model
Interface SReference
-
public interface SReference
Represents reference between nodes. Nodes are organized in AST with references going across the tree hierarchy and connecting nodes from different branches or trees.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description SReferenceLink
getLink()
Gets the associated Link - an abstract meta-definition for the referenceString
getRole()
Deprecated.SNode
getSourceNode()
Containing node for this reference.SNode
getTargetNode()
Resolves the target node in the containing repository.SNodeId
getTargetNodeId()
SNodeReference
getTargetNodeReference()
Builds and returns a reference to the target node.SModelReference
getTargetSModelReference()
The following two operations are defined only for references which can instantly respond to the request (e.g.
-
-
-
Method Detail
-
getRole
@Deprecated String getRole()
Deprecated.
-
getLink
SReferenceLink getLink()
Gets the associated Link - an abstract meta-definition for the reference
-
getSourceNode
SNode getSourceNode()
Containing node for this reference.
-
getTargetNode
SNode getTargetNode()
Resolves the target node in the containing repository. This operation is not guaranteed to be fast. It may require to traverse the repository, compute types for some nodes or execute code provided by the language-designer.- Returns:
- the node behind the reference, or null if something is broken in the repository
-
getTargetNodeReference
SNodeReference getTargetNodeReference()
Builds and returns a reference to the target node. Tries to avoid lengthy computations whenever possible. Does exactly the same as getTargetNode().getReference(), but probably faster.
-
getTargetSModelReference
@Nullable SModelReference getTargetSModelReference()
The following two operations are defined only for references which can instantly respond to the request (e.g. they store the target model reference and/or node id as a part of the reference).- Returns:
- target model reference (if available)
-
-