Skip to content

Package: TestTMDAdapterFactory$1

TestTMDAdapterFactory$1

nameinstructionbranchcomplexitylinemethod
caseChildLevel1(ChildLevel1)
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%
caseChildLevel2(ChildLevel2)
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%
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: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.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.treemasterdetail.validation.test.TestTMD.ChildLevel1;
21: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2;
22: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.Root;
23: import org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage;
24:
25: /**
26: * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides
27: * an adapter <code>createXXX</code> method for each class of the model. <!--
28: * end-user-doc -->
29: *
30: * @see org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.TestTMDPackage
31: * @generated
32: */
33: public class TestTMDAdapterFactory extends AdapterFactoryImpl {
34:         /**
35:          * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc -->
36:          *
37:          * @generated
38:          */
39:         protected static TestTMDPackage modelPackage;
40:
41:         /**
42:          * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!--
43:          * end-user-doc -->
44:          *
45:          * @generated
46:          */
47:         public TestTMDAdapterFactory() {
48:                 if (modelPackage == null) {
49:                         modelPackage = TestTMDPackage.eINSTANCE;
50:                 }
51:         }
52:
53:         /**
54:          * Returns whether this factory is applicable for the type of the object.
55:          * <!-- begin-user-doc --> This implementation returns <code>true</code> if
56:          * the object is either the model's package or is an instance object of the
57:          * model. <!-- end-user-doc -->
58:          *
59:          * @return whether this factory is applicable for the type of the object.
60:          * @generated
61:          */
62:         @Override
63:         public boolean isFactoryForType(Object object) {
64:                 if (object == modelPackage) {
65:                         return true;
66:                 }
67:                 if (object instanceof EObject) {
68:                         return ((EObject) object).eClass().getEPackage() == modelPackage;
69:                 }
70:                 return false;
71:         }
72:
73:         /**
74:          * The switch that delegates to the <code>createXXX</code> methods. <!--
75:          * begin-user-doc --> <!-- end-user-doc -->
76:          *
77:          * @generated
78:          */
79:         protected TestTMDSwitch<Adapter> modelSwitch = new TestTMDSwitch<Adapter>() {
80:                 @Override
81:                 public Adapter caseRoot(Root object) {
82:                         return createRootAdapter();
83:                 }
84:
85:                 @Override
86:                 public Adapter caseChildLevel1(ChildLevel1 object) {
87:                         return createChildLevel1Adapter();
88:                 }
89:
90:                 @Override
91:                 public Adapter caseChildLevel2(ChildLevel2 object) {
92:                         return createChildLevel2Adapter();
93:                 }
94:
95:                 @Override
96:                 public Adapter defaultCase(EObject object) {
97:                         return createEObjectAdapter();
98:                 }
99:         };
100:
101:         /**
102:          * Creates an adapter for the <code>target</code>. <!-- begin-user-doc -->
103:          * <!-- end-user-doc -->
104:          *
105:          * @param target
106:          * the object to adapt.
107:          * @return the adapter for the <code>target</code>.
108:          * @generated
109:          */
110:         @Override
111:         public Adapter createAdapter(Notifier target) {
112:                 return modelSwitch.doSwitch((EObject) target);
113:         }
114:
115:         /**
116:          * Creates a new adapter for an object of class '
117:          * {@link org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.Root
118:          * <em>Root</em>}'. <!-- begin-user-doc --> This default implementation
119:          * returns null so that we can easily ignore cases; it's useful to ignore a
120:          * case when inheritance will catch all the cases anyway. <!-- end-user-doc
121:          * -->
122:          *
123:          * @return the new adapter.
124:          * @see org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.Root
125:          * @generated
126:          */
127:         public Adapter createRootAdapter() {
128:                 return null;
129:         }
130:
131:         /**
132:          * Creates a new adapter for an object of class '
133:          * {@link org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel1
134:          * <em>Child Level1</em>}'. <!-- begin-user-doc --> This default
135:          * implementation returns null so that we can easily ignore cases; it's
136:          * useful to ignore a case when inheritance will catch all the cases anyway.
137:          * <!-- end-user-doc -->
138:          *
139:          * @return the new adapter.
140:          * @see org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel1
141:          * @generated
142:          */
143:         public Adapter createChildLevel1Adapter() {
144:                 return null;
145:         }
146:
147:         /**
148:          * Creates a new adapter for an object of class '
149:          * {@link org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2
150:          * <em>Child Level2</em>}'. <!-- begin-user-doc --> This default
151:          * implementation returns null so that we can easily ignore cases; it's
152:          * useful to ignore a case when inheritance will catch all the cases anyway.
153:          * <!-- end-user-doc -->
154:          *
155:          * @return the new adapter.
156:          * @see org.eclipse.emf.ecp.view.treemasterdetail.validation.test.TestTMD.ChildLevel2
157:          * @generated
158:          */
159:         public Adapter createChildLevel2Adapter() {
160:                 return null;
161:         }
162:
163:         /**
164:          * Creates a new adapter for the default case. <!-- begin-user-doc --> This
165:          * default implementation returns null. <!-- end-user-doc -->
166:          *
167:          * @return the new adapter.
168:          * @generated
169:          */
170:         public Adapter createEObjectAdapter() {
171:                 return null;
172:         }
173:
174: } // TestTMDAdapterFactory