use of org.obeonetwork.dsl.typeslibrary.util.TypesLibraryResourceFactoryImpl in project InformationSystem by ObeoNetwork.
the class TestReverse method loadModel.
private static DataBase loadModel(String databaseTestPluginRelativePath, String typesLibraryPathmapUri) {
URI uri = URI.createFileURI(databaseTestPluginRelativePath);
DatabaseResourceFactoryImpl databaseResourceFactory = new DatabaseResourceFactoryImpl();
Resource resourceDatabase = databaseResourceFactory.createResource(uri);
TypesLibraryResourceFactoryImpl typesLibraryresourceFactory = new TypesLibraryResourceFactoryImpl();
Resource typeResource = typesLibraryresourceFactory.createResource(URI.createURI(typesLibraryPathmapUri));
ResourceSet rs = new ResourceSetImpl();
rs.getResources().add(resourceDatabase);
rs.getResources().add(typeResource);
try {
Map options = rs.getLoadOptions();
options.put(DatabasePackage.eINSTANCE.getNsURI(), DatabasePackage.eINSTANCE);
options.put(TypesLibraryPackage.eINSTANCE.getNsURI(), TypesLibraryPackage.eINSTANCE);
resourceDatabase.load(options);
} catch (Exception ex) {
ex.printStackTrace();
}
return (DataBase) resourceDatabase.getContents().get(0);
}
Aggregations