Class SReferenceLinkAdapter
- java.lang.Object
 - 
- jetbrains.mps.smodel.adapter.structure.ref.SReferenceLinkAdapter
 
 
- 
- All Implemented Interfaces:
 SAbstractLink,SConceptFeature,SElement,SNamedElement,SReferenceLink
- Direct Known Subclasses:
 InvalidReferenceLink,SReferenceLinkAdapterById
public abstract class SReferenceLinkAdapter extends Object implements SReferenceLink
 
- 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedSReferenceLinkAdapter(String name) 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static SReferenceLinkAdapterdeserialize(String s)StringgetName()Presentation of the element for an end-user.abstract SAbstractConceptgetOwner()Retrieves concept where the feature has been declared.abstract ReferenceDescriptorgetReferenceDescriptor()StringgetRole()SScopegetScope(SNode referenceNode)Builds and returns a scope for this reference in the given context.SScopegetScope(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.SAbstractConceptgetTargetConcept()The concept for the nodes that this link points to.booleanisMultiple()Instance nodes can contain more than one target element.booleanisOptional()This link may contain no elements.booleanisReference()True for references, false for containment relationships.booleanisValid()abstract Stringserialize()StringtoString()- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.jetbrains.mps.openapi.language.SElement
getLanguage, getSourceNode 
- 
Methods inherited from interface org.jetbrains.mps.openapi.language.SReferenceLink
getDeclarationNode, getRoleName 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ID_DELIM
public static final String ID_DELIM
- See Also:
 - Constant Field Values
 
 
- 
myName
protected String myName
 
 - 
 
- 
Method Detail
- 
getName
@NotNull public String getName()
Description copied from interface:SNamedElementPresentation of the element for an end-user. Unlike identity, the name is deemed user-friendly and shall not be used for persistence.- Specified by:
 getNamein interfaceSNamedElement- Returns:
 - name of the meta element
 
 
- 
getReferenceDescriptor
@Nullable public abstract ReferenceDescriptor getReferenceDescriptor()
 
- 
isValid
public boolean isValid()
- Specified by:
 isValidin interfaceSConceptFeature
 
- 
getOwner
@NotNull public abstract SAbstractConcept getOwner()
Description copied from interface:SConceptFeatureRetrieves concept where the feature has been declared. Note, this concept doesn't necessarily match concept of the node when this feature has been obtained through node's meta-model accessors, instead, the feature may originate from one of concept's ancestors.- Specified by:
 getOwnerin interfaceSConceptFeature- Returns:
 - concept this feature is declared in
 
 
- 
getRole
public String getRole()
- Specified by:
 getRolein interfaceSAbstractLink
 
- 
isOptional
public boolean isOptional()
Description copied from interface:SAbstractLinkThis link may contain no elements.- Specified by:
 isOptionalin interfaceSAbstractLink
 
- 
getTargetConcept
@NotNull public SAbstractConcept getTargetConcept()
Description copied from interface:SAbstractLinkThe concept for the nodes that this link points to.- Specified by:
 getTargetConceptin interfaceSAbstractLink
 
- 
isReference
public boolean isReference()
Description copied from interface:SAbstractLinkTrue for references, false for containment relationships.- Specified by:
 isReferencein interfaceSAbstractLink
 
- 
isMultiple
public boolean isMultiple()
Description copied from interface:SReferenceLinkInstance nodes can contain more than one target element.- Specified by:
 isMultiplein interfaceSAbstractLink- Specified by:
 isMultiplein interfaceSReferenceLink
 
- 
getScope
public SScope getScope(SNode referenceNode)
Description copied from interface:SReferenceLinkBuilds and returns a scope for this reference in the given context.- Specified by:
 getScopein interfaceSReferenceLink- Parameters:
 referenceNode- node containing the reference, registered in the repository
 
- 
getScope
public SScope getScope(SNode contextNode, @Nullable SContainmentLink link, int index)
Description copied from interface:SReferenceLinkThis 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.- Specified by:
 getScopein interfaceSReferenceLink- Parameters:
 contextNode- the nearest ancestor of the node containing the referencelink- containment link in the contextNodeindex- position within the link
 
- 
serialize
public abstract String serialize()
 
- 
deserialize
public static SReferenceLinkAdapter deserialize(String s)
 
 - 
 
 -