Skip to content

Package: VAnnotationPackageImpl

VAnnotationPackageImpl

nameinstructionbranchcomplexitylinemethod
VAnnotationPackageImpl()
M: 0 C: 14
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 22
96%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 6
86%
M: 0 C: 1
100%
getAnnotation()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getAnnotationFactory()
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%
getAnnotation_Key()
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%
getAnnotation_Value()
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%
init()
M: 9 C: 30
77%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 1 C: 11
92%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 84
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 15
94%
M: 0 C: 1
100%
static {...}
M: 0 C: 3
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-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.EAttribute;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.EPackage;
19: import org.eclipse.emf.ecore.impl.EPackageImpl;
20: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
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>Package</b>.
28: * <!-- end-user-doc -->
29: *
30: * @generated
31: */
32: public class VAnnotationPackageImpl extends EPackageImpl implements VAnnotationPackage {
33:         /**
34:          * <!-- begin-user-doc -->
35:          * <!-- end-user-doc -->
36:          *
37:          * @generated
38:          */
39:         private EClass annotationEClass = null;
40:
41:         /**
42:          * Creates an instance of the model <b>Package</b>, registered with
43:          * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
44:          * package URI value.
45:          * <p>
46:          * Note: the correct way to create the package is via the static
47:          * factory method {@link #init init()}, which also performs
48:          * initialization of the package, or returns the registered package,
49:          * if one already exists.
50:          * <!-- begin-user-doc -->
51:          * <!-- end-user-doc -->
52:          *
53:          * @see org.eclipse.emf.ecore.EPackage.Registry
54:          * @see org.eclipse.emf.emfforms.spi.view.annotation.model.VAnnotationPackage#eNS_URI
55:          * @see #init()
56:          * @generated
57:          */
58:         private VAnnotationPackageImpl() {
59:                 super(eNS_URI, VAnnotationFactory.eINSTANCE);
60:         }
61:
62:         /**
63:          * <!-- begin-user-doc -->
64:          * <!-- end-user-doc -->
65:          *
66:          * @generated
67:          */
68:         private static boolean isInited = false;
69:
70:         /**
71:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
72:          *
73:          * <p>
74:          * This method is used to initialize {@link VAnnotationPackage#eINSTANCE} when that field is accessed.
75:          * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @see #eNS_URI
80:          * @see #createPackageContents()
81:          * @see #initializePackageContents()
82:          * @generated
83:          */
84:         public static VAnnotationPackage init() {
85:•                if (isInited) {
86:                         return (VAnnotationPackage) EPackage.Registry.INSTANCE.getEPackage(VAnnotationPackage.eNS_URI);
87:                 }
88:
89:                 // Obtain or create and register package
90:                 final VAnnotationPackageImpl theAnnotationPackage = (VAnnotationPackageImpl) (EPackage.Registry.INSTANCE
91:•                        .get(eNS_URI) instanceof VAnnotationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI)
92:                                 : new VAnnotationPackageImpl());
93:
94:                 isInited = true;
95:
96:                 // Initialize simple dependencies
97:                 VViewPackage.eINSTANCE.eClass();
98:
99:                 // Create package meta-data objects
100:                 theAnnotationPackage.createPackageContents();
101:
102:                 // Initialize created meta-data
103:                 theAnnotationPackage.initializePackageContents();
104:
105:                 // Mark meta-data to indicate it can't be changed
106:                 theAnnotationPackage.freeze();
107:
108:                 // Update the registry and return the package
109:                 EPackage.Registry.INSTANCE.put(VAnnotationPackage.eNS_URI, theAnnotationPackage);
110:                 return theAnnotationPackage;
111:         }
112:
113:         /**
114:          * <!-- begin-user-doc -->
115:          * <!-- end-user-doc -->
116:          *
117:          * @generated
118:          */
119:         @Override
120:         public EClass getAnnotation() {
121:                 return annotationEClass;
122:         }
123:
124:         /**
125:          * <!-- begin-user-doc -->
126:          * <!-- end-user-doc -->
127:          *
128:          * @generated
129:          */
130:         @Override
131:         public EAttribute getAnnotation_Key() {
132:                 return (EAttribute) annotationEClass.getEStructuralFeatures().get(0);
133:         }
134:
135:         /**
136:          * <!-- begin-user-doc -->
137:          * <!-- end-user-doc -->
138:          *
139:          * @generated
140:          */
141:         @Override
142:         public EAttribute getAnnotation_Value() {
143:                 return (EAttribute) annotationEClass.getEStructuralFeatures().get(1);
144:         }
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         @Override
153:         public VAnnotationFactory getAnnotationFactory() {
154:                 return (VAnnotationFactory) getEFactoryInstance();
155:         }
156:
157:         /**
158:          * <!-- begin-user-doc -->
159:          * <!-- end-user-doc -->
160:          *
161:          * @generated
162:          */
163:         private boolean isCreated = false;
164:
165:         /**
166:          * Creates the meta-model objects for the package. This method is
167:          * guarded to have no affect on any invocation but its first.
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         public void createPackageContents() {
174:•                if (isCreated) {
175:                         return;
176:                 }
177:                 isCreated = true;
178:
179:                 // Create classes and their features
180:                 annotationEClass = createEClass(ANNOTATION);
181:                 createEAttribute(annotationEClass, ANNOTATION__KEY);
182:                 createEAttribute(annotationEClass, ANNOTATION__VALUE);
183:         }
184:
185:         /**
186:          * <!-- begin-user-doc -->
187:          * <!-- end-user-doc -->
188:          *
189:          * @generated
190:          */
191:         private boolean isInitialized = false;
192:
193:         /**
194:          * Complete the initialization of the package and its meta-model. This
195:          * method is guarded to have no affect on any invocation but its first.
196:          * <!-- begin-user-doc -->
197:          * <!-- end-user-doc -->
198:          *
199:          * @generated
200:          */
201:         public void initializePackageContents() {
202:•                if (isInitialized) {
203:                         return;
204:                 }
205:                 isInitialized = true;
206:
207:                 // Initialize package
208:                 setName(eNAME);
209:                 setNsPrefix(eNS_PREFIX);
210:                 setNsURI(eNS_URI);
211:
212:                 // Obtain other dependent packages
213:                 final VViewPackage theViewPackage = (VViewPackage) EPackage.Registry.INSTANCE.getEPackage(VViewPackage.eNS_URI);
214:
215:                 // Create type parameters
216:
217:                 // Set bounds for type parameters
218:
219:                 // Add supertypes to classes
220:                 annotationEClass.getESuperTypes().add(theViewPackage.getAttachment());
221:
222:                 // Initialize classes and features; add operations and parameters
223:                 initEClass(annotationEClass, VAnnotation.class, "Annotation", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$
224:                         IS_GENERATED_INSTANCE_CLASS);
225:                 initEAttribute(getAnnotation_Key(), ecorePackage.getEString(), "key", null, 1, 1, VAnnotation.class, //$NON-NLS-1$
226:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
227:                 initEAttribute(getAnnotation_Value(), ecorePackage.getEString(), "value", null, 0, 1, VAnnotation.class, //$NON-NLS-1$
228:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
229:
230:                 // Create resource
231:                 createResource(eNS_URI);
232:         }
233:
234: } // VAnnotationPackageImpl