KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > codegen > ecore > genmodel > impl > GenPackageImpl


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2005 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: GenPackageImpl.java,v 1.35 2005/06/29 21:23:56 emerks Exp $
16  */

17 package org.eclipse.emf.codegen.ecore.genmodel.impl;
18
19
20 import java.io.IOException JavaDoc;
21 import java.lang.reflect.InvocationTargetException JavaDoc;
22 import java.util.ArrayList JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.Collections JavaDoc;
25 import java.util.HashMap JavaDoc;
26 import java.util.HashSet JavaDoc;
27 import java.util.Iterator JavaDoc;
28 import java.util.LinkedList JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.Map JavaDoc;
31 import java.util.Set JavaDoc;
32
33 import org.osgi.framework.Bundle;
34
35 import org.eclipse.core.runtime.IPath;
36 import org.eclipse.core.runtime.IProgressMonitor;
37 import org.eclipse.core.runtime.NullProgressMonitor;
38 import org.eclipse.core.runtime.Path;
39 import org.eclipse.core.runtime.Platform;
40 import org.eclipse.core.runtime.SubProgressMonitor;
41
42 import org.eclipse.emf.codegen.ecore.CodeGenEcorePlugin;
43 import org.eclipse.emf.codegen.ecore.Generator;
44 import org.eclipse.emf.codegen.ecore.genmodel.GenBase;
45 import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
46 import org.eclipse.emf.codegen.ecore.genmodel.GenClassifier;
47 import org.eclipse.emf.codegen.ecore.genmodel.GenDataType;
48 import org.eclipse.emf.codegen.ecore.genmodel.GenEnum;
49 import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
50 import org.eclipse.emf.codegen.ecore.genmodel.GenModel;
51 import org.eclipse.emf.codegen.ecore.genmodel.GenModelPackage;
52 import org.eclipse.emf.codegen.ecore.genmodel.GenOperation;
53 import org.eclipse.emf.codegen.ecore.genmodel.GenPackage;
54 import org.eclipse.emf.codegen.ecore.genmodel.GenParameter;
55 import org.eclipse.emf.codegen.ecore.genmodel.GenProviderKind;
56 import org.eclipse.emf.codegen.ecore.genmodel.GenResourceKind;
57 import org.eclipse.emf.codegen.util.CodeGenUtil;
58 import org.eclipse.emf.common.notify.Notification;
59 import org.eclipse.emf.common.notify.NotificationChain;
60 import org.eclipse.emf.common.util.BasicEList;
61 import org.eclipse.emf.common.util.EList;
62 import org.eclipse.emf.common.util.TreeIterator;
63 import org.eclipse.emf.common.util.URI;
64 import org.eclipse.emf.common.util.UniqueEList;
65 import org.eclipse.emf.ecore.EAnnotation;
66 import org.eclipse.emf.ecore.EClass;
67 import org.eclipse.emf.ecore.EClassifier;
68 import org.eclipse.emf.ecore.EDataType;
69 import org.eclipse.emf.ecore.EEnum;
70 import org.eclipse.emf.ecore.EEnumLiteral;
71 import org.eclipse.emf.ecore.EModelElement;
72 import org.eclipse.emf.ecore.EObject;
73 import org.eclipse.emf.ecore.EOperation;
74 import org.eclipse.emf.ecore.EPackage;
75 import org.eclipse.emf.ecore.EParameter;
76 import org.eclipse.emf.ecore.EReference;
77 import org.eclipse.emf.ecore.EStructuralFeature;
78 import org.eclipse.emf.ecore.EcorePackage;
79 import org.eclipse.emf.ecore.InternalEObject;
80 import org.eclipse.emf.ecore.impl.ENotificationImpl;
81 import org.eclipse.emf.ecore.plugin.EcorePlugin;
82 import org.eclipse.emf.ecore.resource.Resource;
83 import org.eclipse.emf.ecore.resource.ResourceSet;
84 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
85 import org.eclipse.emf.ecore.util.EObjectContainmentEList;
86 import org.eclipse.emf.ecore.util.EcoreSwitch;
87 import org.eclipse.emf.ecore.util.EcoreUtil;
88 import org.eclipse.emf.ecore.util.ExtendedMetaData;
89 import org.eclipse.emf.ecore.util.InternalEList;
90
91
92 /**
93  * <!-- begin-user-doc -->
94  * An implementation of the model object '<em><b>Gen Package</b></em>'.
95  * <!-- end-user-doc -->
96  * <p>
97  * The following features are implemented:
98  * <ul>
99  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getPrefix <em>Prefix</em>}</li>
100  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getBasePackage <em>Base Package</em>}</li>
101  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getResource <em>Resource</em>}</li>
102  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#isDisposableProviderFactory <em>Disposable Provider Factory</em>}</li>
103  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#isAdapterFactory <em>Adapter Factory</em>}</li>
104  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#isLoadInitialization <em>Load Initialization</em>}</li>
105  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getInterfacePackageSuffix <em>Interface Package Suffix</em>}</li>
106  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getClassPackageSuffix <em>Class Package Suffix</em>}</li>
107  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getUtilityPackageSuffix <em>Utility Package Suffix</em>}</li>
108  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getProviderPackageSuffix <em>Provider Package Suffix</em>}</li>
109  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getPresentationPackageSuffix <em>Presentation Package Suffix</em>}</li>
110  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getTestsPackageSuffix <em>Tests Package Suffix</em>}</li>
111  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#isGenerateExampleClass <em>Generate Example Class</em>}</li>
112  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getEcorePackage <em>Ecore Package</em>}</li>
113  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getGenModel <em>Gen Model</em>}</li>
114  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getGenEnums <em>Gen Enums</em>}</li>
115  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getGenDataTypes <em>Gen Data Types</em>}</li>
116  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getGenClasses <em>Gen Classes</em>}</li>
117  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getNestedGenPackages <em>Nested Gen Packages</em>}</li>
118  * <li>{@link org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl#getGenClassifiers <em>Gen Classifiers</em>}</li>
119  * </ul>
120  * </p>
121  *
122  * @generated
123  */

