Class SAbstractConceptAdapter
- java.lang.Object
 - 
- jetbrains.mps.smodel.adapter.structure.SNamedElementAdapter
 - 
- jetbrains.mps.smodel.adapter.structure.concept.SAbstractConceptAdapter
 
 
 
- 
- All Implemented Interfaces:
 ConceptMetaInfoConverter,SAbstractConcept,SElement,SNamedElement
- Direct Known Subclasses:
 InvalidConcept,SConceptAdapter,SInterfaceConceptAdapter
public abstract class SAbstractConceptAdapter extends SNamedElementAdapter implements SAbstractConcept, ConceptMetaInfoConverter
Common ancestor of adapter classesSConceptAdapterandSInterfaceConceptAdapter. It serves as an adapter from ConceptDescriptor to SAbstractConcept and the base class for all the implementations of theSAbstractConcept. The common idea is that on every client request it looks for the properConceptDescriptorin the special registry and redirects the client request to it. So it has only an id (string or smth else) as its state. One calls the SAbstractConcept instance <\it>valid\it> if and only if itsConceptDescriptoris present (getConceptDescriptor()!= null). Whenever the descriptor is absent (the concept instance is NOT valid) the "fail-safe" behavior is provided: please look at each method individually to acknowledge the contract. NB: If a client of this API wants to distinguish the case when the concept is invalid, he/she needs to use the methodisValid(). (!) Currently a lot of "hacks" introduced to fix some common cases (e.g. not valid concept still is a subconcept of the BaseConcept). Also there is an editor issue when an instance of abstract concept (interface concept) might be created. (E.g. the methodisSubConceptOf(SAbstractConcept)works not as expected for such concepts) 
- 
- 
Field Summary
Fields Modifier and Type Field Description static StringID_DELIM- 
Fields inherited from class jetbrains.mps.smodel.adapter.structure.SNamedElementAdapter
myFqName 
 - 
 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedSAbstractConceptAdapter(String fqName) 
- 
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SContainmentLinkconvertAggregation(String role)SReferenceLinkconvertAssociation(String role)SPropertyconvertProperty(String propertyName)static SAbstractConceptdeserialize(String s)protected abstract SNodefindInModel(SModel structureModel)a helper method to get a declaration node for this concept in the case of the legacy concept resolving (by string id)StringgetConceptAlias()abstract ConceptDescriptorgetConceptDescriptor()Collection<SContainmentLink>getContainmentLinks()Returns all the links this concept has, including inherited There's no "specialized links" at the compiled language level, all links are "original"SNodegetDeclarationNode()Deprecated.protected NamedElementDescriptorgetDescriptor()StringgetHelpUrl()Collection<SProperty>getProperties()Returns all the properties this concept has, including inheritedCollection<SReferenceLink>getReferenceLinks()Returns all the references this concept has, including inheritedStringgetShortDescription()booleanhasLink(SContainmentLink l)booleanhasProperty(SProperty p)booleanhasReference(SReferenceLink r)booleanisAbstract()booleanisSubConceptOf(SAbstractConcept anotherConcept)Either implementing or extending the supplied conceptprotected abstract booleanisSubConceptOfSpecial(ConceptDescriptor thisDescriptor, ConceptDescriptor anotherDescriptor, SAbstractConcept anotherConcept)booleanisValid()Returns true if this concept is fully-functional.abstract Stringserialize()StringtoString()- 
Methods inherited from class jetbrains.mps.smodel.adapter.structure.SNamedElementAdapter
getName, getSourceNode, isBootstrap 
- 
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.SAbstractConcept
getLanguage, getName, getQualifiedName, getSourceNode 
 - 
 
 - 
 
- 
- 
Field Detail
- 
ID_DELIM
public static final String ID_DELIM
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
SAbstractConceptAdapter
protected SAbstractConceptAdapter(String fqName)
 
 - 
 
- 
Method Detail
- 
getConceptDescriptor
@Nullable public abstract ConceptDescriptor getConceptDescriptor()
- Returns:
 - the backing 
