Skip to content

Package: VMappingdmrPackageImpl$1

VMappingdmrPackageImpl$1

nameinstructionbranchcomplexitylinemethod
getEValidator()
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%
{...}
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: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.spi.mappingdmr.model.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.EReference;
19: import org.eclipse.emf.ecore.EValidator;
20: import org.eclipse.emf.ecore.impl.EPackageImpl;
21: import org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingDomainModelReference;
22: import org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingdmrFactory;
23: import org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingdmrPackage;
24: import org.eclipse.emf.ecp.view.spi.mappingdmr.model.util.MappingdmrValidator;
25: import org.eclipse.emf.ecp.view.spi.model.VViewPackage;
26:
27: /**
28: * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!--
29: * end-user-doc -->
30: *
31: * @generated
32: */
33: public class VMappingdmrPackageImpl extends EPackageImpl implements
34:         VMappingdmrPackage {
35:         /**
36:          * <!-- begin-user-doc --> <!-- end-user-doc -->
37:          *
38:          * @generated
39:          */
40:         private EClass mappingDomainModelReferenceEClass = null;
41:
42:         /**
43:          * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
44:          * EPackage.Registry} by the
45:          * package package URI value.
46:          * <p>
47:          * Note: the correct way to create the package is via the static factory method {@link #init init()}, which also
48:          * performs initialization of the package, or returns the registered package, if one already exists. <!--
49:          * begin-user-doc --> <!-- end-user-doc -->
50:          *
51:          * @see org.eclipse.emf.ecore.EPackage.Registry
52:          * @see org.eclipse.emf.ecp.view.spi.mappingdmr.model.VMappingdmrPackage#eNS_URI
53:          * @see #init()
54:          * @generated
55:          */
56:         private VMappingdmrPackageImpl() {
57:                 super(eNS_URI, VMappingdmrFactory.eINSTANCE);
58:         }
59:
60:         /**
61:          * <!-- begin-user-doc --> <!-- 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,
69:          * and for any others upon which it depends.
70:          *
71:          * <p>
72:          * This method is used to initialize {@link VMappingdmrPackage#eINSTANCE} when that field is accessed. Clients
73:          * should not invoke it directly. Instead, they should simply access that field to obtain the package. <!--
74:          * begin-user-doc --> <!-- end-user-doc -->
75:          *
76:          * @see #eNS_URI
77:          * @see #createPackageContents()
78:          * @see #initializePackageContents()
79:          * @generated
80:          */
81:         public static VMappingdmrPackage init() {
82:                 if (isInited) {
83:                         return (VMappingdmrPackage) EPackage.Registry.INSTANCE.getEPackage(VMappingdmrPackage.eNS_URI);
84:                 }
85:
86:                 // Obtain or create and register package
87:                 final VMappingdmrPackageImpl theMappingdmrPackage = (VMappingdmrPackageImpl) (EPackage.Registry.INSTANCE
88:                         .get(eNS_URI) instanceof VMappingdmrPackageImpl ? EPackage.Registry.INSTANCE
89:                                 .get(eNS_URI) : new VMappingdmrPackageImpl());
90:
91:                 isInited = true;
92:
93:                 // Initialize simple dependencies
94:                 VViewPackage.eINSTANCE.eClass();
95:
96:                 // Create package meta-data objects
97:                 theMappingdmrPackage.createPackageContents();
98:
99:                 // Initialize created meta-data
100:                 theMappingdmrPackage.initializePackageContents();
101:
102:                 // Register package validator
103:                 EValidator.Registry.INSTANCE.put(theMappingdmrPackage,
104:                         new EValidator.Descriptor() {
105:                                 @Override
106:                                 public EValidator getEValidator() {
107:                                         return MappingdmrValidator.INSTANCE;
108:                                 }
109:                         });
110:
111:                 // Mark meta-data to indicate it can't be changed
112:                 theMappingdmrPackage.freeze();
113:
114:                 // Update the registry and return the package
115:                 EPackage.Registry.INSTANCE.put(VMappingdmrPackage.eNS_URI, theMappingdmrPackage);
116:                 return theMappingdmrPackage;
117:         }
118:
119:         /**
120:          * <!-- begin-user-doc --> <!-- end-user-doc -->
121:          *
122:          * @generated
123:          */
124:         @Override
125:         public EClass getMappingDomainModelReference() {
126:                 return mappingDomainModelReferenceEClass;
127:         }
128:
129:         /**
130:          * <!-- begin-user-doc --> <!-- end-user-doc -->
131:          *
132:          * @generated
133:          */
134:         @Override
135:         public EReference getMappingDomainModelReference_MappedClass() {
136:                 return (EReference) mappingDomainModelReferenceEClass.getEStructuralFeatures().get(0);
137:         }
138:
139:         /**
140:          * <!-- begin-user-doc --> <!-- end-user-doc -->
141:          *
142:          * @generated
143:          */
144:         @Override
145:         public EReference getMappingDomainModelReference_DomainModelReference() {
146:                 return (EReference) mappingDomainModelReferenceEClass.getEStructuralFeatures().get(1);
147:         }
148:
149:         /**
150:          * <!-- begin-user-doc --> <!-- end-user-doc -->
151:          *
152:          * @generated
153:          */
154:         @Override
155:         public VMappingdmrFactory getMappingdmrFactory() {
156:                 return (VMappingdmrFactory) getEFactoryInstance();
157:         }
158:
159:         /**
160:          * <!-- begin-user-doc --> <!-- end-user-doc -->
161:          *
162:          * @generated
163:          */
164:         private boolean isCreated = false;
165:
166:         /**
167:          * Creates the meta-model objects for the package. This method is
168:          * guarded to have no affect on any invocation but its first.
169:          * <!-- begin-user-doc -->
170:          * <!-- end-user-doc -->
171:          *
172:          * @generated
173:          */
174:         public void createPackageContents() {
175:                 if (isCreated) {
176:                         return;
177:                 }
178:                 isCreated = true;
179:
180:                 // Create classes and their features
181:                 mappingDomainModelReferenceEClass = createEClass(MAPPING_DOMAIN_MODEL_REFERENCE);
182:                 createEReference(mappingDomainModelReferenceEClass, MAPPING_DOMAIN_MODEL_REFERENCE__MAPPED_CLASS);
183:                 createEReference(mappingDomainModelReferenceEClass, MAPPING_DOMAIN_MODEL_REFERENCE__DOMAIN_MODEL_REFERENCE);
184:         }
185:
186:         /**
187:          * <!-- begin-user-doc --> <!-- 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 --> <!-- end-user-doc -->
197:          *
198:          * @generated
199:          */
200:         public void initializePackageContents() {
201:                 if (isInitialized) {
202:                         return;
203:                 }
204:                 isInitialized = true;
205:
206:                 // Initialize package
207:                 setName(eNAME);
208:                 setNsPrefix(eNS_PREFIX);
209:                 setNsURI(eNS_URI);
210:
211:                 // Obtain other dependent packages
212:                 final VViewPackage theViewPackage = (VViewPackage) EPackage.Registry.INSTANCE.getEPackage(VViewPackage.eNS_URI);
213:
214:                 // Create type parameters
215:
216:                 // Set bounds for type parameters
217:
218:                 // Add supertypes to classes
219:                 mappingDomainModelReferenceEClass.getESuperTypes().add(theViewPackage.getFeaturePathDomainModelReference());
220:
221:                 // Initialize classes and features; add operations and parameters
222:                 initEClass(mappingDomainModelReferenceEClass, VMappingDomainModelReference.class, "MappingDomainModelReference", //$NON-NLS-1$
223:                         !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
224:                 initEReference(getMappingDomainModelReference_MappedClass(), ecorePackage.getEClass(), null, "mappedClass", //$NON-NLS-1$
225:                         null, 0, 1, VMappingDomainModelReference.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
226:                         IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
227:                 initEReference(getMappingDomainModelReference_DomainModelReference(), theViewPackage.getDomainModelReference(),
228:                         null, "domainModelReference", null, 1, 1, VMappingDomainModelReference.class, !IS_TRANSIENT, !IS_VOLATILE, //$NON-NLS-1$
229:                         IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
230:
231:                 // Create resource
232:                 createResource(eNS_URI);
233:
234:                 // Create annotations
235:                 // http://www.eclipse.org/emf/2002/Ecore
236:                 createEcoreAnnotations();
237:         }
238:
239:         /**
240:          * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
241:          * <!-- begin-user-doc -->
242:          * <!-- end-user-doc -->
243:          *
244:          * @generated
245:          */
246:         protected void createEcoreAnnotations() {
247:                 final String source = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$
248:                 addAnnotation(mappingDomainModelReferenceEClass,
249:                         source,
250:                         new String[] { "constraints", "resolveable" //$NON-NLS-1$ //$NON-NLS-2$
251:                         });
252:         }
253:
254: } // VMappingdmrPackageImpl