blob: f527812f8abf6912d9bba6bcff5c7059d90b99fe [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.dsl.entity.xtext;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.osbp.dsl.semantic.common.types.OSBPTypesPackage;
import org.eclipse.osbp.dsl.semantic.entity.OSBPEntityPackage;
import org.eclipse.osbp.dsl.semantic.entity.impl.EntityFactoryImplCustom;
import com.google.inject.Injector;
/**
* Initialization support for running Xtext languages without equinox extension
* registry
*/
public class EntityGrammarStandaloneSetup extends
EntityGrammarStandaloneSetupGenerated {
public static Injector doSetup() {
return new EntityGrammarStandaloneSetup()
.createInjectorAndDoEMFRegistration();
}
public Injector createInjectorAndDoEMFRegistration() {
org.eclipse.osbp.dsl.common.xtext.CommonGrammarStandaloneSetup.doSetup();
Injector injector = createInjector();
register(injector);
return injector;
}
public void register(Injector injector) {
if (!EPackage.Registry.INSTANCE
.containsKey("http://osbp.eclipse.org/entity/v1")) {
EPackage.Registry.INSTANCE.put(
"http://osbp.eclipse.org/dsl/entity/v1",
OSBPEntityPackage.eINSTANCE);
OSBPEntityPackage.eINSTANCE
.setEFactoryInstance(new EntityFactoryImplCustom());
}
if (!EPackage.Registry.INSTANCE
.containsKey("http://osbp.eclipse.org/dsl/common/types/v1")) {
EPackage.Registry.INSTANCE.put(
"http://osbp.eclipse.org/dsl/common/types/v1",
OSBPTypesPackage.eINSTANCE);
}
super.register(injector);
}
}