Package: ModelExportCompleteOCLEvaluationResultAction$1

ModelExportCompleteOCLEvaluationResultAction$1

nameinstructionbranchcomplexitylinemethod
export(String, OCLElement, IProgressMonitor)
M: 21 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
{...}
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2014 Obeo.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.ui.interpreter.completeocl.internal.action;
12:
13: import java.io.IOException;
14: import java.util.HashMap;
15:
16: import org.eclipse.acceleo.ui.interpreter.completeocl.IEvaluationExporter;
17: import org.eclipse.acceleo.ui.interpreter.completeocl.evaluationresult.OCLElement;
18: import org.eclipse.core.runtime.IProgressMonitor;
19: import org.eclipse.emf.common.util.URI;
20: import org.eclipse.emf.ecore.resource.Resource;
21: import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
22: import org.eclipse.ocl.pivot.utilities.OCL;
23: import org.eclipse.xtext.resource.XtextResource;
24:
25: /**
26: * The Model exporter.
27: *
28: * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
29: */
30: public class ModelExportCompleteOCLEvaluationResultAction extends AbstractExportCompleteOCLEvaluationResultAction {
31:
32:         /**
33:          * Constructor.
34:          *
35:          * @param resource
36:          * the xtext resource to evaluate.
37:          * @param target
38:          * the target resource.
39:          * @param metamodelManager
40:          * the meta model manager.
41:          */
42:         public ModelExportCompleteOCLEvaluationResultAction(XtextResource resource, Resource target, OCL ocl) {
43:                 super("Model EXPORT", resource, target, ocl, new IEvaluationExporter() {
44:                         public void export(String outputPath, OCLElement resultRoot, IProgressMonitor monitor) {
45:                                 Resource res = new XMIResourceImpl(URI.createFileURI(outputPath));
46:                                 res.getContents().add(resultRoot);
47:                                 try {
48:                                         res.save(new HashMap<String, Object>());
49:                                 } catch (IOException e) {
50:                                         e.printStackTrace();
51:                                 }
52:                         }
53:                 });
54:         }
55: }