ConceptDescriptor 
 
- 
getDescriptor
protected final NamedElementDescriptor getDescriptor()
- Specified by:
 getDescriptorin classSNamedElementAdapter
 
- 
findInModel
protected abstract SNode findInModel(SModel structureModel)
a helper method to get a declaration node for this concept in the case of the legacy concept resolving (by string id) 
- 
getReferenceLinks
public Collection<SReferenceLink> getReferenceLinks()
Description copied from interface:SAbstractConceptReturns all the references this concept has, including inherited- Specified by:
 getReferenceLinksin interfaceSAbstractConcept
 
- 
hasReference
public boolean hasReference(SReferenceLink r)
 
- 
getContainmentLinks
public Collection<SContainmentLink> getContainmentLinks()
Description copied from interface:SAbstractConceptReturns all the links this concept has, including inherited There's no "specialized links" at the compiled language level, all links are "original"- Specified by:
 getContainmentLinksin interfaceSAbstractConcept
 
- 
hasLink
public boolean hasLink(SContainmentLink l)
 
- 
hasProperty
public boolean hasProperty(SProperty p)
 
- 
getProperties
public Collection<SProperty> getProperties()
Description copied from interface:SAbstractConceptReturns all the properties this concept has, including inherited- Specified by:
 getPropertiesin interfaceSAbstractConcept
 
- 
isSubConceptOf
public boolean isSubConceptOf(SAbstractConcept anotherConcept)
Description copied from interface:SAbstractConceptEither implementing or extending the supplied concept- Specified by:
 isSubConceptOfin interfaceSAbstractConcept- Parameters:
 anotherConcept- -- another SAbstractConcept- Returns:
 - true iff this concept is a subconcept of another concept. if one of the concepts is not valid then false is returned
 
 
- 
isSubConceptOfSpecial
protected abstract boolean isSubConceptOfSpecial(@NotNull ConceptDescriptor thisDescriptor, ConceptDescriptor anotherDescriptor, SAbstractConcept anotherConcept)
 
- 
isAbstract
public boolean isAbstract()
- Specified by:
 isAbstractin interfaceSAbstractConcept- Returns:
 truefor interfaces and abstract concepts.
 
- 
getDeclarationNode
@Nullable @Deprecated public SNode getDeclarationNode()
Deprecated.Description copied from interface:SAbstractConceptReturns the declaration node in case sources for this concept are present in IDE Will be removed after 3.4, use getSourceNode() instead- Specified by:
 getDeclarationNodein interfaceSAbstractConcept
 
- 
getConceptAlias
@NotNull public String getConceptAlias()
- Specified by:
 getConceptAliasin interfaceSAbstractConcept
 
- 
getShortDescription
@NotNull public String getShortDescription()
- Specified by:
 getShortDescriptionin interfaceSAbstractConcept
 
- 
getHelpUrl
@NotNull public String getHelpUrl()
- Specified by:
 getHelpUrlin interfaceSAbstractConcept
 
- 
isValid
public final boolean isValid()
Description copied from interface:SAbstractConceptReturns true if this concept is fully-functional. Typically, user code should not care about this Can return false, for example, if the containing language is absent- Specified by:
 isValidin interfaceSAbstractConcept- Returns:
 - true iff the underlying descriptor is present
 
 
- 
convertProperty
@NotNull public SProperty convertProperty(String propertyName)
- Specified by:
 convertPropertyin interfaceConceptMetaInfoConverter
 
- 
convertAssociation
@NotNull public SReferenceLink convertAssociation(String role)
- Specified by:
 convertAssociationin interfaceConceptMetaInfoConverter
 
- 
convertAggregation
@NotNull public SContainmentLink convertAggregation(String role)
- Specified by:
 convertAggregationin interfaceConceptMetaInfoConverter
 
- 
serialize
public abstract String serialize()
 
- 
deserialize
public static SAbstractConcept deserialize(String s)
 
 - 
 
 -