Skip to content

Package: TestDataAdapterFactory

TestDataAdapterFactory

nameinstructionbranchcomplexitylinemethod
TestDataAdapterFactory()
M: 13 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createAdapter(Notifier)
M: 7 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%
createTestDataAdapter()
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: 20 C: 0
0%
M: 6 C: 0
0%
M: 4 C: 0
0%
M: 5 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 Muenchen GmbH - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.edit.internal.model.testData.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.edit.internal.model.testData.TestData;
21: import org.eclipse.emf.ecp.edit.internal.model.testData.TestDataPackage;
22:
23: /**
24: * <!-- begin-user-doc -->
25: * The <b>Adapter Factory</b> for the model.
26: * It provides an adapter <code>createXXX</code> method for each class of the model.
27: * <!-- end-user-doc -->
28: *
29: * @see org.eclipse.emf.ecp.edit.internal.model.testData.TestDataPackage
30: * @generated
31: */
32: public class TestDataAdapterFactory extends AdapterFactoryImpl {
33:         /**
34:          * The cached model package.
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         protected static TestDataPackage modelPackage;
41:
42:         /**
43:          * Creates an instance of the adapter factory.
44:          * <!-- begin-user-doc -->
45:          * <!-- end-user-doc -->
46:          *
47:          * @generated
48:          */
49:         public TestDataAdapterFactory() {
50:•                if (modelPackage == null) {
51:                         modelPackage = TestDataPackage.eINSTANCE;
52:                 }
53:         }
54:
55:         /**
56:          * Returns whether this factory is applicable for the type of the object.
57:          * <!-- begin-user-doc -->
58:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
59:          * object of the model.
60:          * <!-- end-user-doc -->
61:          *
62:          * @return whether this factory is applicable for the type of the object.
63:          * @generated
64:          */
65:         @Override
66:         public boolean isFactoryForType(Object object) {
67:•                if (object == modelPackage) {
68:                         return true;
69:                 }
70:•                if (object instanceof EObject) {
71:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
72:                 }
73:                 return false;
74:         }
75:
76:         /**
77:          * The switch that delegates to the <code>createXXX</code> methods.
78:          * <!-- begin-user-doc -->
79:          * <!-- end-user-doc -->
80:          *
81:          * @generated
82:          */
83:         protected TestDataSwitch<Adapter> modelSwitch = new TestDataSwitch<Adapter>() {
84:                 @Override
85:                 public Adapter caseTestData(TestData object) {
86:                         return createTestDataAdapter();
87:                 }
88:
89:                 @Override
90:                 public Adapter defaultCase(EObject object) {
91:                         return createEObjectAdapter();
92:                 }
93:         };
94:
95:         /**
96:          * Creates an adapter for the <code>target</code>.
97:          * <!-- begin-user-doc -->
98:          * <!-- end-user-doc -->
99:          *
100:          * @param target the object to adapt.
101:          * @return the adapter for the <code>target</code>.
102:          * @generated
103:          */
104:         @Override
105:         public Adapter createAdapter(Notifier target) {
106:                 return modelSwitch.doSwitch((EObject) target);
107:         }
108:
109:         /**
110:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.edit.internal.model.testData.TestData
111:          * <em>Test Data</em>}'.
112:          * <!-- begin-user-doc -->
113:          * This default implementation returns null so that we can easily ignore cases;
114:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
115:          * <!-- end-user-doc -->
116:          *
117:          * @return the new adapter.
118:          * @see org.eclipse.emf.ecp.edit.internal.model.testData.TestData
119:          * @generated
120:          */
121:         public Adapter createTestDataAdapter() {
122:                 return null;
123:         }
124:
125:         /**
126:          * Creates a new adapter for the default case.
127:          * <!-- begin-user-doc -->
128:          * This default implementation returns null.
129:          * <!-- end-user-doc -->
130:          *
131:          * @return the new adapter.
132:          * @generated
133:          */
134:         public Adapter createEObjectAdapter() {
135:                 return null;
136:         }
137:
138: } // TestDataAdapterFactory