124 public class GenPackageImpl extends GenBaseImpl implements GenPackage
125 {
126   protected static final String JavaDoc XSD2ECORE_URI = "http:///org/eclipse/emf/mapping/xsd2ecore/XSD2Ecore";
127
128   /**
129    * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
130    * <!-- begin-user-doc -->
131    * <!-- end-user-doc -->
132    * @see #getPrefix()
133    * @generated
134    * @ordered
135    */

136   protected static final String JavaDoc PREFIX_EDEFAULT = null;
137
138   /**
139    * The cached value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
140    * <!-- begin-user-doc -->
141    * <!-- end-user-doc -->
142    * @see #getPrefix()
143    * @generated
144    * @ordered
145    */

146   protected String JavaDoc prefix = PREFIX_EDEFAULT;
147
148   /**
149    * The default value of the '{@link #getBasePackage() <em>Base Package</em>}' attribute.
150    * <!-- begin-user-doc -->
151    * <!-- end-user-doc -->
152    * @see #getBasePackage()
153    * @generated
154    * @ordered
155    */

156   protected static final String JavaDoc BASE_PACKAGE_EDEFAULT = null;
157
158   /**
159    * The cached value of the '{@link #getBasePackage() <em>Base Package</em>}' attribute.
160    * <!-- begin-user-doc -->
161    * <!-- end-user-doc -->
162    * @see #getBasePackage()
163    * @generated
164    * @ordered
165    */

166   protected String JavaDoc basePackage = BASE_PACKAGE_EDEFAULT;
167
168   /**
169    * The default value of the '{@link #getResource() <em>Resource</em>}' attribute.
170    * <!-- begin-user-doc -->
171    * <!-- end-user-doc -->
172    * @see #getResource()
173    * @generated
174    * @ordered
175    */

176   protected static final GenResourceKind RESOURCE_EDEFAULT = GenResourceKind.NONE_LITERAL;
177
178   /**
179    * The cached value of the '{@link #getResource() <em>Resource</em>}' attribute.
180    * <!-- begin-user-doc -->
181    * <!-- end-user-doc -->
182    * @see #getResource()
183    * @generated
184    * @ordered
185    */

186   protected GenResourceKind resource = RESOURCE_EDEFAULT;
187
188   /**
189    * The default value of the '{@link #isDisposableProviderFactory() <em>Disposable Provider Factory</em>}' attribute.
190    * <!-- begin-user-doc -->
191    * <!-- end-user-doc -->
192    * @see #isDisposableProviderFactory()
193    * @generated
194    * @ordered
195    */

196   protected static final boolean DISPOSABLE_PROVIDER_FACTORY_EDEFAULT = false;
197
198   /**
199    * The cached value of the '{@link #isDisposableProviderFactory() <em>Disposable Provider Factory</em>}' attribute.
200    * <!-- begin-user-doc -->
201    * <!-- end-user-doc -->
202    * @see #isDisposableProviderFactory()
203    * @generated
204    * @ordered
205    */

206   protected boolean disposableProviderFactory = DISPOSABLE_PROVIDER_FACTORY_EDEFAULT;
207
208   /**
209    * The default value of the '{@link #isAdapterFactory() <em>Adapter Factory</em>}' attribute.
210    * <!-- begin-user-doc -->
211    * <!-- end-user-doc -->
212    * @see #isAdapterFactory()
213    * @generated
214    * @ordered
215    */

216   protected static final boolean ADAPTER_FACTORY_EDEFAULT = true;
217
218   /**
219    * The cached value of the '{@link #isAdapterFactory() <em>Adapter Factory</em>}' attribute.
220    * <!-- begin-user-doc -->
221    * <!-- end-user-doc -->
222    * @see #isAdapterFactory()
223    * @generated
224    * @ordered
225    */

226   protected boolean adapterFactory = ADAPTER_FACTORY_EDEFAULT;
227
228   /**
229    * The default value of the '{@link #isLoadInitialization() <em>Load Initialization</em>}' attribute.
230    * <!-- begin-user-doc -->
231    * <!-- end-user-doc -->
232    * @see #isLoadInitialization()
233    * @generated
234    * @ordered
235    */

236   protected static final boolean LOAD_INITIALIZATION_EDEFAULT = false;
237
238   /**
239    * The cached value of the '{@link #isLoadInitialization() <em>Load Initialization</em>}' attribute.
240    * <!-- begin-user-doc -->
241    * <!-- end-user-doc -->
242    * @see #isLoadInitialization()
243    * @generated
244    * @ordered
245    */

246   protected boolean loadInitialization = LOAD_INITIALIZATION_EDEFAULT;
247
248   /**
249    * The default value of the '{@link #getInterfacePackageSuffix() <em>Interface Package Suffix</em>}' attribute.
250    * <!-- begin-user-doc -->
251    * <!-- end-user-doc -->
252    * @see #getInterfacePackageSuffix()
253    * @generated
254    * @ordered
255    */

256   protected static final String JavaDoc INTERFACE_PACKAGE_SUFFIX_EDEFAULT = "";
257
258   /**
259    * The cached value of the '{@link #getInterfacePackageSuffix() <em>Interface Package Suffix</em>}' attribute.
260    * <!-- begin-user-doc -->
261    * <!-- end-user-doc -->
262    * @see #getInterfacePackageSuffix()
263    * @generated
264    * @ordered
265    */

266   protected String JavaDoc interfacePackageSuffix = INTERFACE_PACKAGE_SUFFIX_EDEFAULT;
267
268   /**
269    * The default value of the '{@link #getClassPackageSuffix() <em>Class Package Suffix</em>}' attribute.
270    * <!-- begin-user-doc -->
271    * <!-- end-user-doc -->
272    * @see #getClassPackageSuffix()
273    * @generated
274    * @ordered
275    */

276   protected static final String JavaDoc CLASS_PACKAGE_SUFFIX_EDEFAULT = "impl";
277
278   /**
279    * The cached value of the '{@link #getClassPackageSuffix() <em>Class Package Suffix</em>}' attribute.
280    * <!-- begin-user-doc -->
281    * <!-- end-user-doc -->
282    * @see #getClassPackageSuffix()
283    * @generated
284    * @ordered
285    */

286   protected String JavaDoc classPackageSuffix = CLASS_PACKAGE_SUFFIX_EDEFAULT;
287
288   /**
289    * The default value of the '{@link #getUtilityPackageSuffix() <em>Utility Package Suffix</em>}' attribute.
290    * <!-- begin-user-doc -->
291    * <!-- end-user-doc -->
292    * @see #getUtilityPackageSuffix()
293    * @generated
294    * @ordered
295    */

296   protected static final String JavaDoc UTILITY_PACKAGE_SUFFIX_EDEFAULT = "util";
297
298   /**
299    * The cached value of the '{@link #getUtilityPackageSuffix() <em>Utility Package Suffix</em>}' attribute.
300    * <!-- begin-user-doc -->
301    * <!-- end-user-doc -->
302    * @see #getUtilityPackageSuffix()
303    * @generated
304    * @ordered
305    */

306   protected String JavaDoc utilityPackageSuffix = UTILITY_PACKAGE_SUFFIX_EDEFAULT;
307
308   /**
309    * The default value of the '{@link #getProviderPackageSuffix() <em>Provider Package Suffix</em>}' attribute.
310    * <!-- begin-user-doc -->
311    * <!-- end-user-doc -->
312    * @see #getProviderPackageSuffix()
313    * @generated
314    * @ordered
315    */

316   protected static final String JavaDoc PROVIDER_PACKAGE_SUFFIX_EDEFAULT = "provider";
317
318   /**
319    * The cached value of the '{@link #getProviderPackageSuffix() <em>Provider Package Suffix</em>}' attribute.
320    * <!-- begin-user-doc -->
321    * <!-- end-user-doc -->
322    * @see #getProviderPackageSuffix()
323    * @generated
324    * @ordered
325    */

326   protected String JavaDoc providerPackageSuffix = PROVIDER_PACKAGE_SUFFIX_EDEFAULT;
327
328   /**
329    * The default value of the '{@link #getPresentationPackageSuffix() <em>Presentation Package Suffix</em>}' attribute.
330    * <!-- begin-user-doc -->
331    * <!-- end-user-doc -->
332    * @see #getPresentationPackageSuffix()
333    * @generated
334    * @ordered
335    */

336   protected static final String JavaDoc PRESENTATION_PACKAGE_SUFFIX_EDEFAULT = "presentation";
337
338   /**
339    * The cached value of the '{@link #getPresentationPackageSuffix() <em>Presentation Package Suffix</em>}' attribute.
340    * <!-- begin-user-doc -->
341    * <!-- end-user-doc -->
342    * @see #getPresentationPackageSuffix()
343    * @generated
344    * @ordered
345    */

346   protected String JavaDoc presentationPackageSuffix = PRESENTATION_PACKAGE_SUFFIX_EDEFAULT;
347
348   /**
349    * The default value of the '{@link #getTestsPackageSuffix() <em>Tests Package Suffix</em>}' attribute.
350    * <!-- begin-user-doc -->
351    * <!-- end-user-doc -->
352    * @see #getTestsPackageSuffix()
353    * @generated
354    * @ordered
355    */

356   protected static final String JavaDoc TESTS_PACKAGE_SUFFIX_EDEFAULT = "tests";
357
358   /**
359    * The cached value of the '{@link #getTestsPackageSuffix() <em>Tests Package Suffix</em>}' attribute.
360    * <!-- begin-user-doc -->
361    * <!-- end-user-doc -->
362    * @see #getTestsPackageSuffix()
363    * @generated
364    * @ordered
365    */

366   protected String JavaDoc testsPackageSuffix = TESTS_PACKAGE_SUFFIX_EDEFAULT;
367
368   /**
369    * The default value of the '{@link #isGenerateExampleClass() <em>Generate Example Class</em>}' attribute.
370    * <!-- begin-user-doc -->
371    * <!-- end-user-doc -->
372    * @see #isGenerateExampleClass()
373    * @generated
374    * @ordered
375    */

376   protected static final boolean GENERATE_EXAMPLE_CLASS_EDEFAULT = true;
377
378   /**
379    * The cached value of the '{@link #isGenerateExampleClass() <em>Generate Example Class</em>}' attribute.
380    * <!-- begin-user-doc -->
381    * <!-- end-user-doc -->
382    * @see #isGenerateExampleClass()
383    * @generated
384    * @ordered
385    */

386   protected boolean generateExampleClass = GENERATE_EXAMPLE_CLASS_EDEFAULT;
387
388   /**
389    * The cached value of the '{@link #getEcorePackage() <em>Ecore Package</em>}' reference.
390    * <!-- begin-user-doc -->
391    * <!-- end-user-doc -->
392    * @see #getEcorePackage()
393    * @generated
394    * @ordered
395    */

396   protected EPackage ecorePackage = null;
397
398   /**
399    * The cached value of the '{@link #getGenEnums() <em>Gen Enums</em>}' containment reference list.
400    * <!-- begin-user-doc -->
401    * <!-- end-user-doc -->
402    * @see #getGenEnums()
403    * @generated
404    * @ordered
405    */

406   protected EList genEnums = null;
407
408   /**
409    * The cached value of the '{@link #getGenDataTypes() <em>Gen Data Types</em>}' containment reference list.
410    * <!-- begin-user-doc -->
411    * <!-- end-user-doc -->
412    * @see #getGenDataTypes()
413    * @generated
414    * @ordered
415    */

416   protected EList genDataTypes = null;
417
418   /**
419    * The cached value of the '{@link #getGenClasses() <em>Gen Classes</em>}' containment reference list.
420    * <!-- begin-user-doc -->
421    * <!-- end-user-doc -->
422    * @see #getGenClasses()
423    * @generated
424    * @ordered
425    */

426   protected EList genClasses = null;
427
428   /**
429    * The cached value of the '{@link #getNestedGenPackages() <em>Nested Gen Packages</em>}' containment reference list.
430    * <!-- begin-user-doc -->
431    * <!-- end-user-doc -->
432    * @see #getNestedGenPackages()
433    * @generated
434    * @ordered
435    */

436   protected EList nestedGenPackages = null;
437
438   /**
439    * <!-- begin-user-doc -->
440    * <!-- end-user-doc -->
441    * @generated modifiable
442    */

443   protected GenPackageImpl()
444   {
445     super();
446   }
447
448   /**
449    * <!-- begin-user-doc -->
450    * <!-- end-user-doc -->
451    * @generated
452    */

453   protected EClass eStaticClass()
454   {
455     return GenModelPackage.eINSTANCE.getGenPackage();
456   }
457
458   /**
459    * <!-- begin-user-doc -->
460    * <!-- end-user-doc -->
461    * @generated
462    */

463   public String JavaDoc getPrefixGen()
464   {
465     return prefix;
466   }
467
468   public String JavaDoc getPrefix()
469   {
470     if (getPrefixGen() != null)
471     {
472       return getPrefixGen();
473     }
474     return "";
475   }
476
477   /**
478    * <!-- begin-user-doc -->
479    * <!-- end-user-doc -->
480    * @generated
481    */

482   public void setPrefix(String JavaDoc newPrefix)
483   {
484     String JavaDoc oldPrefix = prefix;
485     prefix = newPrefix;
486     if (eNotificationRequired())
487       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__PREFIX, oldPrefix, prefix));
488   }
489
490   /**
491    * <!-- begin-user-doc -->
492    * <!-- end-user-doc -->
493    * @generated
494    */

