use of org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl in project xtext-core by eclipse.
the class ResourceSetBasedResourceDescriptionsTest method createResource.
private Resource createResource() {
Resource resource = new EcoreResourceFactoryImpl().createResource(URI.createURI("test://uri" + nameCount++ + ".ecore"));
resourceSet.getResources().add(resource);
return resource;
}
use of org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl in project xtext-core by eclipse.
the class SrcSegmentsInUrisAreNotRemovedTests method setUp.
@Before
public void setUp() throws Exception {
globalStateMemento = GlobalRegistries.makeCopyOfGlobalState();
EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
EcoreResourceFactoryImpl resFactory = new EcoreResourceFactoryImpl();
set.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", resFactory);
aRes = (XMIResource) set.createResource(URI.createPlatformResourceURI("/myProject/main/src/some/package/a.ecore", true));
InputStream stream = new ByteArrayInputStream(aResContent.getBytes("US-ASCII"));
aRes.load(stream, set.getLoadOptions());
stream.close();
bRes = (XMIResource) set.createResource(URI.createPlatformResourceURI("/myProject/model/b.ecore", true));
stream = new ByteArrayInputStream(bResContent.getBytes("US-ASCII"));
bRes.load(stream, set.getLoadOptions());
stream.close();
}
use of org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl in project xtext-xtend by eclipse.
the class XtendStandaloneSetup method createInjectorAndDoEMFRegistration.
@Override
public Injector createInjectorAndDoEMFRegistration() {
boolean _containsKey = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore");
boolean _not = (!_containsKey);
if (_not) {
Map<String, Object> _extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
EcoreResourceFactoryImpl _ecoreResourceFactoryImpl = new EcoreResourceFactoryImpl();
_extensionToFactoryMap.put("ecore", _ecoreResourceFactoryImpl);
}
boolean _containsKey_1 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi");
boolean _not_1 = (!_containsKey_1);
if (_not_1) {
Map<String, Object> _extensionToFactoryMap_1 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl();
_extensionToFactoryMap_1.put("xmi", _xMIResourceFactoryImpl);
}
boolean _containsKey_2 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin");
boolean _not_2 = (!_containsKey_2);
if (_not_2) {
Map<String, Object> _extensionToFactoryMap_2 = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
BinaryGrammarResourceFactoryImpl _binaryGrammarResourceFactoryImpl = new BinaryGrammarResourceFactoryImpl();
_extensionToFactoryMap_2.put("xtextbin", _binaryGrammarResourceFactoryImpl);
}
boolean _containsKey_3 = EPackage.Registry.INSTANCE.containsKey(XtextPackage.eNS_URI);
boolean _not_3 = (!_containsKey_3);
if (_not_3) {
EPackage.Registry.INSTANCE.put(XtextPackage.eNS_URI, XtextPackage.eINSTANCE);
}
EPackage.Registry.INSTANCE.put(XtendPackage.eINSTANCE.getNsURI(), XtendPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(XbasePackage.eINSTANCE.getNsURI(), XbasePackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(XAnnotationsPackage.eINSTANCE.getNsURI(), XAnnotationsPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(TypesPackage.eINSTANCE.getNsURI(), TypesPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(XtypePackage.eINSTANCE.getNsURI(), XtypePackage.eINSTANCE);
Injector injector = this.createInjector();
this.register(injector);
return injector;
}
use of org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl in project xtext-core by eclipse.
the class Bug292245TestLanguageStandaloneSetupGenerated method createInjectorAndDoEMFRegistration.
@Override
public Injector createInjectorAndDoEMFRegistration() {
// register default ePackages
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xtextbin", new BinaryGrammarResourceFactoryImpl());
if (!EPackage.Registry.INSTANCE.containsKey(XtextPackage.eNS_URI))
EPackage.Registry.INSTANCE.put(XtextPackage.eNS_URI, XtextPackage.eINSTANCE);
Injector injector = createInjector();
register(injector);
return injector;
}
use of org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl in project xtext-core by eclipse.
the class XtextTerminalsTestLanguageStandaloneSetupGenerated method createInjectorAndDoEMFRegistration.
@Override
public Injector createInjectorAndDoEMFRegistration() {
// register default ePackages
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xtextbin", new BinaryGrammarResourceFactoryImpl());
if (!EPackage.Registry.INSTANCE.containsKey(XtextPackage.eNS_URI))
EPackage.Registry.INSTANCE.put(XtextPackage.eNS_URI, XtextPackage.eINSTANCE);
Injector injector = createInjector();
register(injector);
return injector;
}
Aggregations