Skip to content

Package: ViewproxyAdapterFactory$1

ViewproxyAdapterFactory$1

nameinstructionbranchcomplexitylinemethod
caseContainedElement(VContainedElement)
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%
caseElement(VElement)
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%
caseViewProxy(VViewProxy)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
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: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

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