495   public String JavaDoc getBasePackageGen()
496   {
497     return basePackage;
498   }
499
500   public String JavaDoc getBasePackage()
501   {
502     // If the base package isn't set but there is a parent package, us it's information instead.
503
//
504
String JavaDoc result = getBasePackageGen();
505     if (isBlank(result))
506     {
507       EObject container = eContainer();
508       result = container instanceof GenPackage ? ((GenPackage)container).getQualifiedPackageName() : null;
509     }
510     return result;
511   }
512
513   /**
514    * <!-- begin-user-doc -->
515    * <!-- end-user-doc -->
516    * @generated
517    */

518   public void setBasePackage(String JavaDoc newBasePackage)
519   {
520     String JavaDoc oldBasePackage = basePackage;
521     basePackage = newBasePackage;
522     if (eNotificationRequired())
523       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__BASE_PACKAGE, oldBasePackage, basePackage));
524   }
525
526   /**
527    * <!-- begin-user-doc -->
528    * <!-- end-user-doc -->
529    * @generated
530    */

531   public GenResourceKind getResource()
532   {
533     return resource;
534   }
535
536   /**
537    * <!-- begin-user-doc -->
538    * <!-- end-user-doc -->
539    * @generated
540    */

541   public void setResource(GenResourceKind newResource)
542   {
543     GenResourceKind oldResource = resource;
544     resource = newResource == null ? RESOURCE_EDEFAULT : newResource;
545     if (eNotificationRequired())
546       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__RESOURCE, oldResource, resource));
547   }
548
549   /**
550    * <!-- begin-user-doc -->
551    * <!-- end-user-doc -->
552    * @generated
553    */

