Skip to content

Package: Configurator

Configurator

nameinstructionbranchcomplexitylinemethod
Configurator()
M: 0 C: 17
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createResourceURI(Object)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eClass(Object)
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getEClass(Object)
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
resourceURI(Object)
M: 0 C: 2
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) 2014 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 contribution and API
10: *******************************************************************************/
11: package org.eclipse.emf.parsley.config;
12:
13: import org.eclipse.emf.common.util.URI;
14: import org.eclipse.emf.ecore.EClass;
15: import org.eclipse.emf.parsley.runtime.util.PolymorphicDispatcher;
16:
17: /**
18: * This configures several aspects of many components in EMF Parsley, such as,
19: * for instance, the Resource of a view, the EClass for the objects to
20: * be presented in a view, etc; the configuration will take place polymorphically
21: * according to the requestor, passed as a parameter of the methods.
22: *
23: * @author Lorenzo Bettini - Initial contribution and API
24: *
25: */
26: public class Configurator {
27:
28:         private PolymorphicDispatcher<URI> createResourceUriDispatcher = PolymorphicDispatcher
29:                         .createForSingleTarget("resourceURI", 1, 1, this);
30:
31:         private PolymorphicDispatcher<EClass> getEClassDispatcher = PolymorphicDispatcher
32:                         .createForSingleTarget("eClass", 1, 1, this);
33:
34:         /**
35:          * Returns the {@link URI} of the resource for the requestor
36:          * @param requestor
37:          * @return
38:          */
39:         public URI createResourceURI(Object requestor) {
40:                 return createResourceUriDispatcher.invoke(requestor);
41:         }
42:
43:         /**
44:          * Returns the {@link URI} of the resource for the requestor for any use the requestor may need it
45:          * @param requestor
46:          * @return
47:          */
48:         public URI resourceURI(Object requestor) {
49:                 return null;
50:         }
51:
52:         /**
53:          * Returns the {@link EClass} for the requestor for any use the requestor may need it
54:          * @param requestor
55:          * @return
56:          */
57:         public EClass getEClass(Object requestor) {
58:                 return getEClassDispatcher.invoke(requestor);
59:         }
60:
61:         /**
62:          * Returns the {@link EClass} for the requestor
63:          * @param requestor
64:          * @return
65:          */
66:         public EClass eClass(Object requestor) {
67:                 return null;
68:         }
69:
70: }