Skip to content

Package: VTMandatoryPackageImpl

VTMandatoryPackageImpl

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