Skip to content

Package: TestAdapterFactory$1

TestAdapterFactory$1

nameinstructionbranchcomplexitylinemethod
caseBase(Base)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseTest1(Test1)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseTest2(Test2)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseTest3(Test3)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseTest4(Test4)
M: 4 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: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
{...}
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2015 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: * Johannes Faltermeier - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.common.test.model.util;
15:
16: import org.eclipse.emf.common.notify.Adapter;
17: import org.eclipse.emf.common.notify.Notifier;
18: import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
19: import org.eclipse.emf.ecore.EObject;
20: import org.eclipse.emf.ecp.common.test.model.Base;
21: import org.eclipse.emf.ecp.common.test.model.Test1;
22: import org.eclipse.emf.ecp.common.test.model.Test2;
23: import org.eclipse.emf.ecp.common.test.model.Test3;
24: import org.eclipse.emf.ecp.common.test.model.Test4;
25: import org.eclipse.emf.ecp.common.test.model.TestPackage;
26:
27: /**
28: * <!-- begin-user-doc -->
29: * The <b>Adapter Factory</b> for the model.
30: * It provides an adapter <code>createXXX</code> method for each class of the model.
31: * <!-- end-user-doc -->
32: *
33: * @see org.eclipse.emf.ecp.common.test.model.TestPackage
34: * @generated
35: */
36: public class TestAdapterFactory extends AdapterFactoryImpl {
37:         /**
38:          * The cached model package.
39:          * <!-- begin-user-doc -->
40:          * <!-- end-user-doc -->
41:          *
42:          * @generated
43:          */
44:         protected static TestPackage modelPackage;
45:
46:         /**
47:          * Creates an instance of the adapter factory.
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @generated
52:          */
53:         public TestAdapterFactory() {
54:                 if (modelPackage == null) {
55:                         modelPackage = TestPackage.eINSTANCE;
56:                 }
57:         }
58:
59:         /**
60:          * Returns whether this factory is applicable for the type of the object.
61:          * <!-- begin-user-doc -->
62:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
63:          * object of the model.
64:          * <!-- end-user-doc -->
65:          *
66:          * @return whether this factory is applicable for the type of the object.
67:          * @generated
68:          */
69:         @Override
70:         public boolean isFactoryForType(Object object) {
71:                 if (object == modelPackage) {
72:                         return true;
73:                 }
74:                 if (object instanceof EObject) {
75:                         return ((EObject) object).eClass().getEPackage() == modelPackage;
76:                 }
77:                 return false;
78:         }
79:
80:         /**
81:          * The switch that delegates to the <code>createXXX</code> methods.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @generated
86:          */
87:         protected TestSwitch<Adapter> modelSwitch = new TestSwitch<Adapter>() {
88:                 @Override
89:                 public Adapter caseBase(Base object) {
90:                         return createBaseAdapter();
91:                 }
92:
93:                 @Override
94:                 public Adapter caseTest1(Test1 object) {
95:                         return createTest1Adapter();
96:                 }
97:
98:                 @Override
99:                 public Adapter caseTest2(Test2 object) {
100:                         return createTest2Adapter();
101:                 }
102:
103:                 @Override
104:                 public Adapter caseTest3(Test3 object) {
105:                         return createTest3Adapter();
106:                 }
107:
108:                 @Override
109:                 public Adapter caseTest4(Test4 object) {
110:                         return createTest4Adapter();
111:                 }
112:
113:                 @Override
114:                 public Adapter defaultCase(EObject object) {
115:                         return createEObjectAdapter();
116:                 }
117:         };
118:
119:         /**
120:          * Creates an adapter for the <code>target</code>.
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @param target the object to adapt.
125:          * @return the adapter for the <code>target</code>.
126:          * @generated
127:          */
128:         @Override
129:         public Adapter createAdapter(Notifier target) {
130:                 return modelSwitch.doSwitch((EObject) target);
131:         }
132:
133:         /**
134:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.test.model.Base <em>Base</em>}'.
135:          * <!-- begin-user-doc -->
136:          * This default implementation returns null so that we can easily ignore cases;
137:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
138:          * <!-- end-user-doc -->
139:          *
140:          * @return the new adapter.
141:          * @see org.eclipse.emf.ecp.common.test.model.Base
142:          * @generated
143:          */
144:         public Adapter createBaseAdapter() {
145:                 return null;
146:         }
147:
148:         /**
149:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.test.model.Test1 <em>Test1</em>}
150:          * '.
151:          * <!-- begin-user-doc -->
152:          * This default implementation returns null so that we can easily ignore cases;
153:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
154:          * <!-- end-user-doc -->
155:          *
156:          * @return the new adapter.
157:          * @see org.eclipse.emf.ecp.common.test.model.Test1
158:          * @generated
159:          */
160:         public Adapter createTest1Adapter() {
161:                 return null;
162:         }
163:
164:         /**
165:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.test.model.Test2 <em>Test2</em>}
166:          * '.
167:          * <!-- begin-user-doc -->
168:          * This default implementation returns null so that we can easily ignore cases;
169:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
170:          * <!-- end-user-doc -->
171:          *
172:          * @return the new adapter.
173:          * @see org.eclipse.emf.ecp.common.test.model.Test2
174:          * @generated
175:          */
176:         public Adapter createTest2Adapter() {
177:                 return null;
178:         }
179:
180:         /**
181:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.test.model.Test3 <em>Test3</em>}
182:          * '.
183:          * <!-- begin-user-doc -->
184:          * This default implementation returns null so that we can easily ignore cases;
185:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
186:          * <!-- end-user-doc -->
187:          *
188:          * @return the new adapter.
189:          * @see org.eclipse.emf.ecp.common.test.model.Test3
190:          * @generated
191:          */
192:         public Adapter createTest3Adapter() {
193:                 return null;
194:         }
195:
196:         /**
197:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.common.test.model.Test4 <em>Test4</em>}
198:          * '.
199:          * <!-- begin-user-doc -->
200:          * This default implementation returns null so that we can easily ignore cases;
201:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
202:          * <!-- end-user-doc -->
203:          *
204:          * @return the new adapter.
205:          * @see org.eclipse.emf.ecp.common.test.model.Test4
206:          * @generated
207:          */
208:         public Adapter createTest4Adapter() {
209:                 return null;
210:         }
211:
212:         /**
213:          * Creates a new adapter for the default case.
214:          * <!-- begin-user-doc -->
215:          * This default implementation returns null.
216:          * <!-- end-user-doc -->
217:          *
218:          * @return the new adapter.
219:          * @generated
220:          */
221:         public Adapter createEObjectAdapter() {
222:                 return null;
223:         }
224:
225: } // TestAdapterFactory