use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.
the class Bug302128TestLanguageSemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == Bug302128Package.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Bug302128Package.ELEMENT:
sequence_Element(context, (Element) semanticObject);
return;
case Bug302128Package.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.
the class Bug362902SemanticSequencer method sequence.
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == Bug362902Package.eINSTANCE)
switch(semanticObject.eClass().getClassifierID()) {
case Bug362902Package.GREETING:
sequence_Greeting(context, (Greeting) semanticObject);
return;
case Bug362902Package.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.
the class Bug299395Test method testSerialization_03.
@Test
public void testSerialization_03() {
Model model = Bug299395Factory.eINSTANCE.createModel();
model.getStrings().add("Foo");
model.getStrings().add("Bar");
model.getStrings().add("Zonk");
String serialized = getSerializer().serialize(model);
assertEquals("{ \"Foo\" } { \"Bar\" } { \"Zonk\" }", serialized);
}
use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.
the class Bug299395Test method testSerialization_07.
@Test
public void testSerialization_07() {
Model model = Bug299395Factory.eINSTANCE.createModel();
SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
model.setSubModel(subModel);
subModel.getStrings().add("s1");
String serialized = getSerializer().serialize(model);
assertEquals("subModel 1 2 \"s1\"", serialized);
}
use of org.hl7.fhir.dstu3.model in project xtext-core by eclipse.
the class Bug299395Test method testSerialization_05.
@Test
public void testSerialization_05() {
Model model = Bug299395Factory.eINSTANCE.createModel();
model.getStrings().add("Unused");
model.getKeys().add("Key1");
model.getValues().add("Value1");
model.getKeys().add("Key2");
model.getValues().add("Value2");
String serialized = getSerializer().serialize(model);
assertEquals("{ \"Unused\" } [ \"Key1\" \"Value1\" \"Key2\" \"Value2\" ]", serialized);
}
Aggregations