| /** |
| * |
| * Copyright (c) 2011, 2016 - 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.datainterchange; |
| |
| import javax.inject.Singleton; |
| |
| import org.eclipse.xtext.conversion.IValueConverterService; |
| import org.eclipse.xtext.generator.IGenerator; |
| import org.eclipse.xtext.generator.IOutputConfigurationProvider; |
| import org.eclipse.xtext.naming.IQualifiedNameProvider; |
| import org.eclipse.xtext.scoping.IScopeProvider; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.LazyJvmTypeLinker; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.SemanticLoadingResource; |
| import org.eclipse.osbp.dsl.xtext.lazyresolver.linker.LazyJvmTypeTransientValueService; |
| |
| import com.google.inject.Binder; |
| |
| import org.eclipse.osbp.xtext.datainterchange.jvmmodel.DataDSLModelGenerator; |
| import org.eclipse.osbp.xtext.datainterchange.scoping.DataDSLScopeProvider; |
| import org.eclipse.osbp.xtext.datainterchange.valueconverter.DataDSLQualifiedNameProvider; |
| import org.eclipse.osbp.xtext.datainterchange.valueconverter.DataDSLValueConverterService; |
| import org.eclipse.osbp.xtext.i18n.DSLOutputConfigurationProvider; |
| |
| /** |
| * Use this class to register components to be used at runtime / without the Equinox extension registry. |
| */ |
| public class DataDSLRuntimeModule extends org.eclipse.osbp.xtext.datainterchange.AbstractDataDSLRuntimeModule { |
| @Override |
| public Class<? extends IGenerator> bindIGenerator() { |
| return DataDSLModelGenerator.class; |
| } |
| |
| @Override |
| public Class<? extends IScopeProvider> bindIScopeProvider() { |
| return DataDSLScopeProvider.class; |
| } |
| |
| @Override |
| public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() { |
| return DataDSLQualifiedNameProvider.class; |
| } |
| |
| @Override |
| public Class<? extends IValueConverterService> bindIValueConverterService() { |
| return DataDSLValueConverterService.class; |
| } |
| |
| @Override |
| public void configure(Binder binder) { |
| super.configure(binder); |
| binder.bind(IOutputConfigurationProvider.class).to(DSLOutputConfigurationProvider.class).in(Singleton.class); |
| } |
| |
| public Class<? extends org.eclipse.xtext.resource.XtextResource> bindXtextResource() { |
| return SemanticLoadingResource.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.linking.ILinker> bindILinker() { |
| return LazyJvmTypeLinker.class; |
| } |
| |
| public Class<? extends org.eclipse.xtext.serializer.sequencer.ITransientValueService> bindSerializerITransientValueService() { |
| return LazyJvmTypeTransientValueService.class; |
| } |
| |
| } |