Skip to content

Package: ExampleAdapterFactory$1

ExampleAdapterFactory$1

nameinstructionbranchcomplexitylinemethod
caseAbstractChild(AbstractChild)
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%
caseChild(Child)
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%
caseContainer(Container)
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%
caseEClassToAdditionMap(Map.Entry)
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%
caseIntermediate(Intermediate)
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%
caseIntermediateTarget(IntermediateTarget)
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%
caseRoot(Root)
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%
caseTarget(Target)
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-2014 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.view.mapping.test.example.util;
15:
16: import java.util.Map;
17:
18: import org.eclipse.emf.common.notify.Adapter;
19: import org.eclipse.emf.common.notify.Notifier;
20: import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
21: import org.eclipse.emf.ecore.EClass;
22: import org.eclipse.emf.ecore.EObject;
23: import org.eclipse.emf.ecp.view.mapping.test.example.AbstractChild;
24: import org.eclipse.emf.ecp.view.mapping.test.example.Child;
25: import org.eclipse.emf.ecp.view.mapping.test.example.Container;
26: import org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage;
27: import org.eclipse.emf.ecp.view.mapping.test.example.Intermediate;
28: import org.eclipse.emf.ecp.view.mapping.test.example.IntermediateTarget;
29: import org.eclipse.emf.ecp.view.mapping.test.example.Root;
30: import org.eclipse.emf.ecp.view.mapping.test.example.Target;
31:
32: /**
33: * <!-- begin-user-doc -->
34: * The <b>Adapter Factory</b> for the model.
35: * It provides an adapter <code>createXXX</code> method for each class of the model.
36: * <!-- end-user-doc -->
37: *
38: * @see org.eclipse.emf.ecp.view.mapping.test.example.ExamplePackage
39: * @generated
40: */
41: public class ExampleAdapterFactory extends AdapterFactoryImpl {
42:         /**
43:          * The cached model package.
44:          * <!-- begin-user-doc -->
45:          * <!-- end-user-doc -->
46:          *
47:          * @generated
48:          */
49:         protected static ExamplePackage modelPackage;
50:
51:         /**
52:          * Creates an instance of the adapter factory.
53:          * <!-- begin-user-doc -->
54:          * <!-- end-user-doc -->
55:          *
56:          * @generated
57:          */
58:         public ExampleAdapterFactory() {
59:                 if (modelPackage == null) {
60:                         modelPackage = ExamplePackage.eINSTANCE;
61:                 }
62:         }
63:
64:         /**
65:          * Returns whether this factory is applicable for the type of the object.
66:          * <!-- begin-user-doc -->
67:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
68:          * object of the model.
69:          * <!-- end-user-doc -->
70:          *
71:          * @return whether this factory is applicable for the type of the object.
72:          * @generated
73:          */
74:         @Override
75:         public boolean isFactoryForType(Object object) {
76:                 if (object == modelPackage) {
77:                         return true;
78:                 }
79:                 if (object instanceof EObject) {
80:                         return ((EObject) object).eClass().getEPackage() == modelPackage;
81:                 }
82:                 return false;
83:         }
84:
85:         /**
86:          * The switch that delegates to the <code>createXXX</code> methods.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @generated
91:          */
92:         protected ExampleSwitch<Adapter> modelSwitch = new ExampleSwitch<Adapter>() {
93:                 @Override
94:                 public Adapter caseRoot(Root object) {
95:                         return createRootAdapter();
96:                 }
97:
98:                 @Override
99:                 public Adapter caseIntermediate(Intermediate object) {
100:                         return createIntermediateAdapter();
101:                 }
102:
103:                 @Override
104:                 public Adapter caseContainer(Container object) {
105:                         return createContainerAdapter();
106:                 }
107:
108:                 @Override
109:                 public Adapter caseAbstractChild(AbstractChild object) {
110:                         return createAbstractChildAdapter();
111:                 }
112:
113:                 @Override
114:                 public Adapter caseChild(Child object) {
115:                         return createChildAdapter();
116:                 }
117:
118:                 @Override
119:                 public Adapter caseIntermediateTarget(IntermediateTarget object) {
120:                         return createIntermediateTargetAdapter();
121:                 }
122:
123:                 @Override
124:                 public Adapter caseTarget(Target object) {
125:                         return createTargetAdapter();
126:                 }
127:
128:                 @Override
129:                 public Adapter caseEClassToAdditionMap(Map.Entry<EClass, AbstractChild> object) {
130:                         return createEClassToAdditionMapAdapter();
131:                 }
132:
133:                 @Override
134:                 public Adapter defaultCase(EObject object) {
135:                         return createEObjectAdapter();
136:                 }
137:         };
138:
139:         /**
140:          * Creates an adapter for the <code>target</code>.
141:          * <!-- begin-user-doc -->
142:          * <!-- end-user-doc -->
143:          *
144:          * @param target the object to adapt.
145:          * @return the adapter for the <code>target</code>.
146:          * @generated
147:          */
148:         @Override
149:         public Adapter createAdapter(Notifier target) {
150:                 return modelSwitch.doSwitch((EObject) target);
151:         }
152:
153:         /**
154:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.Root
155:          * <em>Root</em>}'.
156:          * <!-- begin-user-doc -->
157:          * This default implementation returns null so that we can easily ignore cases;
158:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
159:          * <!-- end-user-doc -->
160:          *
161:          * @return the new adapter.
162:          * @see org.eclipse.emf.ecp.view.mapping.test.example.Root
163:          * @generated
164:          */
165:         public Adapter createRootAdapter() {
166:                 return null;
167:         }
168:
169:         /**
170:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.Intermediate
171:          * <em>Intermediate</em>}'.
172:          * <!-- begin-user-doc -->
173:          * This default implementation returns null so that we can easily ignore cases;
174:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
175:          * <!-- end-user-doc -->
176:          *
177:          * @return the new adapter.
178:          * @see org.eclipse.emf.ecp.view.mapping.test.example.Intermediate
179:          * @generated
180:          */
181:         public Adapter createIntermediateAdapter() {
182:                 return null;
183:         }
184:
185:         /**
186:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.Container
187:          * <em>Container</em>}'.
188:          * <!-- begin-user-doc -->
189:          * This default implementation returns null so that we can easily ignore cases;
190:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
191:          * <!-- end-user-doc -->
192:          *
193:          * @return the new adapter.
194:          * @see org.eclipse.emf.ecp.view.mapping.test.example.Container
195:          * @generated
196:          */
197:         public Adapter createContainerAdapter() {
198:                 return null;
199:         }
200:
201:         /**
202:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.AbstractChild
203:          * <em>Abstract Child</em>}'.
204:          * <!-- begin-user-doc -->
205:          * This default implementation returns null so that we can easily ignore cases;
206:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
207:          * <!-- end-user-doc -->
208:          *
209:          * @return the new adapter.
210:          * @see org.eclipse.emf.ecp.view.mapping.test.example.AbstractChild
211:          * @generated
212:          */
213:         public Adapter createAbstractChildAdapter() {
214:                 return null;
215:         }
216:
217:         /**
218:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.Child
219:          * <em>Child</em>}'.
220:          * <!-- begin-user-doc -->
221:          * This default implementation returns null so that we can easily ignore cases;
222:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
223:          * <!-- end-user-doc -->
224:          *
225:          * @return the new adapter.
226:          * @see org.eclipse.emf.ecp.view.mapping.test.example.Child
227:          * @generated
228:          */
229:         public Adapter createChildAdapter() {
230:                 return null;
231:         }
232:
233:         /**
234:          * Creates a new adapter for an object of class '
235:          * {@link org.eclipse.emf.ecp.view.mapping.test.example.IntermediateTarget <em>Intermediate Target</em>}'.
236:          * <!-- begin-user-doc -->
237:          * This default implementation returns null so that we can easily ignore cases;
238:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
239:          * <!-- end-user-doc -->
240:          *
241:          * @return the new adapter.
242:          * @see org.eclipse.emf.ecp.view.mapping.test.example.IntermediateTarget
243:          * @generated
244:          */
245:         public Adapter createIntermediateTargetAdapter() {
246:                 return null;
247:         }
248:
249:         /**
250:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.mapping.test.example.Target
251:          * <em>Target</em>}'.
252:          * <!-- begin-user-doc -->
253:          * This default implementation returns null so that we can easily ignore cases;
254:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
255:          * <!-- end-user-doc -->
256:          *
257:          * @return the new adapter.
258:          * @see org.eclipse.emf.ecp.view.mapping.test.example.Target
259:          * @generated
260:          */
261:         public Adapter createTargetAdapter() {
262:                 return null;
263:         }
264:
265:         /**
266:          * Creates a new adapter for an object of class '{@link java.util.Map.Entry <em>EClass To Addition Map</em>}'.
267:          * <!-- begin-user-doc -->
268:          * This default implementation returns null so that we can easily ignore cases;
269:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
270:          * <!-- end-user-doc -->
271:          *
272:          * @return the new adapter.
273:          * @see java.util.Map.Entry
274:          * @generated
275:          */
276:         public Adapter createEClassToAdditionMapAdapter() {
277:                 return null;
278:         }
279:
280:         /**
281:          * Creates a new adapter for the default case.
282:          * <!-- begin-user-doc -->
283:          * This default implementation returns null.
284:          * <!-- end-user-doc -->
285:          *
286:          * @return the new adapter.
287:          * @generated
288:          */
289:         public Adapter createEObjectAdapter() {
290:                 return null;
291:         }
292:
293: } // ExampleAdapterFactory