org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory Java Examples

The following examples show how to use org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JavaSourceLanguageRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void configure() {
	bind(Resource.Factory.class).to(JavaResource.Factory.class);
	bind(IResourceValidator.class).toInstance(IResourceValidator.NULL);
	bind(IGenerator.class).to(IGenerator.NullGenerator.class);
	bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
	bind(IResourceServiceProvider.class).to(JavaResourceServiceProvider.class);
	bind(IContainer.Manager.class).to(SimpleResourceDescriptionsBasedContainerManager.class);
	bind(IResourceDescription.Manager.class).to(JavaResourceDescriptionManager.class);
	bind(IQualifiedNameProvider.class).to(JvmIdentifiableQualifiedNameProvider.class);
	bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("java");
	bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME))
			.toInstance("org.eclipse.xtext.java.Java");
	bind(IJvmTypeProvider.Factory.class).to(ClasspathTypeProviderFactory.class);
	bind(ClassLoader.class).toInstance(JavaSourceLanguageRuntimeModule.class.getClassLoader());
	bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.GenericUnloader.class);
	bind(IResourceDescriptionsProvider.class)
			.toInstance((ResourceSet rs) -> ChunkedResourceDescriptions.findInEmfObject(rs));
}
 
Example #2
Source File: NoJRESmokeTester.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void processFile(String data) throws Exception {
	XtextResourceSet resourceSet = new XtextResourceSet();
	NoOpClassLoader classLoader = new NoOpClassLoader();
	resourceSet.setClasspathURIContext(classLoader);
	ClasspathTypeProviderFactory factory = new ClasspathTypeProviderFactory(classLoader, typeResourceServices);
	factory.createTypeProvider(resourceSet);
	EObject parsed = parseHelperNoJRE.parse(data, resourceSet);
	EcoreUtil.resolveAll(parsed);
	checkNoErrorsInValidator(data, (XtextResource) parsed.eResource());
}
 
Example #3
Source File: NoJRESmokeTester.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void processFile(String data) throws Exception {
	XtextResourceSet resourceSet = new XtextResourceSet();
	NoOpClassLoader classLoader = new NoOpClassLoader();
	resourceSet.setClasspathURIContext(classLoader);
	ClasspathTypeProviderFactory factory = new ClasspathTypeProviderFactory(classLoader, typeResourceServices);
	factory.createTypeProvider(resourceSet);
	EObject parsed = parseHelperNoJRE.parse(data, resourceSet);
	EcoreUtil.resolveAll(parsed);
	checkNoErrorsInValidator(data, (XtextResource) parsed.eResource());
}
 
Example #4
Source File: NoJRESmokeTester.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void processFile(String data) throws Exception {
	XtextResourceSet resourceSet = new XtextResourceSet();
	NoOpClassLoader classLoader = new NoOpClassLoader();
	resourceSet.setClasspathURIContext(classLoader);
	ClasspathTypeProviderFactory factory = new ClasspathTypeProviderFactory(classLoader, typeResourceServices);
	factory.createTypeProvider(resourceSet);
	EObject parsed = parseHelperNoJRE.parse(data, resourceSet);
	EcoreUtil.resolveAll(parsed);
	checkNoErrorsInValidator(data, (XtextResource) parsed.eResource());
}
 
Example #5
Source File: NoJRESmokeTester.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void processFile(String data) throws Exception {
	XtextResourceSet resourceSet = new XtextResourceSet();
	NoOpClassLoader classLoader = new NoOpClassLoader();
	resourceSet.setClasspathURIContext(classLoader);
	ClasspathTypeProviderFactory factory = new ClasspathTypeProviderFactory(classLoader, typeResourceServices);
	factory.createTypeProvider(resourceSet);
	EObject parsed = parseHelperNoJRE.parse(data, resourceSet);
	EcoreUtil.resolveAll(parsed);
	checkNoErrorsInValidator(data, (XtextResource) parsed.eResource());
}
 
Example #6
Source File: ClasspathBasedConstructorScopeTest.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
	factory = new ClasspathTypeProviderFactory(getClass().getClassLoader(), null);
	resourceSet = new ResourceSetImpl();
	typeScope = new ClasspathBasedTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(), Predicates.<IEObjectDescription>alwaysTrue());
	constructorScope = new ClasspathBasedConstructorScope(typeScope);
}
 
Example #7
Source File: ClasspathBasedModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IJvmTypeProvider.Factory> bindIJvmTypeProvider$Factory() {
	return ClasspathTypeProviderFactory.class;
}
 
Example #8
Source File: XbaseInjectorProvider.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ClasspathTypeProviderFactory> bindClasspathTypeProviderFactory() {
	return CachingClasspathTypeProviderFactory.class;
}
 
Example #9
Source File: XbaseWithAnnotationsInjectorProvider.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ClasspathTypeProviderFactory> bindClasspathTypeProviderFactory() {
	return CachingClasspathTypeProviderFactory.class;
}
 
Example #10
Source File: ClasspathBasedTypeScopeProvider.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public void setTypeProviderFactory(ClasspathTypeProviderFactory typeProviderFactory) {
	this.typeProviderFactory = typeProviderFactory;
}
 
Example #11
Source File: ClasspathBasedTypeScopeProvider.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public ClasspathTypeProviderFactory getTypeProviderFactory() {
	return typeProviderFactory;
}
 
Example #12
Source File: DefaultCommonTypesRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IJvmTypeProvider.Factory> bindIJvmTypeProvider$Factory() {
	return ClasspathTypeProviderFactory.class;
}
 
Example #13
Source File: ClasspathBasedModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IJvmTypeProvider.Factory> bindIJvmTypeProvider$Factory() {
	return ClasspathTypeProviderFactory.class;
}
 
Example #14
Source File: XbaseInjectorProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ClasspathTypeProviderFactory> bindClasspathTypeProviderFactory() {
	return CachingClasspathTypeProviderFactory.class;
}
 
Example #15
Source File: ClasspathBasedTypeScopeTest.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
	factory = new ClasspathTypeProviderFactory(getClass().getClassLoader(), null);
	resourceSet = new ResourceSetImpl();
	typeScope = new ClasspathBasedTypeScope(factory.createTypeProvider(resourceSet), new IQualifiedNameConverter.DefaultImpl(),Predicates.<IEObjectDescription>alwaysTrue());
}
 
Example #16
Source File: RuntimeTestSetup.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ClasspathTypeProviderFactory> bindClasspathTypeProviderFactory() {
	return CachingClasspathTypeProviderFactory.class;
}
 
Example #17
Source File: RuntimeTestSetup.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends ClasspathTypeProviderFactory> bindClasspathTypeProviderFactory() {
	return CachingClasspathTypeProviderFactory.class;
}