/
Util.java
40 lines (32 loc) · 1.18 KB
/
Util.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package org.eclipse.efbt.cocamo.smcubes.query.core;
import java.io.File;
import org.eclipse.efbt.cocamo.smcubes.model.smcubes_model.SmcubesModel;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
/**
* This class is responsible for getting the default BIRD model associated
* with any object
*
* @author Neil Mackenzie
*
*/
public class Util {
/**
* Tet the default BIRD model associated with any object. This relies on
* the file layout convention being follwoed correcty.
*
* @param o
* @return
*/
public static SmcubesModel getDefaultBirdModel(EObject o) {
/**ResourceSet rs = o.eResource().getResourceSet();
String birdModelXMLFile = o.eResource().getURI().trimSegments(1)
+ "/smcubes_model.smcubes_model";
File file = new File(birdModelXMLFile);
URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()) : URI.createURI(birdModelXMLFile);
Resource resource = rs.getResource(uri, true);*/
return (SmcubesModel) o.eResource().getContents().get(1);
}
}