Skip to content

Package: CustomAdapterFactory

CustomAdapterFactory

nameinstructionbranchcomplexitylinemethod
CustomAdapterFactory()
M: 0 C: 13
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createAdapter(Notifier)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createContainedElementAdapter()
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%
createControlAdapter()
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%
createCustomControlAdapter()
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%
createCustomDomainModelReferenceAdapter()
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%
createDomainModelReferenceAdapter()
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%
createEObjectAdapter()
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%
createElementAdapter()
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%
isFactoryForType(Object)
M: 2 C: 18
90%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 0 C: 5
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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.emf.ecp.view.spi.custom.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.view.spi.custom.model.VCustomControl;
21: import org.eclipse.emf.ecp.view.spi.custom.model.VCustomDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.custom.model.VCustomPackage;
23: import org.eclipse.emf.ecp.view.spi.model.VContainedElement;
24: import org.eclipse.emf.ecp.view.spi.model.VControl;
25: import org.eclipse.emf.ecp.view.spi.model.VDomainModelReference;
26: import org.eclipse.emf.ecp.view.spi.model.VElement;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * The <b>Adapter Factory</b> for the model.
31: * It provides an adapter <code>createXXX</code> method for each class of the model.
32: * <!-- end-user-doc -->
33: *
34: * @see org.eclipse.emf.ecp.view.spi.custom.model.VCustomPackage
35: * @generated
36: */
37: public class CustomAdapterFactory extends AdapterFactoryImpl {
38:         /**
39:          * The cached model package.
40:          * <!-- begin-user-doc -->
41:          * <!-- end-user-doc -->
42:          *
43:          * @generated
44:          */
45:         protected static VCustomPackage modelPackage;
46:
47:         /**
48:          * Creates an instance of the adapter factory.
49:          * <!-- begin-user-doc -->
50:          * <!-- end-user-doc -->
51:          *
52:          * @generated
53:          */
54:         public CustomAdapterFactory() {
55:•                if (modelPackage == null) {
56:                         modelPackage = VCustomPackage.eINSTANCE;
57:                 }
58:         }
59:
60:         /**
61:          * Returns whether this factory is applicable for the type of the object.
62:          * <!-- begin-user-doc -->
63:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
64:          * object of the model.
65:          * <!-- end-user-doc -->
66:          *
67:          * @return whether this factory is applicable for the type of the object.
68:          * @generated
69:          */
70:         @Override
71:         public boolean isFactoryForType(Object object) {
72:•                if (object == modelPackage) {
73:                         return true;
74:                 }
75:•                if (object instanceof EObject) {
76:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
77:                 }
78:                 return false;
79:         }
80:
81:         /**
82:          * The switch that delegates to the <code>createXXX</code> methods.
83:          * <!-- begin-user-doc -->
84:          * <!-- end-user-doc -->
85:          *
86:          * @generated
87:          */
88:         protected CustomSwitch<Adapter> modelSwitch = new CustomSwitch<Adapter>() {
89:                 @Override
90:                 public Adapter caseCustomControl(VCustomControl object) {
91:                         return createCustomControlAdapter();
92:                 }
93:
94:                 @Override
95:                 public Adapter caseCustomDomainModelReference(VCustomDomainModelReference object) {
96:                         return createCustomDomainModelReferenceAdapter();
97:                 }
98:
99:                 @Override
100:                 public Adapter caseElement(VElement object) {
101:                         return createElementAdapter();
102:                 }
103:
104:                 @Override
105:                 public Adapter caseContainedElement(VContainedElement object) {
106:                         return createContainedElementAdapter();
107:                 }
108:
109:                 @Override
110:                 public Adapter caseControl(VControl object) {
111:                         return createControlAdapter();
112:                 }
113:
114:                 @Override
115:                 public Adapter caseDomainModelReference(VDomainModelReference object) {
116:                         return createDomainModelReferenceAdapter();
117:                 }
118:
119:                 @Override
120:                 public Adapter defaultCase(EObject object) {
121:                         return createEObjectAdapter();
122:                 }
123:         };
124:
125:         /**
126:          * Creates an adapter for the <code>target</code>.
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @param target the object to adapt.
131:          * @return the adapter for the <code>target</code>.
132:          * @generated
133:          */
134:         @Override
135:         public Adapter createAdapter(Notifier target) {
136:                 return modelSwitch.doSwitch((EObject) target);
137:         }
138:
139:         /**
140:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.custom.model.VCustomControl
141:          * <em>Control</em>}'.
142:          * <!-- begin-user-doc -->
143:          * This default implementation returns null so that we can easily ignore cases;
144:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
145:          *
146:          * @since 1.3
147:          * <!-- end-user-doc -->
148:          *
149:          * @return the new adapter.
150:          * @see org.eclipse.emf.ecp.view.spi.custom.model.VCustomControl
151:          * @generated
152:          */
153:         public Adapter createCustomControlAdapter() {
154:                 return null;
155:         }
156:
157:         /**
158:          * Creates a new adapter for an object of class '
159:          * {@link org.eclipse.emf.ecp.view.spi.custom.model.VCustomDomainModelReference <em>Domain Model Reference</em>}'.
160:          * <!-- begin-user-doc -->
161:          * This default implementation returns null so that we can easily ignore cases;
162:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
163:          *
164:          * @since 1.3
165:          * <!-- end-user-doc -->
166:          *
167:          * @return the new adapter.
168:          * @see org.eclipse.emf.ecp.view.spi.custom.model.VCustomDomainModelReference
169:          * @generated
170:          */
171:         public Adapter createCustomDomainModelReferenceAdapter() {
172:                 return null;
173:         }
174:
175:         /**
176:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VDomainModelReference
177:          * <em>Domain Model Reference</em>}'.
178:          * <!-- begin-user-doc -->
179:          * This default implementation returns null so that we can easily ignore cases;
180:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
181:          * <!-- end-user-doc -->
182:          *
183:          * @return the new adapter.
184:          * @see org.eclipse.emf.ecp.view.spi.model.VDomainModelReference
185:          * @generated
186:          */
187:         public Adapter createDomainModelReferenceAdapter() {
188:                 return null;
189:         }
190:
191:         /**
192:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VElement
193:          * <em>Element</em>}'.
194:          * <!-- begin-user-doc -->
195:          * This default implementation returns null so that we can easily ignore cases;
196:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
197:          *
198:          * @since 1.3
199:          * <!-- end-user-doc -->
200:          *
201:          * @return the new adapter.
202:          * @see org.eclipse.emf.ecp.view.spi.model.VElement
203:          * @generated
204:          */
205:         public Adapter createElementAdapter() {
206:                 return null;
207:         }
208:
209:         /**
210:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VContainedElement
211:          * <em>Contained Element</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:          *
216:          * @since 1.3
217:          * <!-- end-user-doc -->
218:          *
219:          * @return the new adapter.
220:          * @see org.eclipse.emf.ecp.view.spi.model.VContainedElement
221:          * @generated
222:          */
223:         public Adapter createContainedElementAdapter() {
224:                 return null;
225:         }
226:
227:         /**
228:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VControl
229:          * <em>Control</em>}'.
230:          * <!-- begin-user-doc -->
231:          * This default implementation returns null so that we can easily ignore cases;
232:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
233:          *
234:          * @since 1.3
235:          * <!-- end-user-doc -->
236:          *
237:          * @return the new adapter.
238:          * @see org.eclipse.emf.ecp.view.spi.model.VControl
239:          * @generated
240:          */
241:         public Adapter createControlAdapter() {
242:                 return null;
243:         }
244:
245:         /**
246:          * Creates a new adapter for the default case.
247:          * <!-- begin-user-doc -->
248:          * This default implementation returns null.
249:          * <!-- end-user-doc -->
250:          *
251:          * @return the new adapter.
252:          * @generated
253:          */
254:         public Adapter createEObjectAdapter() {
255:                 return null;
256:         }
257:
258: } // CustomAdapterFactory