554   public boolean isDisposableProviderFactory()
555   {
556     return disposableProviderFactory;
557   }
558
559   /**
560    * <!-- begin-user-doc -->
561    * <!-- end-user-doc -->
562    * @generated
563    */

564   public void setDisposableProviderFactory(boolean newDisposableProviderFactory)
565   {
566     boolean oldDisposableProviderFactory = disposableProviderFactory;
567     disposableProviderFactory = newDisposableProviderFactory;
568     if (eNotificationRequired())
569       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__DISPOSABLE_PROVIDER_FACTORY, oldDisposableProviderFactory, disposableProviderFactory));
570   }
571
572   /**
573    * <!-- begin-user-doc -->
574    * <!-- end-user-doc -->
575    * @generated
576    */

577   public boolean isAdapterFactory()
578   {
579     return adapterFactory;
580   }
581
582   /**
583    * <!-- begin-user-doc -->
584    * <!-- end-user-doc -->
585    * @generated
586    */

587   public void setAdapterFactory(boolean newAdapterFactory)
588   {
589     boolean oldAdapterFactory = adapterFactory;
590     adapterFactory = newAdapterFactory;
591     if (eNotificationRequired())
592       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__ADAPTER_FACTORY, oldAdapterFactory, adapterFactory));
593   }
594
595   /**
596    * <!-- begin-user-doc -->
597    * <!-- end-user-doc -->
598    * @generated
599    */

