1 | package de.uka.sdq.pcm.transformations; |
2 | |
3 | import java.io.File; |
4 | import java.io.IOException; |
5 | |
6 | import org.eclipse.emf.common.util.URI; |
7 | import org.eclipse.emf.ecore.resource.Resource; |
8 | import org.eclipse.emf.ecore.resource.ResourceSet; |
9 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; |
10 | import org.eclipse.emf.mwe.core.ConfigurationException; |
11 | import org.eclipse.emf.mwe.core.WorkflowContext; |
12 | import org.eclipse.emf.mwe.core.issues.Issues; |
13 | import org.eclipse.emf.mwe.core.monitor.ProgressMonitor; |
14 | import org.eclipse.xtend.typesystem.emf.XmiReader; |
15 | |
16 | public class SameResourceSetXmiReader extends XmiReader { |
17 | |
18 | protected static ResourceSet rs = new ResourceSetImpl(); |
19 | |
20 | /*@Override |
21 | public void invoke(WorkflowContext model, ProgressMonitor monitor, |
22 | Issues issues) { |
23 | final File f = loadFile(issues); |
24 | final URI fileURI = URI.createFileURI(f.getAbsolutePath()); |
25 | |
26 | final Resource r = rs.createResource(fileURI); |
27 | try { |
28 | r.load(null); |
29 | } catch (final IOException e) { |
30 | throw new ConfigurationException(e); |
31 | } |
32 | |
33 | if (firstElementOnly) { |
34 | model.set(outputSlot, r.getContents().get(0)); |
35 | } else { |
36 | model.set(outputSlot, r.getContents()); |
37 | } |
38 | }*/ |
39 | |
40 | } |