Skip to content

Package: RulerepositorySwitch

RulerepositorySwitch

nameinstructionbranchcomplexitylinemethod
RulerepositorySwitch()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
caseRuleEntry(VRuleEntry)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseRuleRepository(VRuleRepository)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultCase(EObject)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
doSwitch(int, EObject)
M: 36 C: 0
0%
M: 7 C: 0
0%
M: 5 C: 0
0%
M: 12 C: 0
0%
M: 1 C: 0
0%
isSwitchFor(EPackage)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emfforms.spi.rulerepository.model.util;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.util.Switch;
19: import org.eclipse.emfforms.spi.rulerepository.model.VRuleEntry;
20: import org.eclipse.emfforms.spi.rulerepository.model.VRuleRepository;
21: import org.eclipse.emfforms.spi.rulerepository.model.VRulerepositoryPackage;
22:
23: /**
24: * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance
25: * hierarchy. It supports the call {@link #doSwitch(EObject) doSwitch(object)}
26: * to invoke the <code>caseXXX</code> method for each class of the model,
27: * starting with the actual class of the object and proceeding up the
28: * inheritance hierarchy until a non-null result is returned, which is the
29: * result of the switch. <!-- end-user-doc -->
30: *
31: * @see org.eclipse.emfforms.spi.rulerepository.model.VRulerepositoryPackage
32: * @generated
33: */
34: public class RulerepositorySwitch<T> extends Switch<T> {
35:         /**
36:          * The cached model package
37:          * <!-- begin-user-doc --> <!-- end-user-doc -->
38:          *
39:          * @generated
40:          */
41:         protected static VRulerepositoryPackage modelPackage;
42:
43:         /**
44:          * Creates an instance of the switch.
45:          * <!-- begin-user-doc --> <!--
46:          * end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         public RulerepositorySwitch() {
51:•                if (modelPackage == null) {
52:                         modelPackage = VRulerepositoryPackage.eINSTANCE;
53:                 }
54:         }
55:
56:         /**
57:          * Checks whether this is a switch for the given package. <!--
58:          * begin-user-doc --> <!-- end-user-doc -->
59:          *
60:          * @param ePackage
61:          * the package in question.
62:          * @return whether this is a switch for the given package.
63:          * @generated
64:          */
65:         @Override
66:         protected boolean isSwitchFor(EPackage ePackage) {
67:•                return ePackage == modelPackage;
68:         }
69:
70:         /**
71:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
72:          * result.
73:          * <!-- begin-user-doc --> <!--
74:          * end-user-doc -->
75:          *
76:          * @return the first non-null result returned by a <code>caseXXX</code> call.
77:          * @generated
78:          */
79:         @Override
80:         protected T doSwitch(int classifierID, EObject theEObject) {
81:•                switch (classifierID) {
82:                 case VRulerepositoryPackage.RULE_REPOSITORY: {
83:                         final VRuleRepository ruleRepository = (VRuleRepository) theEObject;
84:                         T result = caseRuleRepository(ruleRepository);
85:•                        if (result == null) {
86:                                 result = defaultCase(theEObject);
87:                         }
88:                         return result;
89:                 }
90:                 case VRulerepositoryPackage.RULE_ENTRY: {
91:                         final VRuleEntry ruleEntry = (VRuleEntry) theEObject;
92:                         T result = caseRuleEntry(ruleEntry);
93:•                        if (result == null) {
94:                                 result = defaultCase(theEObject);
95:                         }
96:                         return result;
97:                 }
98:                 default:
99:                         return defaultCase(theEObject);
100:                 }
101:         }
102:
103:         /**
104:          * Returns the result of interpreting the object as an instance of '<em>Rule Repository</em>'.
105:          * <!-- begin-user-doc --> This implementation
106:          * returns null; returning a non-null result will terminate the switch. <!--
107:          * end-user-doc -->
108:          *
109:          * @param object the target of the switch.
110:          * @return the result of interpreting the object as an instance of '<em>Rule Repository</em>'.
111:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
112:          * @generated
113:          */
114:         public T caseRuleRepository(VRuleRepository object) {
115:                 return null;
116:         }
117:
118:         /**
119:          * Returns the result of interpreting the object as an instance of '<em>Rule Entry</em>'.
120:          * <!-- begin-user-doc --> This implementation returns
121:          * null; returning a non-null result will terminate the switch. <!--
122:          * end-user-doc -->
123:          *
124:          * @param object the target of the switch.
125:          * @return the result of interpreting the object as an instance of '<em>Rule Entry</em>'.
126:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
127:          * @generated
128:          */
129:         public T caseRuleEntry(VRuleEntry object) {
130:                 return null;
131:         }
132:
133:         /**
134:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
135:          * <!-- begin-user-doc --> This implementation returns
136:          * null; returning a non-null result will terminate the switch, but this is
137:          * the last case anyway. <!-- end-user-doc -->
138:          *
139:          * @param object the target of the switch.
140:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
141:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
142:          * @generated
143:          */
144:         @Override
145:         public T defaultCase(EObject object) {
146:                 return null;
147:         }
148:
149: } // RulerepositorySwitch