Skip to content

Package: YAdapterFactory

YAdapterFactory

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