1 /*******************************************************************************
2 * Copyright (c) 2011, 2014 Obeo.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Obeo - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.impl
;
13 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche
;
14 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche2
;
15 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.ACliche3
;
16 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.UML2CompareTestProfileFactory
;
17 import org
.eclipse
.emf
.compare
.uml2
.profile
.test
.uml2comparetestprofile
.UML2CompareTestProfilePackage
;
18 import org
.eclipse
.emf
.ecore
.EAttribute
;
19 import org
.eclipse
.emf
.ecore
.EClass
;
20 import org
.eclipse
.emf
.ecore
.EPackage
;
21 import org
.eclipse
.emf
.ecore
.EReference
;
22 import org
.eclipse
.emf
.ecore
.impl
.EPackageImpl
;
23 import org
.eclipse
.uml2
.types
.TypesPackage
;
24 import org
.eclipse
.uml2
.uml
.UMLPackage
;
27 * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
31 public class UML2CompareTestProfilePackageImpl
extends EPackageImpl
implements UML2CompareTestProfilePackage
{
33 * <!-- begin-user-doc --> <!-- end-user-doc -->
37 private EClass aClicheEClass
= null;
40 * <!-- begin-user-doc --> <!-- end-user-doc -->
44 private EClass aCliche2EClass
= null;
47 * <!-- begin-user-doc --> <!-- end-user-doc -->
51 private EClass aCliche3EClass
= null;
54 * Creates an instance of the model <b>Package</b>, registered with
55 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package package URI value.
57 * Note: the correct way to create the package is via the static factory method {@link #init init()},
58 * which also performs initialization of the package, or returns the registered package, if one already
59 * exists. <!-- begin-user-doc --> <!-- end-user-doc -->
61 * @see org.eclipse.emf.ecore.EPackage.Registry
62 * @see org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage#eNS_URI
66 private UML2CompareTestProfilePackageImpl() {
67 super(eNS_URI
, UML2CompareTestProfileFactory
.eINSTANCE
);
71 * <!-- begin-user-doc --> <!-- end-user-doc -->
75 private static boolean isInited
= false;
78 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it
81 * This method is used to initialize {@link UML2CompareTestProfilePackage#eINSTANCE} when that field is
82 * accessed. Clients should not invoke it directly. Instead, they should simply access that field to
83 * obtain the package. <!-- begin-user-doc --> <!-- end-user-doc -->
86 * @see #createPackageContents()
87 * @see #initializePackageContents()
90 public static UML2CompareTestProfilePackage
init() {
92 return (UML2CompareTestProfilePackage
)EPackage
.Registry
.INSTANCE
93 .getEPackage(UML2CompareTestProfilePackage
.eNS_URI
);
95 // Obtain or create and register package
96 UML2CompareTestProfilePackageImpl theUML2CompareTestProfilePackage
= (UML2CompareTestProfilePackageImpl
)(EPackage
.Registry
.INSTANCE
97 .get(eNS_URI
) instanceof UML2CompareTestProfilePackageImpl ? EPackage
.Registry
.INSTANCE
98 .get(eNS_URI
) : new UML2CompareTestProfilePackageImpl());
102 // Initialize simple dependencies
103 UMLPackage
.eINSTANCE
.eClass();
105 // Create package meta-data objects
106 theUML2CompareTestProfilePackage
.createPackageContents();
108 // Initialize created meta-data
109 theUML2CompareTestProfilePackage
.initializePackageContents();
111 // Mark meta-data to indicate it can't be changed
112 theUML2CompareTestProfilePackage
.freeze();
114 // Update the registry and return the package
115 EPackage
.Registry
.INSTANCE
.put(UML2CompareTestProfilePackage
.eNS_URI
,
116 theUML2CompareTestProfilePackage
);
117 return theUML2CompareTestProfilePackage
;
121 * <!-- begin-user-doc --> <!-- end-user-doc -->
125 public EClass
getACliche() {
126 return aClicheEClass
;
130 * <!-- begin-user-doc --> <!-- end-user-doc -->
134 public EAttribute
getACliche_SingleValuedAttribute() {
135 return (EAttribute
)aClicheEClass
.getEStructuralFeatures().get(0);
139 * <!-- begin-user-doc --> <!-- end-user-doc -->
143 public EAttribute
getACliche_ManyValuedAttribute() {
144 return (EAttribute
)aClicheEClass
.getEStructuralFeatures().get(1);
148 * <!-- begin-user-doc --> <!-- end-user-doc -->
152 public EReference
getACliche_SingleValuedReference() {
153 return (EReference
)aClicheEClass
.getEStructuralFeatures().get(2);
157 * <!-- begin-user-doc --> <!-- end-user-doc -->
161 public EReference
getACliche_ManyValuedReference() {
162 return (EReference
)aClicheEClass
.getEStructuralFeatures().get(3);
166 * <!-- begin-user-doc --> <!-- end-user-doc -->
170 public EReference
getACliche_Base_Class() {
171 return (EReference
)aClicheEClass
.getEStructuralFeatures().get(4);
175 * <!-- begin-user-doc --> <!-- end-user-doc -->
179 public EClass
getACliche2() {
180 return aCliche2EClass
;
184 * <!-- begin-user-doc --> <!-- end-user-doc -->
188 public EAttribute
getACliche2_SingleValuedAttribute() {
189 return (EAttribute
)aCliche2EClass
.getEStructuralFeatures().get(0);
193 * <!-- begin-user-doc --> <!-- end-user-doc -->
197 public EAttribute
getACliche2_ManyValuedAttribute() {
198 return (EAttribute
)aCliche2EClass
.getEStructuralFeatures().get(1);
202 * <!-- begin-user-doc --> <!-- end-user-doc -->
206 public EReference
getACliche2_SingleValuedReference() {
207 return (EReference
)aCliche2EClass
.getEStructuralFeatures().get(2);
211 * <!-- begin-user-doc --> <!-- end-user-doc -->
215 public EReference
getACliche2_ManyValuedReference() {
216 return (EReference
)aCliche2EClass
.getEStructuralFeatures().get(3);
220 * <!-- begin-user-doc --> <!-- end-user-doc -->
224 public EReference
getACliche2_Base_Class() {
225 return (EReference
)aCliche2EClass
.getEStructuralFeatures().get(4);
229 * <!-- begin-user-doc --> <!-- end-user-doc -->
233 public EClass
getACliche3() {
234 return aCliche3EClass
;
238 * <!-- begin-user-doc --> <!-- end-user-doc -->
242 public EReference
getACliche3_Base_Class() {
243 return (EReference
)aCliche3EClass
.getEStructuralFeatures().get(0);
247 * <!-- begin-user-doc --> <!-- end-user-doc -->
251 public UML2CompareTestProfileFactory
getUML2CompareTestProfileFactory() {
252 return (UML2CompareTestProfileFactory
)getEFactoryInstance();
256 * <!-- begin-user-doc --> <!-- end-user-doc -->
260 private boolean isCreated
= false;
263 * Creates the meta-model objects for the package. This method is guarded to have no affect on any
264 * invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
268 public void createPackageContents() {
273 // Create classes and their features
274 aClicheEClass
= createEClass(ACLICHE
);
275 createEAttribute(aClicheEClass
, ACLICHE__SINGLE_VALUED_ATTRIBUTE
);
276 createEAttribute(aClicheEClass
, ACLICHE__MANY_VALUED_ATTRIBUTE
);
277 createEReference(aClicheEClass
, ACLICHE__SINGLE_VALUED_REFERENCE
);
278 createEReference(aClicheEClass
, ACLICHE__MANY_VALUED_REFERENCE
);
279 createEReference(aClicheEClass
, ACLICHE__BASE_CLASS
);
281 aCliche2EClass
= createEClass(ACLICHE2
);
282 createEAttribute(aCliche2EClass
, ACLICHE2__SINGLE_VALUED_ATTRIBUTE
);
283 createEAttribute(aCliche2EClass
, ACLICHE2__MANY_VALUED_ATTRIBUTE
);
284 createEReference(aCliche2EClass
, ACLICHE2__SINGLE_VALUED_REFERENCE
);
285 createEReference(aCliche2EClass
, ACLICHE2__MANY_VALUED_REFERENCE
);
286 createEReference(aCliche2EClass
, ACLICHE2__BASE_CLASS
);
288 aCliche3EClass
= createEClass(ACLICHE3
);
289 createEReference(aCliche3EClass
, ACLICHE3__BASE_CLASS
);
293 * <!-- begin-user-doc --> <!-- end-user-doc -->
297 private boolean isInitialized
= false;
300 * Complete the initialization of the package and its meta-model. This method is guarded to have no affect
301 * on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc -->
305 public void initializePackageContents() {
308 isInitialized
= true;
310 // Initialize package
312 setNsPrefix(eNS_PREFIX
);
315 // Obtain other dependent packages
316 TypesPackage theTypesPackage
= (TypesPackage
)EPackage
.Registry
.INSTANCE
317 .getEPackage(TypesPackage
.eNS_URI
);
318 UMLPackage theUMLPackage
= (UMLPackage
)EPackage
.Registry
.INSTANCE
.getEPackage(UMLPackage
.eNS_URI
);
320 // Create type parameters
322 // Set bounds for type parameters
324 // Add supertypes to classes
326 // Initialize classes and features; add operations and parameters
327 initEClass(aClicheEClass
, ACliche
.class,
328 "ACliche", !IS_ABSTRACT
, !IS_INTERFACE
, IS_GENERATED_INSTANCE_CLASS
); //$NON-NLS-1$
330 getACliche_SingleValuedAttribute(),
331 theTypesPackage
.getString(),
332 "singleValuedAttribute", null, 0, 1, ACliche
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_UNSETTABLE
, !IS_ID
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
334 getACliche_ManyValuedAttribute(),
335 theTypesPackage
.getString(),
336 "manyValuedAttribute", null, 0, -1, ACliche
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_UNSETTABLE
, !IS_ID
, IS_UNIQUE
, !IS_DERIVED
, IS_ORDERED
); //$NON-NLS-1$
338 getACliche_SingleValuedReference(),
339 theUMLPackage
.getClass_(),
341 "singleValuedReference", null, 0, 1, ACliche
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
343 getACliche_ManyValuedReference(),
344 theUMLPackage
.getClass_(),
346 "manyValuedReference", null, 0, -1, ACliche
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, IS_ORDERED
); //$NON-NLS-1$
348 getACliche_Base_Class(),
349 theUMLPackage
.getClass_(),
351 "base_Class", null, 1, 1, ACliche
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
353 initEClass(aCliche2EClass
, ACliche2
.class,
354 "ACliche2", !IS_ABSTRACT
, !IS_INTERFACE
, IS_GENERATED_INSTANCE_CLASS
); //$NON-NLS-1$
356 getACliche2_SingleValuedAttribute(),
357 theTypesPackage
.getString(),
358 "singleValuedAttribute", null, 0, 1, ACliche2
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_UNSETTABLE
, !IS_ID
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
360 getACliche2_ManyValuedAttribute(),
361 theTypesPackage
.getString(),
362 "manyValuedAttribute", null, 0, -1, ACliche2
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_UNSETTABLE
, !IS_ID
, IS_UNIQUE
, !IS_DERIVED
, IS_ORDERED
); //$NON-NLS-1$
364 getACliche2_SingleValuedReference(),
365 theUMLPackage
.getClass_(),
367 "singleValuedReference", null, 0, 1, ACliche2
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
369 getACliche2_ManyValuedReference(),
370 theUMLPackage
.getClass_(),
372 "manyValuedReference", null, 0, -1, ACliche2
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, IS_ORDERED
); //$NON-NLS-1$
374 getACliche2_Base_Class(),
375 theUMLPackage
.getClass_(),
377 "base_Class", null, 1, 1, ACliche2
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
379 initEClass(aCliche3EClass
, ACliche3
.class,
380 "ACliche3", !IS_ABSTRACT
, !IS_INTERFACE
, IS_GENERATED_INSTANCE_CLASS
); //$NON-NLS-1$
382 getACliche3_Base_Class(),
383 theUMLPackage
.getClass_(),
385 "base_Class", null, 1, 1, ACliche3
.class, !IS_TRANSIENT
, !IS_VOLATILE
, IS_CHANGEABLE
, !IS_COMPOSITE
, IS_RESOLVE_PROXIES
, !IS_UNSETTABLE
, IS_UNIQUE
, !IS_DERIVED
, !IS_ORDERED
); //$NON-NLS-1$
388 createResource(eNS_URI
);
390 // Create annotations
391 // http://www.eclipse.org/uml2/2.0.0/UML
392 createUMLAnnotations();
396 * Initializes the annotations for <b>http://www.eclipse.org/uml2/2.0.0/UML</b>. <!-- begin-user-doc -->
397 * <!-- end-user-doc -->
401 protected void createUMLAnnotations() {
402 String source
= "http://www.eclipse.org/uml2/2.0.0/UML"; //$NON-NLS-1$
403 addAnnotation(this, source
, new String
[] {"originalName", "UML2CompareTestProfile" //$NON-NLS-1$ //$NON-NLS-2$
407 } // UML2CompareTestProfilePackageImpl