600   public boolean isLoadInitialization()
601   {
602     return loadInitialization;
603   }
604
605   /**
606    * <!-- begin-user-doc -->
607    * <!-- end-user-doc -->
608    * @generated
609    */

610   public void setLoadInitialization(boolean newLoadInitialization)
611   {
612     boolean oldLoadInitialization = loadInitialization;
613     loadInitialization = newLoadInitialization;
614     if (eNotificationRequired())
615       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__LOAD_INITIALIZATION, oldLoadInitialization, loadInitialization));
616   }
617
618   /**
619    * <!-- begin-user-doc -->
620    * <!-- end-user-doc -->
621    * @generated
622    */

623   public String JavaDoc getInterfacePackageSuffix()
624   {
625     return interfacePackageSuffix;
626   }
627
628   /**
629    * <!-- begin-user-doc -->
630    * <!-- end-user-doc -->
631    * @generated
632    */

633   public void setInterfacePackageSuffix(String JavaDoc newInterfacePackageSuffix)
634   {
635     String JavaDoc oldInterfacePackageSuffix = interfacePackageSuffix;
636     interfacePackageSuffix = newInterfacePackageSuffix;
637     if (eNotificationRequired())
638       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__INTERFACE_PACKAGE_SUFFIX, oldInterfacePackageSuffix, interfacePackageSuffix));
639   }
640
641   /**
642    * <!-- begin-user-doc -->
643    * <!-- end-user-doc -->
644    * @generated
645    */

