package testWrappedType.structure;
/*Generated by MPS */
import jetbrains.mps.smodel.runtime.BaseStructureAspectDescriptor;
import jetbrains.mps.smodel.runtime.ConceptDescriptor;
import java.util.Collection;
import java.util.Arrays;
import org.jetbrains.annotations.Nullable;
import jetbrains.mps.smodel.adapter.ids.SConceptId;
import org.jetbrains.mps.openapi.language.SAbstractConcept;
import jetbrains.mps.smodel.runtime.impl.ConceptDescriptorBuilder2;
import jetbrains.mps.smodel.runtime.ConceptKind;
import jetbrains.mps.smodel.runtime.StaticScope;
public class StructureAspectDescriptor extends BaseStructureAspectDescriptor {
/*package*/ final ConceptDescriptor myConceptTypeWithUnits = createDescriptorForTypeWithUnits();
/*package*/ final ConceptDescriptor myConceptWrapperType = createDescriptorForWrapperType();
private final LanguageConceptSwitch myConceptIndex;
public StructureAspectDescriptor() {
myConceptIndex = new LanguageConceptSwitch();
}
@Override
public Collection<ConceptDescriptor> getDescriptors() {
return Arrays.asList(myConceptTypeWithUnits, myConceptWrapperType);
}
@Override
@Nullable
public ConceptDescriptor getDescriptor(SConceptId id) {
switch (myConceptIndex.index(id)) {
case LanguageConceptSwitch.TypeWithUnits:
return myConceptTypeWithUnits;
case LanguageConceptSwitch.WrapperType:
return myConceptWrapperType;
default:
return null;
}
}
/*package*/ int internalIndex(SAbstractConcept c) {
return myConceptIndex.index(c);
}
private static ConceptDescriptor createDescriptorForTypeWithUnits() {
ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("testWrappedType", "TypeWithUnits", 0x9290638e635b4ec6L, 0xbcad945ecb88a928L, 0x116157dc0d8c532bL);
b.class_(false, false, false);
b.super_("testWrappedType.structure.WrapperType", 0x9290638e635b4ec6L, 0xbcad945ecb88a928L, 0x116157dc0d8c52bcL);
b.origin("r:58c474dc-af49-44e4-a2d1-3b8edbb18985(testWrappedType.structure)/1252378774017430315");
b.prop("unit", 0x116157dc0d8c532cL, "1252378774017430316");
b.kind(ConceptKind.INTERFACE, StaticScope.GLOBAL);
return b.create();
}
private static ConceptDescriptor createDescriptorForWrapperType() {
ConceptDescriptorBuilder2 b = new ConceptDescriptorBuilder2("testWrappedType", "WrapperType", 0x9290638e635b4ec6L, 0xbcad945ecb88a928L, 0x116157dc0d8c52bcL);
b.class_(false, true, false);
b.super_("jetbrains.mps.baseLanguage.structure.Type", 0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL);
b.origin("r:58c474dc-af49-44e4-a2d1-3b8edbb18985(testWrappedType.structure)/1252378774017430204");
b.aggregate("wrapped", 0x116157dc0d8c52bdL).target(0xf3061a5392264cc5L, 0xa443f952ceaf5816L, 0xf8c37f506dL).optional(false).ordered(true).multiple(false).origin("1252378774017430205").done();
b.kind(ConceptKind.INTERFACE, StaticScope.GLOBAL);
return b.create();
}
}