-
Notifications
You must be signed in to change notification settings - Fork 317
/
RefactoringTestLanguage1SemanticSequencer.java
49 lines (44 loc) · 2.17 KB
/
RefactoringTestLanguage1SemanticSequencer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
* Copyright (c) 2010, 2024 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.xtext.common.types.xtext.ui.serializer;
import com.google.inject.Inject;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.common.types.xtext.ui.refactoringTestLanguage.Model;
import org.eclipse.xtext.common.types.xtext.ui.refactoringTestLanguage.RefactoringTestLanguagePackage;
import org.eclipse.xtext.common.types.xtext.ui.refactoringTestLanguage.ReferenceHolder;
import org.eclipse.xtext.common.types.xtext.ui.services.RefactoringTestLanguage1GrammarAccess;
import org.eclipse.xtext.serializer.ISerializationContext;
@SuppressWarnings("all")
public class RefactoringTestLanguage1SemanticSequencer extends RefactoringTestLanguageSemanticSequencer {
@Inject
private RefactoringTestLanguage1GrammarAccess grammarAccess;
@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 == RefactoringTestLanguagePackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case RefactoringTestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case RefactoringTestLanguagePackage.REFERENCE_HOLDER:
sequence_ReferenceHolder(context, (ReferenceHolder) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
}