Package: EmfParsleyExtensionFactory

EmfParsleyExtensionFactory

nameinstructionbranchcomplexitylinemethod
EmfParsleyExtensionFactory()
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%
getInjector()
M: 0 C: 16
100%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 0 C: 3
100%
M: 0 C: 1
100%
getModule()
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) 2013 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:
12: package org.eclipse.emf.parsley;
13:
14: import static com.google.inject.Guice.createInjector;
15:
16: import org.eclipse.emf.parsley.runtime.ui.AbstractGuiceAwareExecutableExtensionFactory;
17:
18: import com.google.inject.Injector;
19:
20: /**
21: * Base class for executable extension factories, for example, for
22: * the ones generated by the DSL.
23: *
24: * @author Lorenzo Bettini
25: *
26: */
27: public class EmfParsleyExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory {
28:
29:         private Injector injector;
30:
31:         @Override
32:         protected Injector getInjector() throws Exception {
33:•                if (injector == null) {
34:                         injector = createInjector(getModule());
35:                 }
36:                 return injector;
37:         }
38:
39:         protected EmfParsleyGuiceModule getModule() throws Exception {
40:                 return new EmfParsleyGuiceModule(EmfParsleyActivator.getDefault());
41:         }
42:
43: }