Skip to content

Package: VAnnotationFactoryImpl

VAnnotationFactoryImpl

nameinstructionbranchcomplexitylinemethod
VAnnotationFactoryImpl()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
create(EClass)
M: 14 C: 6
30%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 2
67%
M: 0 C: 1
100%
createAnnotation()
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
getAnnotationPackage()
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%
getPackage()
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%
init()
M: 6 C: 11
65%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 3 C: 4
57%
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.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EObject;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EFactoryImpl;
20: import org.eclipse.emf.ecore.plugin.EcorePlugin;
21: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotation;
22: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationFactory;
23: import org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationPackage;
24:
25: /**
26: * <!-- begin-user-doc -->
27: * An implementation of the model <b>Factory</b>.
28: * <!-- end-user-doc -->
29: *
30: * @generated
31: */
32: public class VAnnotationFactoryImpl extends EFactoryImpl implements VAnnotationFactory {
33:         /**
34:          * Creates the default factory implementation.
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         public static VAnnotationFactory init() {
41:                 try {
42:                         final VAnnotationFactory theAnnotationFactory = (VAnnotationFactory) EPackage.Registry.INSTANCE
43:                                 .getEFactory(VAnnotationPackage.eNS_URI);
44:•                        if (theAnnotationFactory != null) {
45:                                 return theAnnotationFactory;
46:                         }
47:                 } catch (final Exception exception) {
48:                         EcorePlugin.INSTANCE.log(exception);
49:                 }
50:                 return new VAnnotationFactoryImpl();
51:         }
52:
53:         /**
54:          * Creates an instance of the factory.
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @generated
59:          */
60:         public VAnnotationFactoryImpl() {
61:                 super();
62:         }
63:
64:         /**
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @generated
69:          */
70:         @Override
71:         public EObject create(EClass eClass) {
72:•                switch (eClass.getClassifierID()) {
73:                 case VAnnotationPackage.ANNOTATION:
74:                         return createAnnotation();
75:                 default:
76:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
77:                 }
78:         }
79:
80:         /**
81:          * <!-- begin-user-doc -->
82:          * <!-- end-user-doc -->
83:          *
84:          * @generated
85:          */
86:         @Override
87:         public VAnnotation createAnnotation() {
88:                 final VAnnotationImpl annotation = new VAnnotationImpl();
89:                 return annotation;
90:         }
91:
92:         /**
93:          * <!-- begin-user-doc -->
94:          * <!-- end-user-doc -->
95:          *
96:          * @generated
97:          */
98:         @Override
99:         public VAnnotationPackage getAnnotationPackage() {
100:                 return (VAnnotationPackage) getEPackage();
101:         }
102:
103:         /**
104:          * <!-- begin-user-doc -->
105:          * <!-- end-user-doc -->
106:          *
107:          * @deprecated
108:          * @generated
109:          */
110:         @Deprecated
111:         public static VAnnotationPackage getPackage() {
112:                 return VAnnotationPackage.eINSTANCE;
113:         }
114:
115: } // VAnnotationFactoryImpl