646   public String JavaDoc getClassPackageSuffix()
647   {
648     return classPackageSuffix;
649   }
650
651   /**
652    * <!-- begin-user-doc -->
653    * <!-- end-user-doc -->
654    * @generated
655    */

656   public void setClassPackageSuffix(String JavaDoc newClassPackageSuffix)
657   {
658     String JavaDoc oldClassPackageSuffix = classPackageSuffix;
659     classPackageSuffix = newClassPackageSuffix;
660     if (eNotificationRequired())
661       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__CLASS_PACKAGE_SUFFIX, oldClassPackageSuffix, classPackageSuffix));
662   }
663
664   /**
665    * <!-- begin-user-doc -->
666    * <!-- end-user-doc -->
667    * @generated
668    */

669   public String JavaDoc getUtilityPackageSuffix()
670   {
671     return utilityPackageSuffix;
672   }
673
674   /**
675    * <!-- begin-user-doc -->
676    * <!-- end-user-doc -->
677    * @generated
678    */

679   public void setUtilityPackageSuffix(String JavaDoc newUtilityPackageSuffix)
680   {
681     String JavaDoc oldUtilityPackageSuffix = utilityPackageSuffix;
682     utilityPackageSuffix = newUtilityPackageSuffix;
683     if (eNotificationRequired())
684       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__UTILITY_PACKAGE_SUFFIX, oldUtilityPackageSuffix, utilityPackageSuffix));
685   }
686
687   /**
688    * <!-- begin-user-doc -->
689    * <!-- end-user-doc -->
690    * @generated
691    */

692   public String JavaDoc getProviderPackageSuffix()
693   {
694     return providerPackageSuffix;
695   }
696
697   /**
698    * <!-- begin-user-doc -->
699    * <!-- end-user-doc -->
700    * @generated
701    */

702   public void setProviderPackageSuffix(String JavaDoc newProviderPackageSuffix)
703   {
704     String JavaDoc oldProviderPackageSuffix = providerPackageSuffix;
705     providerPackageSuffix = newProviderPackageSuffix;
706     if (eNotificationRequired())
707       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__PROVIDER_PACKAGE_SUFFIX, oldProviderPackageSuffix, providerPackageSuffix));
708   }
709
710   /**
711    * <!-- begin-user-doc -->
712    * <!-- end-user-doc -->
713    * @generated
714    */

715   public String JavaDoc getPresentationPackageSuffix()
716   {
717     return presentationPackageSuffix;
718   }
719
720   /**
721    * <!-- begin-user-doc -->
722    * <!-- end-user-doc -->
723    * @generated
724    */

725   public void setPresentationPackageSuffix(String JavaDoc newPresentationPackageSuffix)
726   {
727     String JavaDoc oldPresentationPackageSuffix = presentationPackageSuffix;
728     presentationPackageSuffix = newPresentationPackageSuffix;
729     if (eNotificationRequired())
730       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__PRESENTATION_PACKAGE_SUFFIX, oldPresentationPackageSuffix, presentationPackageSuffix));
731   }
732
733   /**
734    * <!-- begin-user-doc -->
735    * <!-- end-user-doc -->
736    * @generated
737    */

738   public String JavaDoc getTestsPackageSuffix()
739   {
740     return testsPackageSuffix;
741   }
742
743   /**
744    * <!-- begin-user-doc -->
745    * <!-- end-user-doc -->
746    * @generated
747    */

