Package: ResourceSaveStrategy

ResourceSaveStrategy

nameinstructionbranchcomplexitylinemethod
ResourceSaveStrategy()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
save(Resource)
M: 0 C: 5
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2015 RCP Vision (http://www.rcp-vision.com) and others.
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: * Lorenzo Bettini - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.emf.parsley.resource;
12:
13: import java.io.IOException;
14:
15: import org.eclipse.emf.ecore.resource.Resource;
16:
17: import com.google.inject.Inject;
18:
19: /**
20: * Strategy for saving a {@link Resource}
21: *
22: * @author Lorenzo Bettini
23: *
24: */
25: public class ResourceSaveStrategy {
26:
27:         @Inject
28:         private ResourceManager resourceManager;
29:
30:         /**
31:          * Simply delegates saving to the {@link ResourceManager}.
32:          *
33:          * @param resource
34:          * @return
35:          * @throws IOException
36:          */
37:         public boolean save(Resource resource) throws IOException {
38:                 return resourceManager.save(resource);
39:         }
40: }