Package jetbrains.mps.persistence
Interface MetaModelInfoProvider
- 
- All Known Implementing Classes:
 MetaModelInfoProvider.BaseMetaModelInfo,MetaModelInfoProvider.RegularMetaModelInfo,MetaModelInfoProvider.StuffedMetaModelInfo
public interface MetaModelInfoProviderPROVISIONAL API, DO NOT USE This class hides mechanism to access aspects of meta-model we need for persistence purposes. Generally, this information could be retrieved from SConcept/ConceptDescriptor and friends, however, there are two use-cases when we can't rely on general MPS mechanism: 1) Model merge, primarily (or only) merge driver (git-invoked conflict resolution tool). 2) Convert models to binary during build. In either case, we read model first, and then save, and need save to know (and keep) information we've read. The reasons not to use general MPS mechanism are: (a) We don't want to pay MPS start-up costs (b) Languages used in the models might not be available in classpath (Doesn't apply to (2) - we do know them during build) The idea is to fill this provider with information read, and use it from model write. This provider shall not survive single read/write pair for a given model. Although perhaps in the future we might utilize it to keep model-specificDebugRegistry, which is global at the moment. To certain extent, this class serves to overcome limitations of SConcept API, as it doesn't expose e.g. scope or kind. Once (and if) we decide to expose these from SConcept, there would be no need in this mediator. Perhaps, it's the right way to go? XXX revisit Note, this class replacesjetbrains.mps.persistence.ModelEnvironmentInfowhich was likely intended for the similar purpose, but is ugly and doesn't suite modern (v9-bis) persistence well. There's implementation for most use-cases,MetaModelInfoProvider.RegularMetaModelInfo, which merely delegates to appropriate general MPS facilities, and doesn't support change (attempt to change is no-op). IMPLEMENTATION NOTE: useMetaModelInfoProvider.BaseMetaModelInfoas base class, do not implement this interface directly. Instances are not thread-safe unless noted otherwise. All methods are allowed to returnnullto indicate provider knows nothing about attribute questioned. Setters arguments, except for id (i.e. name, concept kind, etc), may benullas well.- See Also:
 MetaModelInfoProvider.BaseMetaModelInfo,DebugRegistry,jetbrains.mps.persistence.ModelEnvironmentInfo
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMetaModelInfoProvider.BaseMetaModelInfoBase implementation, clients shall extend this class rather than implementMetaModelInfoProviderdirectly.static classMetaModelInfoProvider.MetaInfoLoadingOptionIndicates whether we intend to use model read without access to regular (MPS instance) meta info.static classMetaModelInfoProvider.RegularMetaModelInfoDefault implementation to use in general MPS scenarios.static classMetaModelInfoProvider.StuffedMetaModelInfoProvider which is filled with desired information. 
- 
Method Summary
 
 - 
 
- 
- 
Method Detail
- 
getLanguageName
String getLanguageName(SLanguageId lang)
 
- 
setLanguageName
void setLanguageName(SLanguageId lang, String name)
 
- 
getConceptName
String getConceptName(SConceptId concept)
- Returns:
 - FIXME qualified concept name at the moment, short name once we switch to short names in persistence
 
 
- 
setConceptName
void setConceptName(SConceptId concept, String name)
 
- 
getPropertyName
String getPropertyName(SPropertyId property)
 
- 
setPropertyName
void setPropertyName(SPropertyId property, String name)
 
- 
getAssociationName
String getAssociationName(SReferenceLinkId link)
 
- 
setAssociationName
void setAssociationName(SReferenceLinkId link, String name)
 
- 
getAggregationName
String getAggregationName(SContainmentLinkId link)
 
- 
setAggregationName
void setAggregationName(SContainmentLinkId link, String name)
 
- 
getKind
ConceptKind getKind(SConceptId concept)
 
- 
setKind
void setKind(SConceptId concept, ConceptKind kind)
 
- 
getScope
StaticScope getScope(SConceptId concept)
 
- 
setScope
void setScope(SConceptId concept, StaticScope scope)
 
- 
isUnordered
Boolean isUnordered(SContainmentLinkId link)
 
- 
setUnordered
void setUnordered(SContainmentLinkId link, boolean unordered)
 
- 
getStubConcept
SConceptId getStubConcept(SConceptId origin)
This method makes sense only for concepts withkind==ConceptKind.IMPLEMENTATION_WITH_STUB 
- 
setStubConcept
void setStubConcept(SConceptId origin, SConceptId stub)
 
 - 
 
 -