Exemplo n.º 1
0
 public void association(String id, String name, String index) {
   assert myActualConcept != null;
   SReferenceLinkId linkId = myIdEncoder.parseAssociation(myActualConcept.getConceptId(), id);
   myActualConcept.addLink(linkId, name);
   myAssociations.put(index, MetaAdapterFactory.getReferenceLink(linkId, name));
   myMetaInfoProvider.setAssociationName(linkId, name);
 }
Exemplo n.º 2
0
 public void property(String id, String name, String index) {
   assert myActualConcept != null;
   SPropertyId propertyId = myIdEncoder.parsePropertyId(myActualConcept.getConceptId(), id);
   myActualConcept.addProperty(propertyId, name);
   myProperties.put(index, MetaAdapterFactory.getProperty(propertyId, name));
   myMetaInfoProvider.setPropertyName(propertyId, name);
 }
Exemplo n.º 3
0
 /**
  * This method shall be invoked only if {@link
  * #isImplementationWithStub(org.jetbrains.mps.openapi.language.SConcept)} == <code>true</code>
  */
 @NotNull
 public SConcept getStubConcept(@NotNull SConcept original) {
   final ConceptInfo ci = myMetaRegistry.find(original);
   assert ci.getKind() == ConceptKind.IMPLEMENTATION_WITH_STUB;
   final SConceptId stub = ci.getStubCounterpart();
   assert stub != null;
   return MetaAdapterFactory.getConcept(stub, ci.constructStubConceptName());
 }
Exemplo n.º 4
0
 public void aggregation(String id, String name, String index, boolean unordered) {
   assert myActualConcept != null;
   SContainmentLinkId linkId = myIdEncoder.parseAggregation(myActualConcept.getConceptId(), id);
   myActualConcept.addLink(linkId, name, unordered);
   myAggregations.put(index, MetaAdapterFactory.getContainmentLink(linkId, name));
   myMetaInfoProvider.setAggregationName(linkId, name);
   myMetaInfoProvider.setUnordered(linkId, unordered);
 }
Exemplo n.º 5
0
 // @param stub is optional
 public void withConcept(String id, String name, String index, String nodeInfo, String stub) {
   assert myActualLang != null;
   SConceptId conceptId = myIdEncoder.parseConceptId(myActualLang.getLanguageId(), id);
   myActualConcept = myMetaRegistry.registerConcept(conceptId, name);
   myActualConcept.parseImplementationKind(nodeInfo);
   myConcepts.put(index, MetaAdapterFactory.getConcept(conceptId, name));
   myMetaInfoProvider.setConceptName(conceptId, name);
   myMetaInfoProvider.setKind(conceptId, myActualConcept.getKind());
   myMetaInfoProvider.setScope(conceptId, myActualConcept.getScope());
   if (stub != null) {
     // XXX here we imply stub concepts live in the save language as their origin
     final SConceptId stubId = myIdEncoder.parseConceptId(myActualLang.getLanguageId(), stub);
     myActualConcept.setStubCounterpart(stubId);
     myMetaInfoProvider.setStubConcept(conceptId, stubId);
   }
 }