コード例 #1
0
ファイル: IdInfoReadHelper.java プロジェクト: yan96in/MPS
 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);
 }
コード例 #2
0
ファイル: IdInfoReadHelper.java プロジェクト: yan96in/MPS
 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);
 }
コード例 #3
0
ファイル: IdInfoReadHelper.java プロジェクト: yan96in/MPS
 /**
  * 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());
 }
コード例 #4
0
ファイル: IdInfoReadHelper.java プロジェクト: yan96in/MPS
 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);
 }
コード例 #5
0
ファイル: IdInfoReadHelper.java プロジェクト: yan96in/MPS
 // @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);
   }
 }