748   public void setTestsPackageSuffix(String JavaDoc newTestsPackageSuffix)
749   {
750     String JavaDoc oldTestsPackageSuffix = testsPackageSuffix;
751     testsPackageSuffix = newTestsPackageSuffix;
752     if (eNotificationRequired())
753       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__TESTS_PACKAGE_SUFFIX, oldTestsPackageSuffix, testsPackageSuffix));
754   }
755
756   /**
757    * <!-- begin-user-doc -->
758    * <!-- end-user-doc -->
759    * @generated
760    */

761   public boolean isGenerateExampleClass()
762   {
763     return generateExampleClass;
764   }
765
766   /**
767    * <!-- begin-user-doc -->
768    * <!-- end-user-doc -->
769    * @generated
770    */

771   public void setGenerateExampleClass(boolean newGenerateExampleClass)
772   {
773     boolean oldGenerateExampleClass = generateExampleClass;
774     generateExampleClass = newGenerateExampleClass;
775     if (eNotificationRequired())
776       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__GENERATE_EXAMPLE_CLASS, oldGenerateExampleClass, generateExampleClass));
777   }
778
779   public EModelElement getEcoreModelElement()
780   {
781     return getEcorePackage();
782   }
783
784   /**
785    * <!-- begin-user-doc -->
786    * <!-- end-user-doc -->
787    * @generated
788    */

789   public EPackage getEcorePackage()
790   {
791     if (ecorePackage != null && ecorePackage.eIsProxy())
792     {
793       EPackage oldEcorePackage = ecorePackage;
794       ecorePackage = (EPackage)eResolveProxy((InternalEObject)ecorePackage);
795       if (ecorePackage != oldEcorePackage)
796       {
797         if (eNotificationRequired())
798           eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenModelPackage.GEN_PACKAGE__ECORE_PACKAGE, oldEcorePackage, ecorePackage));
799       }
800     }
801     return ecorePackage;
802   }
803
804   /**
805    * <!-- begin-user-doc -->
806    * <!-- end-user-doc -->
807    * @generated
808    */

809   public EPackage basicGetEcorePackage()
810   {
811     return ecorePackage;
812   }
813
814   /**
815    * <!-- begin-user-doc -->
816    * <!-- end-user-doc -->
817    * @generated
818    */

819   public void setEcorePackage(EPackage newEcorePackage)
820   {
821     EPackage oldEcorePackage = ecorePackage;
822     ecorePackage = newEcorePackage;
823     if (eNotificationRequired())
824       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__ECORE_PACKAGE, oldEcorePackage, ecorePackage));
825   }
826
827   public GenModel getGenModel()
828   {
829     GenModel result = getGenModelGen();
830     if (result == null && eContainer() != null)
831     {
832       result = ((GenBase)eContainer()).getGenModel();
833     }
834
835     return result;
836   }
837
838   /**
839    * <!-- begin-user-doc -->
840    * <!-- end-user-doc -->
841    * @generated
842    */

843   public GenModel getGenModelGen()
844   {
845     if (eContainerFeatureID != GenModelPackage.GEN_PACKAGE__GEN_MODEL) return null;
846     return (GenModel)eContainer;
847   }
848
849   /**
850    * <!-- begin-user-doc -->
851    * <!-- end-user-doc -->
852    * @generated
853    */

854   public void setGenModel(GenModel newGenModel)
855   {
856     if (newGenModel != eContainer || (eContainerFeatureID != GenModelPackage.GEN_PACKAGE__GEN_MODEL && newGenModel != null))
857     {
858       if (EcoreUtil.isAncestor(this, newGenModel))
859         throw new IllegalArgumentException JavaDoc("Recursive containment not allowed for " + toString());
860       NotificationChain msgs = null;
861       if (eContainer != null)
862         msgs = eBasicRemoveFromContainer(msgs);
863       if (newGenModel != null)
864         msgs = ((InternalEObject)newGenModel).eInverseAdd(this, GenModelPackage.GEN_MODEL__GEN_PACKAGES, GenModel.class, msgs);
865       msgs = eBasicSetContainer((InternalEObject)newGenModel, GenModelPackage.GEN_PACKAGE__GEN_MODEL, msgs);
866       if (msgs != null) msgs.dispatch();
867     }
868     else if (eNotificationRequired())
869       eNotify(new ENotificationImpl(this, Notification.SET, GenModelPackage.GEN_PACKAGE__GEN_MODEL, newGenModel, newGenModel));
870   }
871
872   /**
873    * <!-- begin-user-doc -->
874    * <!-- end-user-doc -->
875    * @generated
876    */

