Search in sources :

Example 1 with SubModel

use of org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel 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);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 2 with SubModel

use of org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_06.

@Test
public void testSerialization_06() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 3 with SubModel

use of org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel in project xtext-core by eclipse.

the class Bug299395Test method testSerialization_08.

@Test
public void testSerialization_08() {
    Model model = Bug299395Factory.eINSTANCE.createModel();
    SubModel subModel = Bug299395Factory.eINSTANCE.createSubModel();
    model.setSubModel(subModel);
    subModel.getStrings().add("s1");
    subModel.getStrings().add("s2");
    String serialized = getSerializer().serialize(model);
    assertEquals("subModel 1 2 \"s1\" 1 2 \"s2\"", serialized);
}
Also used : Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Test(org.junit.Test)

Example 4 with SubModel

use of org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel in project xtext-core by eclipse.

the class ModelImpl method basicSetSubModel.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetSubModel(SubModel newSubModel, NotificationChain msgs) {
    SubModel oldSubModel = subModel;
    subModel = newSubModel;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Bug299395Package.MODEL__SUB_MODEL, oldSubModel, newSubModel);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)

Example 5 with SubModel

use of org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel in project xtext-core by eclipse.

the class Bug299395TestLanguageSemanticSequencer 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 == Bug299395Package.eINSTANCE)
        switch(semanticObject.eClass().getClassifierID()) {
            case Bug299395Package.MODEL:
                sequence_Model(context, (Model) semanticObject);
                return;
            case Bug299395Package.SUB_MODEL:
                sequence_SubModel(context, (SubModel) semanticObject);
                return;
        }
    if (errorAcceptor != null)
        errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
Also used : ParserRule(org.eclipse.xtext.ParserRule) Action(org.eclipse.xtext.Action) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel) Model(org.eclipse.xtext.parsetree.reconstr.bug299395.Model) Parameter(org.eclipse.xtext.Parameter) EPackage(org.eclipse.emf.ecore.EPackage) SubModel(org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)

Aggregations

SubModel (org.eclipse.xtext.parsetree.reconstr.bug299395.SubModel)5 Model (org.eclipse.xtext.parsetree.reconstr.bug299395.Model)4 Test (org.junit.Test)3 EPackage (org.eclipse.emf.ecore.EPackage)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 Action (org.eclipse.xtext.Action)1 Parameter (org.eclipse.xtext.Parameter)1 ParserRule (org.eclipse.xtext.ParserRule)1