Skip to content

Package: DiffmergeAdapterFactory

DiffmergeAdapterFactory

nameinstructionbranchcomplexitylinemethod
DiffmergeAdapterFactory()
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%
createAttachmentAdapter()
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%
createDiffAttachmentAdapter()
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%
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-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: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.spi.diffmerge.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.spi.diffmerge.model.VDiffAttachment;
21: import org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage;
22: import org.eclipse.emf.ecp.view.spi.model.VAttachment;
23:
24: /**
25: * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides
26: * an adapter <code>createXXX</code> method for each class of the model. <!--
27: * end-user-doc -->
28: *
29: * @see org.eclipse.emf.ecp.spi.diffmerge.model.VDiffmergePackage
30: * @generated
31: */
32: public class DiffmergeAdapterFactory extends AdapterFactoryImpl {
33:         /**
34:          * The cached model package.
35:          * <!-- begin-user-doc --> <!-- end-user-doc -->
36:          *
37:          * @generated
38:          */
39:         protected static VDiffmergePackage 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 DiffmergeAdapterFactory() {
49:•                if (modelPackage == null) {
50:                         modelPackage = VDiffmergePackage.eINSTANCE;
51:                 }
52:         }
53:
54:         /**
55:          * Returns whether this factory is applicable for the type of the object.
56:          * <!-- begin-user-doc --> This implementation returns <code>true</code> if
57:          * the object is either the model's package or is an instance object of the
58:          * model. <!-- end-user-doc -->
59:          *
60:          * @return whether this factory is applicable for the type of the object.
61:          * @generated
62:          */
63:         @Override
64:         public boolean isFactoryForType(Object object) {
65:•                if (object == modelPackage) {
66:                         return true;
67:                 }
68:•                if (object instanceof EObject) {
69:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
70:                 }
71:                 return false;
72:         }
73:
74:         /**
75:          * The switch that delegates to the <code>createXXX</code> methods. <!--
76:          * begin-user-doc --> <!-- end-user-doc -->
77:          *
78:          * @generated
79:          */
80:         protected DiffmergeSwitch<Adapter> modelSwitch = new DiffmergeSwitch<Adapter>() {
81:                 @Override
82:                 public Adapter caseDiffAttachment(VDiffAttachment object) {
83:                         return createDiffAttachmentAdapter();
84:                 }
85:
86:                 @Override
87:                 public Adapter caseAttachment(VAttachment object) {
88:                         return createAttachmentAdapter();
89:                 }
90:
91:                 @Override
92:                 public Adapter defaultCase(EObject object) {
93:                         return createEObjectAdapter();
94:                 }
95:         };
96:
97:         /**
98:          * Creates an adapter for the <code>target</code>.
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @param target the object to adapt.
103:          * @return the adapter for the <code>target</code>.
104:          * @generated
105:          */
106:         @Override
107:         public Adapter createAdapter(Notifier target) {
108:                 return modelSwitch.doSwitch((EObject) target);
109:         }
110:
111:         /**
112:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.spi.diffmerge.model.VDiffAttachment
113:          * <em>Diff Attachment</em>}'.
114:          * <!-- begin-user-doc --> This default
115:          * implementation returns null so that we can easily ignore cases; it's
116:          * useful to ignore a case when inheritance will catch all the cases anyway.
117:          * <!-- end-user-doc -->
118:          *
119:          * @return the new adapter.
120:          * @see org.eclipse.emf.ecp.spi.diffmerge.model.VDiffAttachment
121:          * @generated
122:          */
123:         public Adapter createDiffAttachmentAdapter() {
124:                 return null;
125:         }
126:
127:         /**
128:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VAttachment
129:          * <em>Attachment</em>}'.
130:          * <!-- begin-user-doc --> This default
131:          * implementation returns null so that we can easily ignore cases; it's
132:          * useful to ignore a case when inheritance will catch all the cases anyway.
133:          * <!-- end-user-doc -->
134:          *
135:          * @return the new adapter.
136:          * @see org.eclipse.emf.ecp.view.spi.model.VAttachment
137:          * @generated
138:          */
139:         public Adapter createAttachmentAdapter() {
140:                 return null;
141:         }
142:
143:         /**
144:          * Creates a new adapter for the default case.
145:          * <!-- begin-user-doc --> This
146:          * default implementation returns null. <!-- end-user-doc -->
147:          *
148:          * @return the new adapter.
149:          * @generated
150:          */
151:         public Adapter createEObjectAdapter() {
152:                 return null;
153:         }
154:
155: } // DiffmergeAdapterFactory