All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.xtext.XtextRuntimeModule Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
 * 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
 *
 *******************************************************************************/
package org.eclipse.xtext;

import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.formatting.IFormatter;
import org.eclipse.xtext.linking.ILinker;
import org.eclipse.xtext.linking.ILinkingDiagnosticMessageProvider;
import org.eclipse.xtext.linking.ILinkingService;
import org.eclipse.xtext.naming.IQualifiedNameConverter;
import org.eclipse.xtext.parser.antlr.IReferableElementsUnloader;
import org.eclipse.xtext.parsetree.reconstr.ITokenSerializer.ICrossReferenceSerializer;
import org.eclipse.xtext.parsetree.reconstr.ITransientValueService;
import org.eclipse.xtext.resource.DerivedStateAwareResourceDescriptionManager;
import org.eclipse.xtext.resource.IDefaultResourceDescriptionStrategy;
import org.eclipse.xtext.resource.IDerivedStateComputer;
import org.eclipse.xtext.resource.IFragmentProvider;
import org.eclipse.xtext.resource.ILocationInFileProvider;
import org.eclipse.xtext.resource.IResourceDescription;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.scoping.IGlobalScopeProvider;
import org.eclipse.xtext.scoping.IScopeProvider;
import org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider;
import org.eclipse.xtext.validation.IDiagnosticConverter;
import org.eclipse.xtext.xtext.GrammarResource;
import org.eclipse.xtext.xtext.XtextCrossReferenceSerializer;
import org.eclipse.xtext.xtext.XtextDiagnosticConverter;
import org.eclipse.xtext.xtext.XtextFormatter;
import org.eclipse.xtext.xtext.XtextFragmentProvider;
import org.eclipse.xtext.xtext.XtextLinkingDiagnosticMessageProvider;
import org.eclipse.xtext.xtext.XtextLinkingService;
import org.eclipse.xtext.xtext.XtextLocationInFileProvider;
import org.eclipse.xtext.xtext.XtextQualifiedNameConverter;
import org.eclipse.xtext.xtext.XtextReferableElementsUnloader;
import org.eclipse.xtext.xtext.XtextResourceDescriptionStrategy;
import org.eclipse.xtext.xtext.XtextScopeProvider;
import org.eclipse.xtext.xtext.XtextTransientValueService;
import org.eclipse.xtext.xtext.XtextTransientValueService2;
import org.eclipse.xtext.xtext.XtextValidator;
import org.eclipse.xtext.xtext.XtextValueConverters;
import org.eclipse.xtext.xtext.ecoreInference.IXtext2EcorePostProcessor;
import org.eclipse.xtext.xtext.ecoreInference.XtendXtext2EcorePostProcessor;

import com.google.inject.Binder;

/**
 * used to register components to be used at runtime.
 */
public class XtextRuntimeModule extends AbstractXtextRuntimeModule {

	@Override
	public void configure(Binder binder) {
		super.configure(binder);
		binder.bind(XtextValidator.class).asEagerSingleton();
	}

	@Override
	public Class bindILinkingService() {
		return XtextLinkingService.class;
	}

	@Override
	public Class bindIScopeProvider() {
		return XtextScopeProvider.class;
	}

	public Class bindICrossReferenceSerializer() {
		return XtextCrossReferenceSerializer.class;
	}

	@Override
	public Class bindILinker() {
		return org.eclipse.xtext.xtext.XtextLinker.class;
	}

	@Override
	public Class bindITransientValueService() {
		return XtextTransientValueService.class;
	}
	
	public Class bindITransientValueService2() {
		return XtextTransientValueService2.class;
	}

	@Override
	public Class bindIFormatter() {
		return XtextFormatter.class;
	}

	@Override
	public Class bindIValueConverterService() {
		return XtextValueConverters.class;
	}

	public Class bindIXtext2EcorePostProcessor() {
		return XtendXtext2EcorePostProcessor.class;
	}
	
	@Override
	public Class bindIFragmentProvider() {
		return XtextFragmentProvider.class;
	}
	
	public Class bindIReferableElementsUnloader() {
		return XtextReferableElementsUnloader.class;
	}
	
	public Class bindIQualifiedNameConverter() {
		return XtextQualifiedNameConverter.class;
	}
	
	public Class bindIDiagnosticConverter() {
		return XtextDiagnosticConverter.class;
	}
	
	public Class bindIDefaultResourceDescriptionStrategy() {
		return XtextResourceDescriptionStrategy.class;
	}
	
	public Class bindILinkingDiagnosticMessageProvider() {
		return XtextLinkingDiagnosticMessageProvider.class;
	}
	
	@Override
	public Class bindILocationInFileProvider() {
		return XtextLocationInFileProvider.class;
	}
	
	@Override
	public Class bindIGlobalScopeProvider() {
		return DefaultGlobalScopeProvider.class;
	}
	
	@Override
	public Class bindXtextResource() {
		return GrammarResource.class;
	}
	
	/**
	 * @since 2.2
	 */
	public Class bindIDerivedStateComputer() {
		return GrammarResource.LinkingTrigger.class;
	}
	
	/**
	 * @since 2.2
	 */
	public Class bindIResourceDescriptionManager() {
		return DerivedStateAwareResourceDescriptionManager.class;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy