Skip to content

Package: DataTemplatePackageImpl

DataTemplatePackageImpl

nameinstructionbranchcomplexitylinemethod
DataTemplatePackageImpl()
M: 0 C: 17
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 6
100%
M: 0 C: 1
100%
createPackageContents()
M: 1 C: 32
97%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 8
89%
M: 0 C: 1
100%
getDataTemplateFactory()
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%
getTemplate()
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%
getTemplateCollection()
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%
getTemplateCollection_Templates()
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%
getTemplate_Instance()
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%
getTemplate_Name()
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: 8 C: 28
78%
M: 2 C: 2
50%
M: 2 C: 1
33%
M: 2 C: 10
83%
M: 0 C: 1
100%
initializePackageContents()
M: 1 C: 106
99%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 19
95%
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-2018 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 Muenchen GmbH - initial API and implementation
13: */
14: package org.eclipse.emfforms.datatemplate.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.EReference;
20: import org.eclipse.emf.ecore.impl.EPackageImpl;
21: import org.eclipse.emfforms.datatemplate.DataTemplateFactory;
22: import org.eclipse.emfforms.datatemplate.DataTemplatePackage;
23: import org.eclipse.emfforms.datatemplate.Template;
24: import org.eclipse.emfforms.datatemplate.TemplateCollection;
25:
26: /**
27: * <!-- begin-user-doc -->
28: * An implementation of the model <b>Package</b>.
29: * <!-- end-user-doc -->
30: *
31: * @generated
32: */
33: public class DataTemplatePackageImpl extends EPackageImpl implements DataTemplatePackage {
34:         /**
35:          * <!-- begin-user-doc -->
36:          * <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         private EClass templateEClass = null;
41:
42:         /**
43:          * <!-- begin-user-doc -->
44:          * <!-- end-user-doc -->
45:          *
46:          * @generated
47:          */
48:         private EClass templateCollectionEClass = null;
49:
50:         /**
51:          * Creates an instance of the model <b>Package</b>, registered with
52:          * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
53:          * package URI value.
54:          * <p>
55:          * Note: the correct way to create the package is via the static
56:          * factory method {@link #init init()}, which also performs
57:          * initialization of the package, or returns the registered package,
58:          * if one already exists.
59:          * <!-- begin-user-doc -->
60:          * <!-- end-user-doc -->
61:          *
62:          * @see org.eclipse.emf.ecore.EPackage.Registry
63:          * @see org.eclipse.emfforms.datatemplate.DataTemplatePackage#eNS_URI
64:          * @see #init()
65:          * @generated
66:          */
67:         private DataTemplatePackageImpl() {
68:                 super(eNS_URI, DataTemplateFactory.eINSTANCE);
69:         }
70:
71:         /**
72:          * <!-- begin-user-doc -->
73:          * <!-- end-user-doc -->
74:          *
75:          * @generated
76:          */
77:         private static boolean isInited = false;
78:
79:         /**
80:          * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
81:          *
82:          * <p>
83:          * This method is used to initialize {@link DataTemplatePackage#eINSTANCE} when that field is accessed.
84:          * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @see #eNS_URI
89:          * @see #createPackageContents()
90:          * @see #initializePackageContents()
91:          * @generated
92:          */
93:         public static DataTemplatePackage init() {
94:•                if (isInited) {
95:                         return (DataTemplatePackage) EPackage.Registry.INSTANCE.getEPackage(DataTemplatePackage.eNS_URI);
96:                 }
97:
98:                 // Obtain or create and register package
99:                 final Object registeredDataTemplatePackage = EPackage.Registry.INSTANCE.get(eNS_URI);
100:•                final DataTemplatePackageImpl theDataTemplatePackage = registeredDataTemplatePackage instanceof DataTemplatePackageImpl
101:                         ? (DataTemplatePackageImpl) registeredDataTemplatePackage
102:                         : new DataTemplatePackageImpl();
103:
104:                 isInited = true;
105:
106:                 // Create package meta-data objects
107:                 theDataTemplatePackage.createPackageContents();
108:
109:                 // Initialize created meta-data
110:                 theDataTemplatePackage.initializePackageContents();
111:
112:                 // Mark meta-data to indicate it can't be changed
113:                 theDataTemplatePackage.freeze();
114:
115:                 // Update the registry and return the package
116:                 EPackage.Registry.INSTANCE.put(DataTemplatePackage.eNS_URI, theDataTemplatePackage);
117:                 return theDataTemplatePackage;
118:         }
119:
120:         /**
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @generated
125:          */
126:         @Override
127:         public EClass getTemplate() {
128:                 return templateEClass;
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         @Override
138:         public EAttribute getTemplate_Name() {
139:                 return (EAttribute) templateEClass.getEStructuralFeatures().get(0);
140:         }
141:
142:         /**
143:          * <!-- begin-user-doc -->
144:          * <!-- end-user-doc -->
145:          *
146:          * @generated
147:          */
148:         @Override
149:         public EReference getTemplate_Instance() {
150:                 return (EReference) templateEClass.getEStructuralFeatures().get(1);
151:         }
152:
153:         /**
154:          * <!-- begin-user-doc -->
155:          * <!-- end-user-doc -->
156:          *
157:          * @generated
158:          */
159:         @Override
160:         public EClass getTemplateCollection() {
161:                 return templateCollectionEClass;
162:         }
163:
164:         /**
165:          * <!-- begin-user-doc -->
166:          * <!-- end-user-doc -->
167:          *
168:          * @generated
169:          */
170:         @Override
171:         public EReference getTemplateCollection_Templates() {
172:                 return (EReference) templateCollectionEClass.getEStructuralFeatures().get(0);
173:         }
174:
175:         /**
176:          * <!-- begin-user-doc -->
177:          * <!-- end-user-doc -->
178:          *
179:          * @generated
180:          */
181:         @Override
182:         public DataTemplateFactory getDataTemplateFactory() {
183:                 return (DataTemplateFactory) getEFactoryInstance();
184:         }
185:
186:         /**
187:          * <!-- begin-user-doc -->
188:          * <!-- end-user-doc -->
189:          *
190:          * @generated
191:          */
192:         private boolean isCreated = false;
193:
194:         /**
195:          * Creates the meta-model objects for the package. This method is
196:          * guarded to have no affect on any invocation but its first.
197:          * <!-- begin-user-doc -->
198:          * <!-- end-user-doc -->
199:          *
200:          * @generated
201:          */
202:         public void createPackageContents() {
203:•                if (isCreated) {
204:                         return;
205:                 }
206:                 isCreated = true;
207:
208:                 // Create classes and their features
209:                 templateEClass = createEClass(TEMPLATE);
210:                 createEAttribute(templateEClass, TEMPLATE__NAME);
211:                 createEReference(templateEClass, TEMPLATE__INSTANCE);
212:
213:                 templateCollectionEClass = createEClass(TEMPLATE_COLLECTION);
214:                 createEReference(templateCollectionEClass, TEMPLATE_COLLECTION__TEMPLATES);
215:         }
216:
217:         /**
218:          * <!-- begin-user-doc -->
219:          * <!-- end-user-doc -->
220:          *
221:          * @generated
222:          */
223:         private boolean isInitialized = false;
224:
225:         /**
226:          * Complete the initialization of the package and its meta-model. This
227:          * method is guarded to have no affect on any invocation but its first.
228:          * <!-- begin-user-doc -->
229:          * <!-- end-user-doc -->
230:          *
231:          * @generated
232:          */
233:         public void initializePackageContents() {
234:•                if (isInitialized) {
235:                         return;
236:                 }
237:                 isInitialized = true;
238:
239:                 // Initialize package
240:                 setName(eNAME);
241:                 setNsPrefix(eNS_PREFIX);
242:                 setNsURI(eNS_URI);
243:
244:                 // Create type parameters
245:
246:                 // Set bounds for type parameters
247:
248:                 // Add supertypes to classes
249:
250:                 // Initialize classes, features, and operations; add parameters
251:                 initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$
252:                         IS_GENERATED_INSTANCE_CLASS);
253:                 initEAttribute(getTemplate_Name(), ecorePackage.getEString(), "name", null, 0, 1, Template.class, !IS_TRANSIENT, //$NON-NLS-1$
254:                         !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
255:                 initEReference(getTemplate_Instance(), ecorePackage.getEObject(), null, "instance", null, 1, 1, Template.class, //$NON-NLS-1$
256:                         !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
257:                         !IS_DERIVED, IS_ORDERED);
258:
259:                 initEClass(templateCollectionEClass, TemplateCollection.class, "TemplateCollection", !IS_ABSTRACT, //$NON-NLS-1$
260:                         !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
261:                 initEReference(getTemplateCollection_Templates(), getTemplate(), null, "templates", null, 0, -1, //$NON-NLS-1$
262:                         TemplateCollection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
263:                         !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
264:
265:                 // Create resource
266:                 createResource(eNS_URI);
267:         }
268:
269: } // DataTemplatePackageImpl