use of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl in project iobserve-analysis by research-iobserve.
the class TestHelper method saveModel.
/**
* Saves a usage model to the drive.
*
* @param obj
* that is saved
* @param saveDestination
* directory to save to
* @throws IOException
* on error
*/
public static void saveModel(final EObject obj, final String saveDestination) throws IOException {
final Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
final Map<String, Object> map = reg.getExtensionToFactoryMap();
map.put("*", new XMIResourceFactoryImpl());
final ResourceSet resSet = new ResourceSetImpl();
resSet.setResourceFactoryRegistry(reg);
final Resource res = resSet.createResource(URI.createFileURI(saveDestination));
res.getContents().add(obj);
try {
res.save(null);
} catch (final IOException e) {
e.printStackTrace();
}
}
use of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl in project n4js by eclipse.
the class UnicodeStandaloneSetupGenerated 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.XMIResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class AbstractDataBaseBuilder method registerResourceFactoryForTypesLibrary.
private void registerResourceFactoryForTypesLibrary(ResourceSet resourceSet) {
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
resourceSet.getPackageRegistry().put(TypesLibraryPackage.eNS_URI, TypesLibraryPackage.eINSTANCE);
}
use of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class DatabaseCompareAbstractTestSuite method createResourceSet.
/**
* Creates a {@link ResourceSet} properly initialized for Database,
* Dbevolution, EMFCompare and XMI models.
*
* @return
*/
protected static ResourceSet createResourceSet() {
final ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(DatabasePackage.eNS_URI, DatabasePackage.eINSTANCE);
resourceSet.getPackageRegistry().put(DbevolutionPackage.eNS_URI, DbevolutionPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("dbevolution", new XMIResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("database", new DatabaseResourceFactoryImpl());
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("typeslibrary", new XMIResourceFactoryImpl());
return resourceSet;
}
use of org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl in project gemoc-studio by eclipse.
the class StandaloneSetup method doEMFRegistration.
public void doEMFRegistration() {
EPackage.Registry.INSTANCE.put(org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsm.fsm.FsmPackage.eNS_URI, org.eclipse.gemoc.sample.legacyfsm.xsfsm.xsfsm.fsm.FsmPackage.eINSTANCE);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getProtocolToFactoryMap().put("melange", new MelangeResourceFactoryImpl());
}
Aggregations