877   public EList getGenEnums()
878   {
879     if (genEnums == null)
880     {
881       genEnums = new EObjectContainmentEList(GenEnum.class, this, GenModelPackage.GEN_PACKAGE__GEN_ENUMS);
882     }
883     return genEnums;
884   }
885
886   /**
887    * <!-- begin-user-doc -->
888    * <!-- end-user-doc -->
889    * @generated
890    */

891   public EList getGenDataTypes()
892   {
893     if (genDataTypes == null)
894     {
895       genDataTypes = new EObjectContainmentEList(GenDataType.class, this, GenModelPackage.GEN_PACKAGE__GEN_DATA_TYPES);
896     }
897     return genDataTypes;
898   }
899
900   /**
901    * <!-- begin-user-doc -->
902    * <!-- end-user-doc -->
903    * @generated
904    */

905   public EList getGenClasses()
906   {
907     if (genClasses == null)
908     {
909       genClasses = new EObjectContainmentEList(GenClass.class, this, GenModelPackage.GEN_PACKAGE__GEN_CLASSES);
910     }
911     return genClasses;
912   }
913
914   /**
915    * <!-- begin-user-doc -->
916    * <!-- end-user-doc -->
917    * @generated
918    */

919   public EList getNestedGenPackages()
920   {
921     if (nestedGenPackages == null)
922     {
923       nestedGenPackages = new EObjectContainmentEList(GenPackage.class, this, GenModelPackage.GEN_PACKAGE__NESTED_GEN_PACKAGES);
924     }
925     return nestedGenPackages;
926   }
927
928   /**
929    * <!-- begin-user-doc -->
930    * <!-- end-user-doc -->
931    * @generated modifiable
932    */

933   public EList getGenClassifiers()
934   {
935     EList result = new BasicEList();
936     result.addAll(getGenClasses());
937     result.addAll(getGenEnums());
938     result.addAll(getGenDataTypes());
939     return result;
940   }
941
942   /**
943    * <!-- begin-user-doc -->
944    * <!-- end-user-doc -->
945    * @generated
946    */

947   public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs)
948   {
949     if (featureID >= 0)
950     {
951       switch (eDerivedStructuralFeatureID(featureID, baseClass))
952       {
953         case GenModelPackage.GEN_PACKAGE__GEN_MODEL:
954           if (eContainer != null)
955             msgs = eBasicRemoveFromContainer(msgs);
956           return eBasicSetContainer(otherEnd, GenModelPackage.GEN_PACKAGE__GEN_MODEL, msgs);
957         default:
958           return eDynamicInverseAdd(otherEnd, featureID, baseClass, msgs);
959       }
960     }
961     if (eContainer != null)
962       msgs = eBasicRemoveFromContainer(msgs);
963     return eBasicSetContainer(otherEnd, featureID, msgs);
964   }
965
966   /**
967    * <!-- begin-user-doc -->
968    * <!-- end-user-doc -->
969    * @generated
970    */

971   public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class JavaDoc baseClass, NotificationChain msgs)
972   {
973     if (featureID >= 0)
974     {
975       switch (eDerivedStructuralFeatureID(featureID, baseClass))
976       {
977         case GenModelPackage.GEN_PACKAGE__GEN_MODEL:
978           return eBasicSetContainer(null, GenModelPackage.GEN_PACKAGE__GEN_MODEL, msgs);
979         case GenModelPackage.GEN_PACKAGE__GEN_ENUMS:
980           return ((InternalEList)getGenEnums()).basicRemove(otherEnd, msgs);
981         case GenModelPackage.GEN_PACKAGE__GEN_DATA_TYPES:
982           return ((InternalEList)getGenDataTypes()).basicRemove(otherEnd, msgs);
983         case GenModelPackage.GEN_PACKAGE__GEN_CLASSES:
984           return ((InternalEList)getGenClasses()).basicRemove(otherEnd, msgs);
985         case GenModelPackage.GEN_PACKAGE__NESTED_GEN_PACKAGES:
986           return ((InternalEList)getNestedGenPackages()).basicRemove(otherEnd, msgs);
987         default:
988           return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs);
989       }
990     }
991     return eBasicSetContainer(null, featureID, msgs);
992   }
993
994   /**
995    * <!-- begin-user-doc -->
996    * <!-- end-user-doc -->
997    * @generated
998    */

999   public NotificationChain eBasicRemoveFromContainer(NotificationChain msgs)
1000  {
1001    if (eContainerFeatureID >= 0)
1002    {
1003      switch (eContainerFeatureID)
1004      {
1005        case GenModelPackage.GEN_PACKAGE__GEN_MODEL:
1006          return eContainer.eInverseRemove(this, GenModelPackage.GEN_MODEL__GEN_PACKAGES, GenModel.class, msgs);
1007        default:
1008      &nb