use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class ConcreteTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("concretetestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("concretetestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://holla")) {
EPackage.Registry.INSTANCE.put("http://holla", FooPackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class Bug419429StandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("bug419429", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug419429", serviceProvider);
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class EncodingTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("encodingtestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("encodingtestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2010/tmf/xtext/parser/EncodingTest")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2010/tmf/xtext/parser/EncodingTest", EncodingTestPackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class EpatchTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("epatchtestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("epatchtestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/tmf/xtext/EpatchTestLanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/tmf/xtext/EpatchTestLanguage", EpatchTestLanguagePackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class AbstractResourceServiceProviderDescriptor method get.
@Override
public IResourceServiceProvider get(URI uri, String contentType) {
Object extension = getExtension();
if (extension instanceof IResourceServiceProvider.Provider) {
IResourceServiceProvider.Provider provider = ((IResourceServiceProvider.Provider) extension);
IResourceServiceProvider result = provider.get(uri, contentType);
return result;
} else if (extension instanceof IResourceServiceProvider) {
return (IResourceServiceProvider) extension;
}
String type = extension == null ? "null" : extension.getClass().getName();
String valid = IResourceServiceProvider.class + " or " + IResourceServiceProvider.Provider.class;
String suffix = "";
String contributor = getContributor();
if (contributor != null) {
suffix += " contributed by " + contributor;
}
throw new ClassCastException("The type " + type + " is not a valid " + valid + suffix);
}
Aggregations