Skip to content

Package: ExampleAdapterFactory$1

ExampleAdapterFactory$1

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