Skip to content

Package: AnnotationAdapterFactory

AnnotationAdapterFactory

nameinstructionbranchcomplexitylinemethod
AnnotationAdapterFactory()
M: 0 C: 13
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createAdapter(Notifier)
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
createAnnotationAdapter()
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%
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%
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: 2 C: 18
90%
M: 1 C: 5
83%
M: 1 C: 3
75%
M: 0 C: 5
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (c) 2011-2015 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.emfforms.spi.view.annotation.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.VAttachment;
21: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotation;
22: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationPackage;
23:
24: /**
25: * <!-- begin-user-doc -->
26: * The <b>Adapter Factory</b> for the model.
27: * It provides an adapter <code>createXXX</code> method for each class of the model.
28: * <!-- end-user-doc -->
29: *
30: * @see org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationPackage
31: * @generated
32: */
33: public class AnnotationAdapterFactory extends AdapterFactoryImpl {
34:         /**
35:          * The cached model package.
36:          * <!-- begin-user-doc -->
37:          * <!-- end-user-doc -->
38:          *
39:          * @generated
40:          */
41:         protected static VAnnotationPackage modelPackage;
42:
43:         /**
44:          * Creates an instance of the adapter factory.
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         public AnnotationAdapterFactory() {
51:•                if (modelPackage == null) {
52:                         modelPackage = VAnnotationPackage.eINSTANCE;
53:                 }
54:         }
55:
56:         /**
57:          * Returns whether this factory is applicable for the type of the object.
58:          * <!-- begin-user-doc -->
59:          * This implementation returns <code>true</code> if the object is either the model's package or is an instance
60:          * object of the model.
61:          * <!-- end-user-doc -->
62:          *
63:          * @return whether this factory is applicable for the type of the object.
64:          * @generated
65:          */
66:         @Override
67:         public boolean isFactoryForType(Object object) {
68:•                if (object == modelPackage) {
69:                         return true;
70:                 }
71:•                if (object instanceof EObject) {
72:•                        return ((EObject) object).eClass().getEPackage() == modelPackage;
73:                 }
74:                 return false;
75:         }
76:
77:         /**
78:          * The switch that delegates to the <code>createXXX</code> methods.
79:          * <!-- begin-user-doc -->
80:          * <!-- end-user-doc -->
81:          *
82:          * @generated
83:          */
84:         protected AnnotationSwitch<Adapter> modelSwitch = new AnnotationSwitch<Adapter>() {
85:                 @Override
86:                 public Adapter caseAnnotation(VAnnotation object) {
87:                         return createAnnotationAdapter();
88:                 }
89:
90:                 @Override
91:                 public Adapter caseAttachment(VAttachment object) {
92:                         return createAttachmentAdapter();
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>.
103:          * <!-- begin-user-doc -->
104:          * <!-- end-user-doc -->
105:          *
106:          * @param target 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.emfforms.spi.view.annotation.model.VAnnotation <em>Annotation</em>}'.
118:          * <!-- begin-user-doc -->
119:          * This default implementation returns null so that we can easily ignore cases;
120:          * it's useful to ignore a case when inheritance will catch all the cases anyway.
121:          * <!-- end-user-doc -->
122:          *
123:          * @return the new adapter.
124:          * @see org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotation
125:          * @generated
126:          */
127:         public Adapter createAnnotationAdapter() {
128:                 return null;
129:         }
130:
131:         /**
132:          * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.view.spi.model.VAttachment
133:          * <em>Attachment</em>}'.
134:          * <!-- begin-user-doc -->
135:          * This default implementation returns null so that we can easily ignore cases;
136:          * it's 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.spi.model.VAttachment
141:          * @generated
142:          */
143:         public Adapter createAttachmentAdapter() {
144:                 return null;
145:         }
146:
147:         /**
148:          * Creates a new adapter for the default case.
149:          * <!-- begin-user-doc -->
150:          * This default implementation returns null.
151:          * <!-- end-user-doc -->
152:          *
153:          * @return the new adapter.
154:          * @generated
155:          */
156:         public Adapter createEObjectAdapter() {
157:                 return null;
158:         }
159:
160: } // AnnotationAdapterFactory