@typemf/core 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -51,9 +51,12 @@ __export(index_exports, {
51
51
  ResourceImpl: () => ResourceImpl,
52
52
  ResourceSetImpl: () => ResourceSetImpl,
53
53
  URI: () => URI,
54
+ UnmodifiableEList: () => UnmodifiableEList,
54
55
  UriConverterRegistryImpl: () => UriConverterRegistryImpl,
55
56
  associateRoot: () => associateRoot,
56
57
  computeFragment: () => computeFragment,
58
+ convertToString: () => convertToString,
59
+ createFromString: () => createFromString,
57
60
  createInstanceOf: () => createInstanceOf,
58
61
  createProxy: () => createProxy,
59
62
  detailValue: () => detailValue,
@@ -139,6 +142,13 @@ var BasicEList = class {
139
142
  const removed = this.items.splice(0, this.items.length);
140
143
  for (const item of removed) this.onRemoved(item, 0);
141
144
  }
145
+ move(fromIndex, toIndex) {
146
+ const item = this.get(fromIndex);
147
+ this.items.splice(fromIndex, 1);
148
+ this.items.splice(toIndex, 0, item);
149
+ this.onMoved(item, fromIndex, toIndex);
150
+ return item;
151
+ }
142
152
  contains(item) {
143
153
  return this.items.includes(item);
144
154
  }
@@ -169,27 +179,19 @@ var BasicEList = class {
169
179
  [Symbol.iterator]() {
170
180
  return this.items[Symbol.iterator]();
171
181
  }
172
- /**
173
- * Internal - adds without containment/opposite side effects. Used by
174
- * EObjectImpl when this list is the *other* end of a change whose
175
- * bookkeeping is already being handled.
176
- */
182
+ /** @internal Adds without containment, opposite or notification side effects. */
177
183
  basicAdd(item) {
178
184
  if (this.rejectsDuplicate(item)) return;
179
185
  this.items.push(item);
180
186
  }
181
- /** Internal - removes without containment/opposite side effects. */
187
+ /** @internal Removes without containment, opposite or notification side effects. */
182
188
  basicRemove(item) {
183
189
  const index = this.items.indexOf(item);
184
190
  if (index === -1) return false;
185
191
  this.items.splice(index, 1);
186
192
  return true;
187
193
  }
188
- /**
189
- * Reference lists are always unique (as in EMF): re-adding a member is a
190
- * no-op rather than a duplicate entry, which is also what keeps
191
- * inverse-add from double-inserting.
192
- */
194
+ /** Reference lists are unique, as in EMF: adding an element already present does nothing. */
193
195
  rejectsDuplicate(item) {
194
196
  return !!this.feature && isReference(this.feature) && this.items.includes(item);
195
197
  }
@@ -223,36 +225,104 @@ var BasicEList = class {
223
225
  });
224
226
  }
225
227
  }
228
+ /**
229
+ * Notifies a `MOVE`; the element stays in the list, so containers and opposites are unchanged.
230
+ */
231
+ onMoved(item, fromIndex, toIndex) {
232
+ if (!this.owner || !this.feature) return;
233
+ this.owner.eNotify({
234
+ eventType: "MOVE",
235
+ notifier: this.owner,
236
+ feature: this.feature,
237
+ oldValue: fromIndex,
238
+ newValue: item,
239
+ position: toIndex,
240
+ wasSet: true
241
+ });
242
+ }
226
243
  };
227
244
  function isReference(feature) {
228
245
  return "isContainment" in feature;
229
246
  }
230
247
 
248
+ // src/metamodel/impl/UnmodifiableEList.ts
249
+ var UnmodifiableEList = class extends BasicEList {
250
+ sealed = false;
251
+ constructor(items) {
252
+ super(void 0, void 0, items);
253
+ this.sealed = true;
254
+ }
255
+ /** @throws Error always. */
256
+ add(item) {
257
+ this.rejectChange();
258
+ super.add(item);
259
+ }
260
+ /** @throws Error always. */
261
+ addAt(index, item) {
262
+ this.rejectChange();
263
+ super.addAt(index, item);
264
+ }
265
+ /** @throws Error always. */
266
+ addAll(items) {
267
+ this.rejectChange();
268
+ super.addAll(items);
269
+ }
270
+ /** @throws Error always. */
271
+ remove(item) {
272
+ this.rejectChange();
273
+ return super.remove(item);
274
+ }
275
+ /** @throws Error always. */
276
+ removeAt(index) {
277
+ this.rejectChange();
278
+ return super.removeAt(index);
279
+ }
280
+ /** @throws Error always. */
281
+ clear() {
282
+ this.rejectChange();
283
+ super.clear();
284
+ }
285
+ /** @throws Error always. */
286
+ move(fromIndex, toIndex) {
287
+ this.rejectChange();
288
+ return super.move(fromIndex, toIndex);
289
+ }
290
+ /** @internal */
291
+ basicAdd(item) {
292
+ this.rejectChange();
293
+ super.basicAdd(item);
294
+ }
295
+ /** @internal */
296
+ basicRemove(item) {
297
+ this.rejectChange();
298
+ return super.basicRemove(item);
299
+ }
300
+ rejectChange() {
301
+ if (this.sealed) throw new Error("This list is computed and cannot be modified.");
302
+ }
303
+ };
304
+
231
305
  // src/metamodel/impl/EObjectImpl.ts
232
306
  var fallbackIdCounter = 0;
307
+ function findRoot(obj) {
308
+ let current = obj;
309
+ let container = current.eContainer();
310
+ while (container) {
311
+ current = container;
312
+ container = current.eContainer();
313
+ }
314
+ return current;
315
+ }
233
316
  var EObjectImpl = class _EObjectImpl {
234
317
  _eContainer;
235
318
  _eContainingFeature;
236
319
  _eProxy = false;
237
320
  frozen = false;
321
+ /** Set only on a root of a resource's contents; other objects find their resource via their root. */
322
+ _eDirectResource;
238
323
  /**
239
- * Marks this object (and, recursively, everything it contains) as no longer intended to be
240
- * mutated. Matches real EMF's own design precisely: a queryable flag, not enforced in every
241
- * setter. Real EMF's own enforcement is a single `assert !isFrozen()` in one place
242
- * (eSetDirectResource) - a mechanism that is itself frequently inactive in production Java
243
- * (assertions are off by default unless -ea is passed). Given that, invasively guarding every
244
- * setter here would be enforcing something more strictly than the system being ported actually
245
- * does.
246
- *
247
- * Lives here, on EObjectImpl - the one foundational file the self-hosted swap never overwrites
248
- * - rather than as per-class overrides on EClassImpl/EEnumImpl/EPackageImpl the way hand-written
249
- * core originally had it (those files are generated now). The cascade itself is generic and
250
- * reflective (every containment reference this object's own metaclass declares, via
251
- * getEAllContainments()), not a hardcoded list of "this class's own children" per subclass -
252
- * genuinely more complete than the old per-class version (which only ever froze the specific
253
- * containment features each override happened to name, missing e.g. eAnnotations), and cascades
254
- * transitively for free (a contained child's own freeze() call reaches its own children in
255
- * turn), needing no override anywhere.
324
+ * Marks this object and everything it contains as not to be changed. Like EMF, this is only a
325
+ * flag that can be queried; setters do not check it.
256
326
  */
257
327
  freeze() {
258
328
  for (const feature of this.eClass().getEAllContainments()) {
@@ -268,10 +338,19 @@ var EObjectImpl = class _EObjectImpl {
268
338
  isFrozen() {
269
339
  return this.frozen;
270
340
  }
271
- /** Freezes `child` if it is itself an EObjectImpl - real EMF's own conditional cascade helper. */
272
341
  freezeChild(child) {
273
342
  if (child instanceof _EObjectImpl) child.freeze();
274
343
  }
344
+ /**
345
+ * Throws unless `feature` belongs to this object's class. Feature IDs are only unique within a
346
+ * class, so dispatching on the ID alone would silently access another feature for a feature of an
347
+ * unrelated class.
348
+ */
349
+ requireOwnFeature(feature) {
350
+ if (!this.eClass().getEAllStructuralFeatures().contains(feature)) {
351
+ throw new Error(`The feature '${feature.getName()}' is not a valid feature`);
352
+ }
353
+ }
275
354
  listeners = [];
276
355
  deliverFlag = true;
277
356
  onDidChange(callback, feature) {
@@ -291,15 +370,9 @@ var EObjectImpl = class _EObjectImpl {
291
370
  this.deliverFlag = deliver;
292
371
  }
293
372
  /**
294
- * Internal - fires `notification` to every listener whose own `feature` (if any) matches this
295
- * one, unless eSetDeliver(false) is currently suppressing delivery. Called directly from the
296
- * actual mutation call sites (the eSet default dance, BasicEList.onAdded/onRemoved, eUnset,
297
- * and any feature's own custom setter body) - deliberately NOT derived from eDidAdd/eDidRemove,
298
- * since a single logical change (one eSet call) fires those twice (a remove of the old value,
299
- * an add of the new one), which would produce two notifications instead of the one real EMF (and
300
- * this project's own settled design) expects for a SET. eDidAdd/eDidRemove keep their existing,
301
- * unchanged responsibility (the counter bump and containment/opposite wiring); this is a
302
- * separate, additional call alongside them, not a replacement for them.
373
+ * Passes `notification` to the listeners registered for its feature or for all
374
+ * features, unless delivery is turned off. Called by generated code once per change, not by
375
+ * eDidAdd/eDidRemove: a single SET calls both of those.
303
376
  */
304
377
  eNotify(notification) {
305
378
  if (!this.deliverFlag || this.listeners.length === 0) return;
@@ -314,53 +387,35 @@ var EObjectImpl = class _EObjectImpl {
314
387
  eContainingFeature() {
315
388
  return this._eContainingFeature;
316
389
  }
317
- /**
318
- * Internal - called by BasicEList (for many-valued containment features)
319
- * and by single-valued containment setters to update the backpointer.
320
- * Not part of the public EObject API.
321
- */
390
+ eResource() {
391
+ return findRoot(this)._eDirectResource;
392
+ }
393
+ /** @internal Records the resource of a root; called by a resource's contents list. */
394
+ eSetDirectResource(resource) {
395
+ this._eDirectResource = resource;
396
+ }
397
+ /** @internal Sets the container back-pointer, without touching the container's feature. */
322
398
  eBasicSetContainer(container, feature) {
323
399
  this._eContainer = container;
324
400
  this._eContainingFeature = feature;
325
401
  }
326
402
  /**
327
- * Internal - side effects of `value` having just been stored into
328
- * `this.feature` (the store itself has already happened): take ownership
329
- * if `feature` is a containment, and update the opposite end if it has
330
- * one. Called by BasicEList and by single-valued setters.
331
- */
332
- /**
333
- * A single, global counter bumped on every eDidAdd/eDidRemove ANYWHERE in
334
- * the loaded model - i.e. every feature mutation, of any kind (reference
335
- * or attribute, many- or single-valued), on any object, not only the
336
- * metamodel-structural features (eStructuralFeatures/eOperations/
337
- * eSuperTypes/eGenericSuperTypes) a first version of this scoped the
338
- * bump to. That narrower scope was WRONG, found by a real, failing test:
339
- * a custom `get` body is free to read ANY feature (a feature computed
340
- * from another ordinary attribute, say - not only structural
341
- * relationships), so a change to that OTHER feature must ALSO invalidate
342
- * the cache, and a name-based allowlist can never anticipate every such
343
- * dependency a body might have. Bumping on every mutation is the only
344
- * scope that's correct for an arbitrary `get` body, not just the
345
- * specific eAll*-style ones that motivated this - see eclass.njk's
346
- * getter-caching shape, which stores the generation a cache was computed
347
- * at and recomputes once the current one has moved past it.
348
- *
349
- * Deliberately GLOBAL, not scoped to the specific object that changed:
350
- * pinpointing exactly which caches an edit could affect would need
351
- * either tracking each cache's real dependencies (not attempted) or a
352
- * reverse (subtypes) graph for the structural case specifically (this
353
- * project has neither). Bumping globally invalidates more than strictly
354
- * necessary on every edit, but never leaves anything stale - correct,
355
- * simple, and still a good fit for the motivating usage pattern: model
356
- * edits cluster at construction/load time, reads cluster at
357
- * serialization time, and the two rarely interleave, so in practice
358
- * caches stay warm for exactly the read-heavy phase this exists for.
403
+ * Incremented on every change to any feature of any object. A computed feature caches its value
404
+ * together with the generation it was computed at, and recomputes once the generation moved on:
405
+ * its getter may read any feature, so every change invalidates every cache. Changes and reads
406
+ * mostly happen in separate phases (loading, then saving or displaying), so caches stay valid
407
+ * where it matters.
359
408
  */
360
409
  static modelGeneration = 0;
410
+ /** The current model generation (see `modelGeneration`); read by generated caching code. */
361
411
  static getModelGeneration() {
362
412
  return _EObjectImpl.modelGeneration;
363
413
  }
414
+ /**
415
+ * Side effects of `value` having been stored into `feature` (the store has already happened):
416
+ * takes ownership for a containment and updates the opposite reference. Called by generated
417
+ * code.
418
+ */
364
419
  eDidAdd(feature, value) {
365
420
  _EObjectImpl.modelGeneration++;
366
421
  if (!feature || !isReference2(feature) || !(value instanceof _EObjectImpl)) return;
@@ -369,9 +424,8 @@ var EObjectImpl = class _EObjectImpl {
369
424
  if (opposite) value.eInverseAdd(this, opposite);
370
425
  }
371
426
  /**
372
- * Internal - side effects of `value` having just been removed from
373
- * `this.feature` (the store itself has already happened): release
374
- * containment and update the opposite end.
427
+ * Side effects of `value` having been removed from `feature` (the removal has already happened):
428
+ * releases containment and updates the opposite reference. Called by generated code.
375
429
  */
376
430
  eDidRemove(feature, value) {
377
431
  _EObjectImpl.modelGeneration++;
@@ -381,35 +435,55 @@ var EObjectImpl = class _EObjectImpl {
381
435
  if (opposite) value.eInverseRemove(this, opposite);
382
436
  }
383
437
  /**
384
- * Internal - `otherEnd` just started referencing `this` through
385
- * `feature.getEOpposite()`; make `this.feature` point back at `otherEnd`.
386
- * For a single-valued `feature` this displaces the previous value, whose
387
- * own opposite (still pointing at `this`) is cleared in turn.
438
+ * @internal `otherEnd` now references this object through the opposite of `feature`; makes
439
+ * `feature` reference `otherEnd` too. A single-valued `feature` drops its previous value, whose
440
+ * own opposite is cleared in turn.
388
441
  */
389
442
  eInverseAdd(otherEnd, feature) {
390
443
  if (feature.isMany()) {
391
- this.eBasicList(feature).basicAdd(otherEnd);
444
+ const list = this.eBasicList(feature);
445
+ const sizeBefore = list.size();
446
+ list.basicAdd(otherEnd);
447
+ if (list.size() > sizeBefore) {
448
+ this.eNotify({
449
+ eventType: "ADD",
450
+ notifier: this,
451
+ feature,
452
+ oldValue: void 0,
453
+ newValue: otherEnd,
454
+ position: list.size() - 1,
455
+ wasSet: true
456
+ });
457
+ }
392
458
  } else {
393
459
  const oldValue = this.eGet(feature);
394
460
  if (oldValue === otherEnd) return;
461
+ const wasSet = this.eIsSet(feature);
395
462
  this.eBasicSetValue(feature, otherEnd);
396
463
  this.eDidRemove(feature, oldValue);
464
+ this.eNotify({
465
+ eventType: "SET",
466
+ notifier: this,
467
+ feature,
468
+ oldValue,
469
+ newValue: otherEnd,
470
+ position: void 0,
471
+ wasSet
472
+ });
397
473
  }
398
474
  if (feature.isContainment()) otherEnd.eBasicMoveInto(this, feature);
399
475
  }
400
476
  /**
401
- * Internal - `otherEnd` just stopped referencing `this` through
402
- * `feature.getEOpposite()`; remove `otherEnd` from `this.feature`.
477
+ * @internal `otherEnd` no longer references this object through the opposite of `feature`;
478
+ * removes `otherEnd` from `feature`.
403
479
  */
404
480
  eInverseRemove(otherEnd, feature) {
405
481
  this.eBasicRemoveValue(feature, otherEnd);
406
482
  if (feature.isContainment()) otherEnd.eBasicReleaseFrom(this, feature);
407
483
  }
408
484
  /**
409
- * Makes `container.feature` the sole owner of `this`. If `this` was
410
- * contained elsewhere, it is removed from the old containing feature
411
- * (and that feature's opposite on `this` is cleared) first, so an object
412
- * is never a member of two containment lists at once.
485
+ * Makes `feature` of `container` the only owner of this object, first removing it from its
486
+ * previous container, so an object is never in two containment features at once.
413
487
  */
414
488
  eBasicMoveInto(container, feature) {
415
489
  const oldContainer = this._eContainer;
@@ -427,11 +501,51 @@ var EObjectImpl = class _EObjectImpl {
427
501
  this.eBasicSetContainer(void 0, void 0);
428
502
  }
429
503
  }
504
+ /**
505
+ * @internal Removes this object from its container without adding it anywhere; used when it
506
+ * becomes a root of a resource.
507
+ */
508
+ eBasicDetachFromContainer() {
509
+ const oldContainer = this._eContainer;
510
+ const oldFeature = this._eContainingFeature;
511
+ if (oldContainer instanceof _EObjectImpl && oldFeature && isReference2(oldFeature)) {
512
+ oldContainer.eBasicRemoveValue(oldFeature, this);
513
+ const oldOpposite = oldFeature.getEOpposite();
514
+ if (oldOpposite) this.eBasicRemoveValue(oldOpposite, oldContainer);
515
+ }
516
+ this.eBasicSetContainer(void 0, void 0);
517
+ }
518
+ /**
519
+ * Removes `value` from `feature` and notifies listeners, without containment or opposite side
520
+ * effects: used for the other end of a change whose side effects are already being handled.
521
+ */
430
522
  eBasicRemoveValue(feature, value) {
431
523
  if (feature.isMany()) {
432
- this.eBasicList(feature).basicRemove(value);
524
+ const list = this.eBasicList(feature);
525
+ const position = list.indexOf(value);
526
+ if (list.basicRemove(value)) {
527
+ this.eNotify({
528
+ eventType: "REMOVE",
529
+ notifier: this,
530
+ feature,
531
+ oldValue: value,
532
+ newValue: void 0,
533
+ position,
534
+ wasSet: true
535
+ });
536
+ }
433
537
  } else if (this.eGet(feature) === value) {
538
+ const wasSet = this.eIsSet(feature);
434
539
  this.eBasicSetValue(feature, void 0);
540
+ this.eNotify({
541
+ eventType: "SET",
542
+ notifier: this,
543
+ feature,
544
+ oldValue: value,
545
+ newValue: void 0,
546
+ position: void 0,
547
+ wasSet
548
+ });
435
549
  }
436
550
  }
437
551
  eBasicList(feature) {
@@ -442,19 +556,17 @@ var EObjectImpl = class _EObjectImpl {
442
556
  return list;
443
557
  }
444
558
  eContents() {
445
- const result = new BasicEList();
559
+ const result = [];
446
560
  for (const feature of this.eClass().getEAllStructuralFeatures()) {
447
561
  if (!isContainmentReference(feature)) continue;
448
562
  const value = this.eGet(feature);
449
563
  if (feature.isMany()) {
450
- if (isEListOfEObject(value)) {
451
- for (const child of value) result.add(child);
452
- }
564
+ if (isEListOfEObject(value)) result.push(...value);
453
565
  } else if (isEObject(value)) {
454
- result.add(value);
566
+ result.push(value);
455
567
  }
456
568
  }
457
- return result;
569
+ return new UnmodifiableEList(result);
458
570
  }
459
571
  eAllContents() {
460
572
  const result = [];
@@ -467,13 +579,7 @@ var EObjectImpl = class _EObjectImpl {
467
579
  eIsProxy() {
468
580
  return this._eProxy;
469
581
  }
470
- /**
471
- * Internal - flips the proxy flag. Not part of the public EObject interface, same as
472
- * eBasicSetContainer/eBasicSetValue; only `resource/proxy.ts`'s createProxy() calls this, right
473
- * after constructing a real instance of the target EClass through its own factory - a proxy is
474
- * not a separate class, just an ordinary, freshly-constructed instance flagged as a stand-in
475
- * until something resolves it.
476
- */
582
+ /** @internal Marks this object as a proxy; called by `createProxy()`. */
477
583
  eSetProxy(flag) {
478
584
  this._eProxy = flag;
479
585
  }
@@ -501,12 +607,27 @@ function isEListOfEObject(value) {
501
607
 
502
608
  // src/metamodel/impl/EcorePackageRef.ts
503
609
  var ref;
610
+ var initializer;
611
+ var initializing = false;
504
612
  function setEcorePackageRef(pkg) {
505
613
  ref = pkg;
506
614
  }
615
+ function registerEcorePackageInitializer(init) {
616
+ initializer = init;
617
+ }
507
618
  function getEcorePackageRef() {
619
+ if (!ref && initializer && !initializing) {
620
+ initializing = true;
621
+ try {
622
+ initializer();
623
+ } finally {
624
+ initializing = false;
625
+ }
626
+ }
508
627
  if (!ref) {
509
- throw new Error("getEcorePackageRef() called before the EcorePackage singleton finished constructing itself.");
628
+ throw new Error(
629
+ "getEcorePackageRef() called before the EcorePackage singleton finished constructing itself, and no initializer was registered to construct it on demand - this means EcorePackageImpl.ts's own module was never evaluated at all (an unusual bundler/tree-shaking setup). Call EcorePackageImpl.eINSTANCE or .init() yourself first, or check that this package is marked side-effectful."
630
+ );
510
631
  }
511
632
  return ref;
512
633
  }
@@ -531,6 +652,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
531
652
  this.eSet(getEcorePackageRef().getEStringToStringMapEntry_Value(), value);
532
653
  }
533
654
  eGet(feature) {
655
+ this.requireOwnFeature(feature);
534
656
  switch (feature.getFeatureID()) {
535
657
  case 0:
536
658
  return this._key;
@@ -541,6 +663,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
541
663
  }
542
664
  }
543
665
  eSet(feature, value) {
666
+ this.requireOwnFeature(feature);
544
667
  switch (feature.getFeatureID()) {
545
668
  case 0: {
546
669
  const oldValue = this.eGet(feature);
@@ -595,6 +718,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
595
718
  throw new Error(`Feature ${String(featureId)} on EStringToStringMapEntry is many-valued or unknown.`);
596
719
  }
597
720
  }
721
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
598
722
  eBootstrapList(featureId) {
599
723
  switch (featureId) {
600
724
  default:
@@ -602,6 +726,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
602
726
  }
603
727
  }
604
728
  eIsSet(feature) {
729
+ this.requireOwnFeature(feature);
605
730
  switch (feature.getFeatureID()) {
606
731
  case 0:
607
732
  return this._key !== void 0;
@@ -612,6 +737,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
612
737
  }
613
738
  }
614
739
  eUnset(feature) {
740
+ this.requireOwnFeature(feature);
615
741
  switch (feature.getFeatureID()) {
616
742
  case 0: {
617
743
  const wasSet = this.eIsSet(feature);
@@ -657,7 +783,7 @@ function createInstanceOf(eClass) {
657
783
  const factory = pkg?.getEFactoryInstance();
658
784
  if (!factory) {
659
785
  throw new Error(
660
- `Cannot create an instance of '${eClass.getName()}': its EPackage has no EFactoryInstance registered. Generated packages register one at import time; a purely parsed .ecore package needs setEFactoryInstance(new DynamicEFactoryImpl()) called on it once, or EcoreParser to have done so automatically.`
786
+ `Cannot create an instance of '${eClass.getName()}': its EPackage has no EFactoryInstance registered. Generated packages set one themselves; for a package loaded from a .ecore file, call setEFactoryInstance(new DynamicEFactoryImpl()).`
661
787
  );
662
788
  }
663
789
  return factory.create(eClass);
@@ -676,6 +802,15 @@ function setDetailValue(details, key, value) {
676
802
  entry.setValue(value);
677
803
  details.add(entry);
678
804
  }
805
+ function createFromString(eDataType, literal) {
806
+ const factory = eDataType.getEPackage()?.getEFactoryInstance();
807
+ return factory ? factory.createFromString(eDataType, literal) : literal;
808
+ }
809
+ function convertToString(eDataType, value) {
810
+ if (value === void 0 || value === null) return void 0;
811
+ const factory = eDataType.getEPackage()?.getEFactoryInstance();
812
+ return factory ? factory.convertToString(eDataType, value) : String(value);
813
+ }
679
814
 
680
815
  // src/metamodel/impl/DynamicEObjectImpl.ts
681
816
  var DynamicEObjectImpl = class extends EObjectImpl {
@@ -684,7 +819,7 @@ var DynamicEObjectImpl = class extends EObjectImpl {
684
819
  this.dynamicEClass = dynamicEClass;
685
820
  for (const feature of dynamicEClass.getEAllStructuralFeatures()) {
686
821
  if (feature.isMany()) {
687
- this.values.set(feature.getFeatureID(), new BasicEList(this, feature));
822
+ this.values.set(this.dynamicEClass.getFeatureID(feature), new BasicEList(this, feature));
688
823
  }
689
824
  }
690
825
  }
@@ -694,10 +829,12 @@ var DynamicEObjectImpl = class extends EObjectImpl {
694
829
  return this.dynamicEClass;
695
830
  }
696
831
  eGet(feature) {
697
- return this.values.get(feature.getFeatureID());
832
+ this.requireOwnFeature(feature);
833
+ return this.values.get(this.dynamicEClass.getFeatureID(feature));
698
834
  }
699
835
  eSet(feature, value) {
700
- const id = feature.getFeatureID();
836
+ this.requireOwnFeature(feature);
837
+ const id = this.dynamicEClass.getFeatureID(feature);
701
838
  if (feature.isMany()) {
702
839
  const list = this.requireList(feature);
703
840
  const items = value === void 0 || value === null ? [] : [...value];
@@ -714,14 +851,16 @@ var DynamicEObjectImpl = class extends EObjectImpl {
714
851
  this.eNotify({ eventType: "SET", notifier: this, feature, oldValue, newValue: value, position: void 0, wasSet });
715
852
  }
716
853
  eIsSet(feature) {
717
- const id = feature.getFeatureID();
854
+ this.requireOwnFeature(feature);
855
+ const id = this.dynamicEClass.getFeatureID(feature);
718
856
  if (feature.isMany()) {
719
857
  return this.values.get(id)?.size() !== 0;
720
858
  }
721
859
  return this.values.has(id) && this.values.get(id) !== void 0;
722
860
  }
723
861
  eUnset(feature) {
724
- const id = feature.getFeatureID();
862
+ this.requireOwnFeature(feature);
863
+ const id = this.dynamicEClass.getFeatureID(feature);
725
864
  if (feature.isMany()) {
726
865
  this.requireList(feature).clear();
727
866
  return;
@@ -741,14 +880,15 @@ var DynamicEObjectImpl = class extends EObjectImpl {
741
880
  });
742
881
  }
743
882
  eBasicSetValue(feature, value) {
883
+ const id = this.dynamicEClass.getFeatureID(feature);
744
884
  if (value === void 0) {
745
- this.values.delete(feature.getFeatureID());
885
+ this.values.delete(id);
746
886
  } else {
747
- this.values.set(feature.getFeatureID(), value);
887
+ this.values.set(id, value);
748
888
  }
749
889
  }
750
890
  requireList(feature) {
751
- const list = this.values.get(feature.getFeatureID());
891
+ const list = this.values.get(this.dynamicEClass.getFeatureID(feature));
752
892
  if (!(list instanceof BasicEList)) {
753
893
  throw new Error(
754
894
  `Feature '${feature.getName()}' is many-valued but has no backing EList - this DynamicEObjectImpl may have been constructed against a stale EClass (its structural features changed after construction).`
@@ -775,6 +915,7 @@ var EModelElementImpl = class extends EObjectImpl {
775
915
  return this.getEAnnotations().filter((ann) => ann.getSource() === source).at(0);
776
916
  }
777
917
  eGet(feature) {
918
+ this.requireOwnFeature(feature);
778
919
  switch (feature.getFeatureID()) {
779
920
  case 0:
780
921
  return this._eAnnotations;
@@ -783,6 +924,7 @@ var EModelElementImpl = class extends EObjectImpl {
783
924
  }
784
925
  }
785
926
  eSet(feature, value) {
927
+ this.requireOwnFeature(feature);
786
928
  switch (feature.getFeatureID()) {
787
929
  case 0: {
788
930
  const list = this._eAnnotations;
@@ -802,6 +944,7 @@ var EModelElementImpl = class extends EObjectImpl {
802
944
  throw new Error(`Feature ${String(featureId)} on EModelElement is many-valued or unknown.`);
803
945
  }
804
946
  }
947
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
805
948
  eBootstrapList(featureId) {
806
949
  switch (featureId) {
807
950
  case 0:
@@ -812,6 +955,7 @@ var EModelElementImpl = class extends EObjectImpl {
812
955
  }
813
956
  }
814
957
  eIsSet(feature) {
958
+ this.requireOwnFeature(feature);
815
959
  switch (feature.getFeatureID()) {
816
960
  case 0:
817
961
  return this._eAnnotationsCache !== void 0 && this._eAnnotationsCache.size() !== 0;
@@ -820,6 +964,7 @@ var EModelElementImpl = class extends EObjectImpl {
820
964
  }
821
965
  }
822
966
  eUnset(feature) {
967
+ this.requireOwnFeature(feature);
823
968
  switch (feature.getFeatureID()) {
824
969
  case 0:
825
970
  this._eAnnotationsCache?.clear();
@@ -830,6 +975,68 @@ var EModelElementImpl = class extends EObjectImpl {
830
975
  }
831
976
  };
832
977
 
978
+ // src/metamodel/util/EcoreTypeGuards.ts
979
+ function hasEClass(obj) {
980
+ return obj !== null && typeof obj === "object" && typeof obj.eClass === "function";
981
+ }
982
+ function isEAttribute(obj) {
983
+ return hasEClass(obj) && getEcorePackageRef().getEAttribute().isSuperTypeOf(obj.eClass());
984
+ }
985
+ function isEAnnotation(obj) {
986
+ return hasEClass(obj) && getEcorePackageRef().getEAnnotation().isSuperTypeOf(obj.eClass());
987
+ }
988
+ function isEClass(obj) {
989
+ return hasEClass(obj) && getEcorePackageRef().getEClass().isSuperTypeOf(obj.eClass());
990
+ }
991
+ function isEClassifier(obj) {
992
+ return hasEClass(obj) && getEcorePackageRef().getEClassifier().isSuperTypeOf(obj.eClass());
993
+ }
994
+ function isEDataType(obj) {
995
+ return hasEClass(obj) && getEcorePackageRef().getEDataType().isSuperTypeOf(obj.eClass());
996
+ }
997
+ function isEEnum(obj) {
998
+ return hasEClass(obj) && getEcorePackageRef().getEEnum().isSuperTypeOf(obj.eClass());
999
+ }
1000
+ function isEEnumLiteral(obj) {
1001
+ return hasEClass(obj) && getEcorePackageRef().getEEnumLiteral().isSuperTypeOf(obj.eClass());
1002
+ }
1003
+ function isEFactory(obj) {
1004
+ return hasEClass(obj) && getEcorePackageRef().getEFactory().isSuperTypeOf(obj.eClass());
1005
+ }
1006
+ function isEModelElement(obj) {
1007
+ return hasEClass(obj) && getEcorePackageRef().getEModelElement().isSuperTypeOf(obj.eClass());
1008
+ }
1009
+ function isENamedElement(obj) {
1010
+ return hasEClass(obj) && getEcorePackageRef().getENamedElement().isSuperTypeOf(obj.eClass());
1011
+ }
1012
+ function isEOperation(obj) {
1013
+ return hasEClass(obj) && getEcorePackageRef().getEOperation().isSuperTypeOf(obj.eClass());
1014
+ }
1015
+ function isEPackage(obj) {
1016
+ return hasEClass(obj) && getEcorePackageRef().getEPackage().isSuperTypeOf(obj.eClass());
1017
+ }
1018
+ function isEParameter(obj) {
1019
+ return hasEClass(obj) && getEcorePackageRef().getEParameter().isSuperTypeOf(obj.eClass());
1020
+ }
1021
+ function isEReference(obj) {
1022
+ return hasEClass(obj) && getEcorePackageRef().getEReference().isSuperTypeOf(obj.eClass());
1023
+ }
1024
+ function isEStructuralFeature(obj) {
1025
+ return hasEClass(obj) && getEcorePackageRef().getEStructuralFeature().isSuperTypeOf(obj.eClass());
1026
+ }
1027
+ function isETypedElement(obj) {
1028
+ return hasEClass(obj) && getEcorePackageRef().getETypedElement().isSuperTypeOf(obj.eClass());
1029
+ }
1030
+ function isEStringToStringMapEntry(obj) {
1031
+ return hasEClass(obj) && getEcorePackageRef().getEStringToStringMapEntry().isSuperTypeOf(obj.eClass());
1032
+ }
1033
+ function isEGenericType(obj) {
1034
+ return hasEClass(obj) && getEcorePackageRef().getEGenericType().isSuperTypeOf(obj.eClass());
1035
+ }
1036
+ function isETypeParameter(obj) {
1037
+ return hasEClass(obj) && getEcorePackageRef().getETypeParameter().isSuperTypeOf(obj.eClass());
1038
+ }
1039
+
833
1040
  // src/metamodel/impl/EFactoryImpl.ts
834
1041
  var EFactoryImpl = class extends EModelElementImpl {
835
1042
  _ePackage;
@@ -855,32 +1062,69 @@ var EFactoryImpl = class extends EModelElementImpl {
855
1062
  if (this.getEPackage() !== void 0 && eDataType.getEPackage() !== this.getEPackage()) {
856
1063
  throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);
857
1064
  }
1065
+ const invalid = () => new Error(`'${literalValue}' is not a valid value of the datatype '${eDataType.getName()}'.`);
1066
+ const text = literalValue.trim();
1067
+ const integer = (min, max) => {
1068
+ if (!/^[+-]?\d+$/.test(text)) throw invalid();
1069
+ const value = BigInt(text);
1070
+ if (min !== void 0 && value < min || max !== void 0 && value > max) throw invalid();
1071
+ return value;
1072
+ };
1073
+ const decimal = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/;
1074
+ if (isEEnum(eDataType)) {
1075
+ const literal = eDataType.getEEnumLiteralByLiteral(literalValue);
1076
+ if (literal === void 0) throw invalid();
1077
+ return literal.getLiteral();
1078
+ }
858
1079
  switch (eDataType.getName()) {
859
1080
  case "EString":
860
1081
  return literalValue;
861
1082
  case "EInt":
862
1083
  case "EIntegerObject":
1084
+ return Number(integer(-2147483648n, 2147483647n));
1085
+ case "EShort":
1086
+ case "EShortObject":
1087
+ return Number(integer(-32768n, 32767n));
1088
+ case "EByte":
1089
+ case "EByteObject":
1090
+ return Number(integer(-128n, 127n));
863
1091
  case "ELong":
864
1092
  case "ELongObject":
1093
+ return integer(-9223372036854775808n, 9223372036854775807n);
1094
+ case "EBigInteger":
1095
+ return integer();
865
1096
  case "EDouble":
866
1097
  case "EDoubleObject":
867
1098
  case "EFloat":
868
1099
  case "EFloatObject":
869
- case "EShort":
870
- case "EShortObject":
871
- case "EByte":
872
- case "EByteObject":
873
- return Number(literalValue);
874
- case "EBigInteger":
875
- return BigInt(literalValue);
1100
+ if (text === "NaN") return NaN;
1101
+ if (text === "INF" || text === "Infinity") return Infinity;
1102
+ if (text === "-INF" || text === "-Infinity") return -Infinity;
1103
+ if (!decimal.test(text)) throw invalid();
1104
+ return Number(text);
1105
+ case "EBigDecimal":
1106
+ if (!decimal.test(text)) throw invalid();
1107
+ return text;
876
1108
  case "EBoolean":
877
1109
  case "EBooleanObject":
878
- return literalValue === "true";
1110
+ if (text.toLowerCase() === "true") return true;
1111
+ if (text.toLowerCase() === "false") return false;
1112
+ throw invalid();
879
1113
  case "EChar":
880
1114
  case "ECharacterObject":
881
- return literalValue.charAt(0);
882
- case "EDate":
883
- return new Date(literalValue);
1115
+ if (literalValue.length !== 1) throw invalid();
1116
+ return literalValue;
1117
+ case "EDate": {
1118
+ const date = new Date(text);
1119
+ if (Number.isNaN(date.getTime())) throw invalid();
1120
+ return date;
1121
+ }
1122
+ case "EByteArray": {
1123
+ if (!/^([0-9a-fA-F]{2})*$/.test(text)) throw invalid();
1124
+ const bytes = new Uint8Array(text.length / 2);
1125
+ for (let i = 0; i < bytes.length; i++) bytes[i] = parseInt(text.slice(2 * i, 2 * i + 2), 16);
1126
+ return bytes;
1127
+ }
884
1128
  default:
885
1129
  return literalValue;
886
1130
  }
@@ -889,12 +1133,15 @@ var EFactoryImpl = class extends EModelElementImpl {
889
1133
  if (this.getEPackage() !== void 0 && eDataType.getEPackage() !== this.getEPackage()) {
890
1134
  throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);
891
1135
  }
892
- if (eDataType.getName() === "EDate" && instanceValue instanceof Date) {
893
- return instanceValue.toISOString();
1136
+ if (instanceValue === void 0 || instanceValue === null) return void 0;
1137
+ if (instanceValue instanceof Date) return instanceValue.toISOString();
1138
+ if (instanceValue instanceof Uint8Array) {
1139
+ return [...instanceValue].map((byte) => byte.toString(16).padStart(2, "0").toUpperCase()).join("");
894
1140
  }
895
1141
  return String(instanceValue);
896
1142
  }
897
1143
  eGet(feature) {
1144
+ this.requireOwnFeature(feature);
898
1145
  switch (feature.getFeatureID()) {
899
1146
  case 1:
900
1147
  return this._ePackage;
@@ -903,6 +1150,7 @@ var EFactoryImpl = class extends EModelElementImpl {
903
1150
  }
904
1151
  }
905
1152
  eSet(feature, value) {
1153
+ this.requireOwnFeature(feature);
906
1154
  switch (feature.getFeatureID()) {
907
1155
  case 1: {
908
1156
  const oldValue = this.eGet(feature);
@@ -938,6 +1186,7 @@ var EFactoryImpl = class extends EModelElementImpl {
938
1186
  return;
939
1187
  }
940
1188
  }
1189
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
941
1190
  eBootstrapList(featureId) {
942
1191
  switch (featureId) {
943
1192
  default:
@@ -945,6 +1194,7 @@ var EFactoryImpl = class extends EModelElementImpl {
945
1194
  }
946
1195
  }
947
1196
  eIsSet(feature) {
1197
+ this.requireOwnFeature(feature);
948
1198
  switch (feature.getFeatureID()) {
949
1199
  case 1:
950
1200
  return this._ePackage !== void 0;
@@ -953,6 +1203,7 @@ var EFactoryImpl = class extends EModelElementImpl {
953
1203
  }
954
1204
  }
955
1205
  eUnset(feature) {
1206
+ this.requireOwnFeature(feature);
956
1207
  switch (feature.getFeatureID()) {
957
1208
  case 1: {
958
1209
  const wasSet = this.eIsSet(feature);
@@ -979,6 +1230,7 @@ var EFactoryImpl = class extends EModelElementImpl {
979
1230
 
980
1231
  // src/metamodel/impl/DynamicEFactoryImpl.ts
981
1232
  var DynamicEFactoryImpl = class extends EFactoryImpl {
1233
+ /** @throws Error if `eClass` is abstract or an interface. */
982
1234
  create(eClass) {
983
1235
  if (eClass.isAbstract() || eClass.isInterface()) {
984
1236
  throw new Error(`Cannot instantiate '${eClass.getName()}': it is abstract or an interface.`);
@@ -1031,6 +1283,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1031
1283
  return this._references;
1032
1284
  }
1033
1285
  eGet(feature) {
1286
+ this.requireOwnFeature(feature);
1034
1287
  switch (feature.getFeatureID()) {
1035
1288
  case 1:
1036
1289
  return this._source;
@@ -1047,6 +1300,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1047
1300
  }
1048
1301
  }
1049
1302
  eSet(feature, value) {
1303
+ this.requireOwnFeature(feature);
1050
1304
  switch (feature.getFeatureID()) {
1051
1305
  case 1: {
1052
1306
  const oldValue = this.eGet(feature);
@@ -1124,6 +1378,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1124
1378
  return;
1125
1379
  }
1126
1380
  }
1381
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1127
1382
  eBootstrapList(featureId) {
1128
1383
  switch (featureId) {
1129
1384
  case 2:
@@ -1140,6 +1395,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1140
1395
  }
1141
1396
  }
1142
1397
  eIsSet(feature) {
1398
+ this.requireOwnFeature(feature);
1143
1399
  switch (feature.getFeatureID()) {
1144
1400
  case 1:
1145
1401
  return this._source !== void 0;
@@ -1156,6 +1412,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1156
1412
  }
1157
1413
  }
1158
1414
  eUnset(feature) {
1415
+ this.requireOwnFeature(feature);
1159
1416
  switch (feature.getFeatureID()) {
1160
1417
  case 1: {
1161
1418
  const wasSet = this.eIsSet(feature);
@@ -1218,6 +1475,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1218
1475
  this.eSet(getEcorePackageRef().getENamedElement_Name(), value);
1219
1476
  }
1220
1477
  eGet(feature) {
1478
+ this.requireOwnFeature(feature);
1221
1479
  switch (feature.getFeatureID()) {
1222
1480
  case 1:
1223
1481
  return this._name;
@@ -1226,6 +1484,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1226
1484
  }
1227
1485
  }
1228
1486
  eSet(feature, value) {
1487
+ this.requireOwnFeature(feature);
1229
1488
  switch (feature.getFeatureID()) {
1230
1489
  case 1: {
1231
1490
  const oldValue = this.eGet(feature);
@@ -1261,6 +1520,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1261
1520
  return;
1262
1521
  }
1263
1522
  }
1523
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1264
1524
  eBootstrapList(featureId) {
1265
1525
  switch (featureId) {
1266
1526
  default:
@@ -1268,6 +1528,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1268
1528
  }
1269
1529
  }
1270
1530
  eIsSet(feature) {
1531
+ this.requireOwnFeature(feature);
1271
1532
  switch (feature.getFeatureID()) {
1272
1533
  case 1:
1273
1534
  return this._name !== void 0;
@@ -1276,6 +1537,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1276
1537
  }
1277
1538
  }
1278
1539
  eUnset(feature) {
1540
+ this.requireOwnFeature(feature);
1279
1541
  switch (feature.getFeatureID()) {
1280
1542
  case 1: {
1281
1543
  const wasSet = this.eIsSet(feature);
@@ -1381,6 +1643,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1381
1643
  });
1382
1644
  }
1383
1645
  eGet(feature) {
1646
+ this.requireOwnFeature(feature);
1384
1647
  switch (feature.getFeatureID()) {
1385
1648
  case 2:
1386
1649
  return this._ordered;
@@ -1403,6 +1666,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1403
1666
  }
1404
1667
  }
1405
1668
  eSet(feature, value) {
1669
+ this.requireOwnFeature(feature);
1406
1670
  switch (feature.getFeatureID()) {
1407
1671
  case 2: {
1408
1672
  const oldValue = this.eGet(feature);
@@ -1521,6 +1785,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1521
1785
  return;
1522
1786
  }
1523
1787
  }
1788
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1524
1789
  eBootstrapList(featureId) {
1525
1790
  switch (featureId) {
1526
1791
  default:
@@ -1528,6 +1793,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1528
1793
  }
1529
1794
  }
1530
1795
  eIsSet(feature) {
1796
+ this.requireOwnFeature(feature);
1531
1797
  switch (feature.getFeatureID()) {
1532
1798
  case 2:
1533
1799
  return this._ordered !== true;
@@ -1550,6 +1816,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1550
1816
  }
1551
1817
  }
1552
1818
  eUnset(feature) {
1819
+ this.requireOwnFeature(feature);
1553
1820
  switch (feature.getFeatureID()) {
1554
1821
  case 2: {
1555
1822
  const wasSet = this.eIsSet(feature);
@@ -1692,7 +1959,8 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1692
1959
  _volatile = false;
1693
1960
  _transient = false;
1694
1961
  _defaultValueLiteral;
1695
- _defaultValue;
1962
+ _defaultValueCache;
1963
+ _defaultValueCacheGeneration = -1;
1696
1964
  _unsettable = false;
1697
1965
  _derived = false;
1698
1966
  _eContainingClass;
@@ -1700,6 +1968,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1700
1968
  getFeatureID() {
1701
1969
  return this.featureId;
1702
1970
  }
1971
+ /** Sets the feature's ID; called by generated packages. */
1703
1972
  setFeatureID(id) {
1704
1973
  this.featureId = id;
1705
1974
  }
@@ -1707,6 +1976,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1707
1976
  getContainerClass() {
1708
1977
  return this.containerClass;
1709
1978
  }
1979
+ /** Sets the implementation class of the declaring class; called by generated packages. */
1710
1980
  setContainerClass(cls) {
1711
1981
  this.containerClass = cls;
1712
1982
  }
@@ -1738,10 +2008,19 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1738
2008
  this.eSet(getEcorePackageRef().getEStructuralFeature_DefaultValueLiteral(), value);
1739
2009
  }
1740
2010
  getDefaultValue() {
1741
- return this._defaultValue;
1742
- }
1743
- setDefaultValue(value) {
1744
- this._defaultValue = value;
2011
+ if (this._defaultValueCacheGeneration !== EObjectImpl.getModelGeneration()) {
2012
+ this._defaultValueCache = (() => {
2013
+ const type = this.getEType();
2014
+ if (type === void 0 || this.isMany()) return void 0;
2015
+ const literal = this.getDefaultValueLiteral();
2016
+ const factory = type.getEPackage()?.getEFactoryInstance();
2017
+ if (literal !== void 0 && factory !== void 0 && isEDataType(type))
2018
+ return factory.createFromString(type, literal);
2019
+ return type.getDefaultValue();
2020
+ })();
2021
+ this._defaultValueCacheGeneration = EObjectImpl.getModelGeneration();
2022
+ }
2023
+ return this._defaultValueCache;
1745
2024
  }
1746
2025
  isUnsettable() {
1747
2026
  return this._unsettable;
@@ -1762,6 +2041,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1762
2041
  this._eContainingClass = value;
1763
2042
  }
1764
2043
  eGet(feature) {
2044
+ this.requireOwnFeature(feature);
1765
2045
  switch (feature.getFeatureID()) {
1766
2046
  case 10:
1767
2047
  return this._changeable;
@@ -1772,7 +2052,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1772
2052
  case 13:
1773
2053
  return this._defaultValueLiteral;
1774
2054
  case 14:
1775
- return this._defaultValue;
2055
+ return this.getDefaultValue();
1776
2056
  case 15:
1777
2057
  return this._unsettable;
1778
2058
  case 16:
@@ -1784,6 +2064,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1784
2064
  }
1785
2065
  }
1786
2066
  eSet(feature, value) {
2067
+ this.requireOwnFeature(feature);
1787
2068
  switch (feature.getFeatureID()) {
1788
2069
  case 10: {
1789
2070
  const oldValue = this.eGet(feature);
@@ -1913,9 +2194,6 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1913
2194
  case 13:
1914
2195
  this._defaultValueLiteral = value;
1915
2196
  return;
1916
- case 14:
1917
- this._defaultValue = value;
1918
- return;
1919
2197
  case 15:
1920
2198
  this._unsettable = value;
1921
2199
  return;
@@ -1930,6 +2208,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1930
2208
  return;
1931
2209
  }
1932
2210
  }
2211
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1933
2212
  eBootstrapList(featureId) {
1934
2213
  switch (featureId) {
1935
2214
  default:
@@ -1937,6 +2216,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1937
2216
  }
1938
2217
  }
1939
2218
  eIsSet(feature) {
2219
+ this.requireOwnFeature(feature);
1940
2220
  switch (feature.getFeatureID()) {
1941
2221
  case 10:
1942
2222
  return this._changeable !== true;
@@ -1947,7 +2227,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1947
2227
  case 13:
1948
2228
  return this._defaultValueLiteral !== void 0;
1949
2229
  case 14:
1950
- return this._defaultValue !== void 0;
2230
+ return this.getDefaultValue() !== void 0;
1951
2231
  case 15:
1952
2232
  return this._unsettable !== false;
1953
2233
  case 16:
@@ -1959,6 +2239,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1959
2239
  }
1960
2240
  }
1961
2241
  eUnset(feature) {
2242
+ this.requireOwnFeature(feature);
1962
2243
  switch (feature.getFeatureID()) {
1963
2244
  case 10: {
1964
2245
  const wasSet = this.eIsSet(feature);
@@ -2024,22 +2305,6 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
2024
2305
  });
2025
2306
  return;
2026
2307
  }
2027
- case 14: {
2028
- const wasSet = this.eIsSet(feature);
2029
- const oldValue = this._defaultValue;
2030
- this._defaultValue = void 0;
2031
- this.eDidRemove(feature, oldValue);
2032
- this.eNotify({
2033
- eventType: "UNSET",
2034
- notifier: this,
2035
- feature,
2036
- oldValue,
2037
- newValue: void 0,
2038
- position: void 0,
2039
- wasSet
2040
- });
2041
- return;
2042
- }
2043
2308
  case 15: {
2044
2309
  const wasSet = this.eIsSet(feature);
2045
2310
  const oldValue = this._unsettable;
@@ -2112,6 +2377,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2112
2377
  return this.getEType();
2113
2378
  }
2114
2379
  eGet(feature) {
2380
+ this.requireOwnFeature(feature);
2115
2381
  switch (feature.getFeatureID()) {
2116
2382
  case 18:
2117
2383
  return this._iD;
@@ -2122,6 +2388,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2122
2388
  }
2123
2389
  }
2124
2390
  eSet(feature, value) {
2391
+ this.requireOwnFeature(feature);
2125
2392
  switch (feature.getFeatureID()) {
2126
2393
  case 18: {
2127
2394
  const oldValue = this.eGet(feature);
@@ -2160,6 +2427,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2160
2427
  return;
2161
2428
  }
2162
2429
  }
2430
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2163
2431
  eBootstrapList(featureId) {
2164
2432
  switch (featureId) {
2165
2433
  default:
@@ -2167,6 +2435,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2167
2435
  }
2168
2436
  }
2169
2437
  eIsSet(feature) {
2438
+ this.requireOwnFeature(feature);
2170
2439
  switch (feature.getFeatureID()) {
2171
2440
  case 18:
2172
2441
  return this._iD !== false;
@@ -2177,6 +2446,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2177
2446
  }
2178
2447
  }
2179
2448
  eUnset(feature) {
2449
+ this.requireOwnFeature(feature);
2180
2450
  switch (feature.getFeatureID()) {
2181
2451
  case 18: {
2182
2452
  const wasSet = this.eIsSet(feature);
@@ -2221,7 +2491,8 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2221
2491
  var EClassifierImpl = class extends ENamedElementImpl {
2222
2492
  _instanceClassName;
2223
2493
  _instanceClass;
2224
- _defaultValue;
2494
+ _defaultValueCache;
2495
+ _defaultValueCacheGeneration = -1;
2225
2496
  _instanceTypeName;
2226
2497
  _ePackage;
2227
2498
  _eTypeParametersCache;
@@ -2236,6 +2507,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2236
2507
  getClassifierID() {
2237
2508
  return this.classifierId;
2238
2509
  }
2510
+ /** Sets the classifier's ID; called by generated packages. */
2239
2511
  setClassifierID(id) {
2240
2512
  this.classifierId = id;
2241
2513
  }
@@ -2255,10 +2527,36 @@ var EClassifierImpl = class extends ENamedElementImpl {
2255
2527
  this._instanceClass = value;
2256
2528
  }
2257
2529
  getDefaultValue() {
2258
- return this._defaultValue;
2259
- }
2260
- setDefaultValue(value) {
2261
- this._defaultValue = value;
2530
+ if (this._defaultValueCacheGeneration !== EObjectImpl.getModelGeneration()) {
2531
+ this._defaultValueCache = (() => {
2532
+ switch (this.eClass().getName()) {
2533
+ case "EEnum": {
2534
+ const first = this.getELiterals().toArray().at(0);
2535
+ return first?.getLiteral();
2536
+ }
2537
+ case "EDataType":
2538
+ break;
2539
+ default:
2540
+ return void 0;
2541
+ }
2542
+ switch (this.getName()) {
2543
+ case "EBoolean":
2544
+ return false;
2545
+ case "EInt":
2546
+ case "EFloat":
2547
+ case "EDouble":
2548
+ case "EShort":
2549
+ case "EByte":
2550
+ return 0;
2551
+ case "ELong":
2552
+ return 0n;
2553
+ default:
2554
+ return void 0;
2555
+ }
2556
+ })();
2557
+ this._defaultValueCacheGeneration = EObjectImpl.getModelGeneration();
2558
+ }
2559
+ return this._defaultValueCache;
2262
2560
  }
2263
2561
  getInstanceTypeName() {
2264
2562
  return this._instanceTypeName;
@@ -2276,16 +2574,54 @@ var EClassifierImpl = class extends ENamedElementImpl {
2276
2574
  return this._eTypeParameters;
2277
2575
  }
2278
2576
  isInstance(object) {
2279
- return object instanceof EObjectImpl;
2577
+ switch (this.eClass().getName()) {
2578
+ case "EClass":
2579
+ return object instanceof EObjectImpl && this.isSuperTypeOf(object.eClass());
2580
+ case "EEnum":
2581
+ return typeof object === "string" && this.getEEnumLiteralByLiteral(object) !== void 0;
2582
+ default:
2583
+ switch (this.getName()) {
2584
+ case "EString":
2585
+ case "EChar":
2586
+ case "ECharacterObject":
2587
+ case "EBigDecimal":
2588
+ return typeof object === "string";
2589
+ case "EInt":
2590
+ case "EIntegerObject":
2591
+ case "EDouble":
2592
+ case "EDoubleObject":
2593
+ case "EFloat":
2594
+ case "EFloatObject":
2595
+ case "EShort":
2596
+ case "EShortObject":
2597
+ case "EByte":
2598
+ case "EByteObject":
2599
+ return typeof object === "number";
2600
+ case "ELong":
2601
+ case "ELongObject":
2602
+ case "EBigInteger":
2603
+ return typeof object === "bigint";
2604
+ case "EBoolean":
2605
+ case "EBooleanObject":
2606
+ return typeof object === "boolean";
2607
+ case "EDate":
2608
+ return object instanceof Date;
2609
+ case "EByteArray":
2610
+ return object instanceof Uint8Array;
2611
+ default:
2612
+ return object !== void 0 && object !== null;
2613
+ }
2614
+ }
2280
2615
  }
2281
2616
  eGet(feature) {
2617
+ this.requireOwnFeature(feature);
2282
2618
  switch (feature.getFeatureID()) {
2283
2619
  case 2:
2284
2620
  return this._instanceClassName;
2285
2621
  case 3:
2286
2622
  return this._instanceClass;
2287
2623
  case 4:
2288
- return this._defaultValue;
2624
+ return this.getDefaultValue();
2289
2625
  case 5:
2290
2626
  return this._instanceTypeName;
2291
2627
  case 6:
@@ -2297,6 +2633,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2297
2633
  }
2298
2634
  }
2299
2635
  eSet(feature, value) {
2636
+ this.requireOwnFeature(feature);
2300
2637
  switch (feature.getFeatureID()) {
2301
2638
  case 2: {
2302
2639
  const oldValue = this.eGet(feature);
@@ -2355,9 +2692,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2355
2692
  case 3:
2356
2693
  this._instanceClass = value;
2357
2694
  return;
2358
- case 4:
2359
- this._defaultValue = value;
2360
- return;
2361
2695
  case 5:
2362
2696
  this._instanceTypeName = value;
2363
2697
  return;
@@ -2369,6 +2703,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2369
2703
  return;
2370
2704
  }
2371
2705
  }
2706
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2372
2707
  eBootstrapList(featureId) {
2373
2708
  switch (featureId) {
2374
2709
  case 7:
@@ -2379,13 +2714,14 @@ var EClassifierImpl = class extends ENamedElementImpl {
2379
2714
  }
2380
2715
  }
2381
2716
  eIsSet(feature) {
2717
+ this.requireOwnFeature(feature);
2382
2718
  switch (feature.getFeatureID()) {
2383
2719
  case 2:
2384
2720
  return this._instanceClassName !== void 0;
2385
2721
  case 3:
2386
2722
  return this._instanceClass !== void 0;
2387
2723
  case 4:
2388
- return this._defaultValue !== void 0;
2724
+ return this.getDefaultValue() !== void 0;
2389
2725
  case 5:
2390
2726
  return this._instanceTypeName !== void 0;
2391
2727
  case 6:
@@ -2397,6 +2733,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2397
2733
  }
2398
2734
  }
2399
2735
  eUnset(feature) {
2736
+ this.requireOwnFeature(feature);
2400
2737
  switch (feature.getFeatureID()) {
2401
2738
  case 2: {
2402
2739
  const wasSet = this.eIsSet(feature);
@@ -2430,22 +2767,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2430
2767
  });
2431
2768
  return;
2432
2769
  }
2433
- case 4: {
2434
- const wasSet = this.eIsSet(feature);
2435
- const oldValue = this._defaultValue;
2436
- this._defaultValue = void 0;
2437
- this.eDidRemove(feature, oldValue);
2438
- this.eNotify({
2439
- eventType: "UNSET",
2440
- notifier: this,
2441
- feature,
2442
- oldValue,
2443
- newValue: void 0,
2444
- position: void 0,
2445
- wasSet
2446
- });
2447
- return;
2448
- }
2449
2770
  case 5: {
2450
2771
  const wasSet = this.eIsSet(feature);
2451
2772
  const oldValue = this._instanceTypeName;
@@ -2488,68 +2809,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2488
2809
  }
2489
2810
  };
2490
2811
 
2491
- // src/metamodel/util/EcoreTypeGuards.ts
2492
- function hasEClass(obj) {
2493
- return obj !== null && typeof obj === "object" && typeof obj.eClass === "function";
2494
- }
2495
- function isEAttribute(obj) {
2496
- return hasEClass(obj) && getEcorePackageRef().getEAttribute().isSuperTypeOf(obj.eClass());
2497
- }
2498
- function isEAnnotation(obj) {
2499
- return hasEClass(obj) && getEcorePackageRef().getEAnnotation().isSuperTypeOf(obj.eClass());
2500
- }
2501
- function isEClass(obj) {
2502
- return hasEClass(obj) && getEcorePackageRef().getEClass().isSuperTypeOf(obj.eClass());
2503
- }
2504
- function isEClassifier(obj) {
2505
- return hasEClass(obj) && getEcorePackageRef().getEClassifier().isSuperTypeOf(obj.eClass());
2506
- }
2507
- function isEDataType(obj) {
2508
- return hasEClass(obj) && getEcorePackageRef().getEDataType().isSuperTypeOf(obj.eClass());
2509
- }
2510
- function isEEnum(obj) {
2511
- return hasEClass(obj) && getEcorePackageRef().getEEnum().isSuperTypeOf(obj.eClass());
2512
- }
2513
- function isEEnumLiteral(obj) {
2514
- return hasEClass(obj) && getEcorePackageRef().getEEnumLiteral().isSuperTypeOf(obj.eClass());
2515
- }
2516
- function isEFactory(obj) {
2517
- return hasEClass(obj) && getEcorePackageRef().getEFactory().isSuperTypeOf(obj.eClass());
2518
- }
2519
- function isEModelElement(obj) {
2520
- return hasEClass(obj) && getEcorePackageRef().getEModelElement().isSuperTypeOf(obj.eClass());
2521
- }
2522
- function isENamedElement(obj) {
2523
- return hasEClass(obj) && getEcorePackageRef().getENamedElement().isSuperTypeOf(obj.eClass());
2524
- }
2525
- function isEOperation(obj) {
2526
- return hasEClass(obj) && getEcorePackageRef().getEOperation().isSuperTypeOf(obj.eClass());
2527
- }
2528
- function isEPackage(obj) {
2529
- return hasEClass(obj) && getEcorePackageRef().getEPackage().isSuperTypeOf(obj.eClass());
2530
- }
2531
- function isEParameter(obj) {
2532
- return hasEClass(obj) && getEcorePackageRef().getEParameter().isSuperTypeOf(obj.eClass());
2533
- }
2534
- function isEReference(obj) {
2535
- return hasEClass(obj) && getEcorePackageRef().getEReference().isSuperTypeOf(obj.eClass());
2536
- }
2537
- function isEStructuralFeature(obj) {
2538
- return hasEClass(obj) && getEcorePackageRef().getEStructuralFeature().isSuperTypeOf(obj.eClass());
2539
- }
2540
- function isETypedElement(obj) {
2541
- return hasEClass(obj) && getEcorePackageRef().getETypedElement().isSuperTypeOf(obj.eClass());
2542
- }
2543
- function isEStringToStringMapEntry(obj) {
2544
- return hasEClass(obj) && getEcorePackageRef().getEStringToStringMapEntry().isSuperTypeOf(obj.eClass());
2545
- }
2546
- function isEGenericType(obj) {
2547
- return hasEClass(obj) && getEcorePackageRef().getEGenericType().isSuperTypeOf(obj.eClass());
2548
- }
2549
- function isETypeParameter(obj) {
2550
- return hasEClass(obj) && getEcorePackageRef().getETypeParameter().isSuperTypeOf(obj.eClass());
2551
- }
2552
-
2553
2812
  // src/metamodel/impl/EGenericTypeImpl.ts
2554
2813
  var EGenericTypeImpl = class extends EObjectImpl {
2555
2814
  _eUpperBound;
@@ -2614,6 +2873,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2614
2873
  this.eSet(getEcorePackageRef().getEGenericType_EClassifier(), value);
2615
2874
  }
2616
2875
  eGet(feature) {
2876
+ this.requireOwnFeature(feature);
2617
2877
  switch (feature.getFeatureID()) {
2618
2878
  case 0:
2619
2879
  return this._eUpperBound;
@@ -2632,6 +2892,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2632
2892
  }
2633
2893
  }
2634
2894
  eSet(feature, value) {
2895
+ this.requireOwnFeature(feature);
2635
2896
  switch (feature.getFeatureID()) {
2636
2897
  case 0: {
2637
2898
  const oldValue = this.eGet(feature);
@@ -2735,6 +2996,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2735
2996
  throw new Error(`Feature ${String(featureId)} on EGenericType is many-valued or unknown.`);
2736
2997
  }
2737
2998
  }
2999
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2738
3000
  eBootstrapList(featureId) {
2739
3001
  switch (featureId) {
2740
3002
  case 1:
@@ -2745,6 +3007,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2745
3007
  }
2746
3008
  }
2747
3009
  eIsSet(feature) {
3010
+ this.requireOwnFeature(feature);
2748
3011
  switch (feature.getFeatureID()) {
2749
3012
  case 0:
2750
3013
  return this._eUpperBound !== void 0;
@@ -2763,6 +3026,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2763
3026
  }
2764
3027
  }
2765
3028
  eUnset(feature) {
3029
+ this.requireOwnFeature(feature);
2766
3030
  switch (feature.getFeatureID()) {
2767
3031
  case 0: {
2768
3032
  const wasSet = this.eIsSet(feature);
@@ -2910,137 +3174,153 @@ var EClassImpl = class extends EClassifierImpl {
2910
3174
  }
2911
3175
  getEAllAttributes() {
2912
3176
  if (this._eAllAttributesCacheGeneration !== EObjectImpl.getModelGeneration()) {
2913
- this._eAllAttributesCache = (() => {
2914
- return new BasicEList(
2915
- void 0,
2916
- void 0,
2917
- this.getEAllStructuralFeatures().filter(isEAttribute)
2918
- );
2919
- })();
3177
+ this._eAllAttributesCache = new UnmodifiableEList(
3178
+ (() => {
3179
+ return new BasicEList(
3180
+ void 0,
3181
+ void 0,
3182
+ this.getEAllStructuralFeatures().filter(isEAttribute)
3183
+ );
3184
+ })()
3185
+ );
2920
3186
  this._eAllAttributesCacheGeneration = EObjectImpl.getModelGeneration();
2921
3187
  }
2922
3188
  return this._eAllAttributesCache;
2923
3189
  }
2924
3190
  getEAllReferences() {
2925
3191
  if (this._eAllReferencesCacheGeneration !== EObjectImpl.getModelGeneration()) {
2926
- this._eAllReferencesCache = (() => {
2927
- return new BasicEList(
2928
- void 0,
2929
- void 0,
2930
- this.getEAllStructuralFeatures().filter(isEReference)
2931
- );
2932
- })();
3192
+ this._eAllReferencesCache = new UnmodifiableEList(
3193
+ (() => {
3194
+ return new BasicEList(
3195
+ void 0,
3196
+ void 0,
3197
+ this.getEAllStructuralFeatures().filter(isEReference)
3198
+ );
3199
+ })()
3200
+ );
2933
3201
  this._eAllReferencesCacheGeneration = EObjectImpl.getModelGeneration();
2934
3202
  }
2935
3203
  return this._eAllReferencesCache;
2936
3204
  }
2937
3205
  getEReferences() {
2938
3206
  if (this._eReferencesCacheGeneration !== EObjectImpl.getModelGeneration()) {
2939
- this._eReferencesCache = (() => {
2940
- return new BasicEList(
2941
- void 0,
2942
- void 0,
2943
- this.getEStructuralFeatures().filter(isEReference)
2944
- );
2945
- })();
3207
+ this._eReferencesCache = new UnmodifiableEList(
3208
+ (() => {
3209
+ return new BasicEList(
3210
+ void 0,
3211
+ void 0,
3212
+ this.getEStructuralFeatures().filter(isEReference)
3213
+ );
3214
+ })()
3215
+ );
2946
3216
  this._eReferencesCacheGeneration = EObjectImpl.getModelGeneration();
2947
3217
  }
2948
3218
  return this._eReferencesCache;
2949
3219
  }
2950
3220
  getEAttributes() {
2951
3221
  if (this._eAttributesCacheGeneration !== EObjectImpl.getModelGeneration()) {
2952
- this._eAttributesCache = (() => {
2953
- return new BasicEList(
2954
- void 0,
2955
- void 0,
2956
- this.getEStructuralFeatures().filter(isEAttribute)
2957
- );
2958
- })();
3222
+ this._eAttributesCache = new UnmodifiableEList(
3223
+ (() => {
3224
+ return new BasicEList(
3225
+ void 0,
3226
+ void 0,
3227
+ this.getEStructuralFeatures().filter(isEAttribute)
3228
+ );
3229
+ })()
3230
+ );
2959
3231
  this._eAttributesCacheGeneration = EObjectImpl.getModelGeneration();
2960
3232
  }
2961
3233
  return this._eAttributesCache;
2962
3234
  }
2963
3235
  getEAllContainments() {
2964
3236
  if (this._eAllContainmentsCacheGeneration !== EObjectImpl.getModelGeneration()) {
2965
- this._eAllContainmentsCache = (() => {
2966
- const references = this.getEAllStructuralFeatures().filter(isEReference);
2967
- return new BasicEList(
2968
- void 0,
2969
- void 0,
2970
- references.filter((reference) => reference.isContainment())
2971
- );
2972
- })();
3237
+ this._eAllContainmentsCache = new UnmodifiableEList(
3238
+ (() => {
3239
+ const references = this.getEAllStructuralFeatures().filter(isEReference);
3240
+ return new BasicEList(
3241
+ void 0,
3242
+ void 0,
3243
+ references.filter((reference) => reference.isContainment())
3244
+ );
3245
+ })()
3246
+ );
2973
3247
  this._eAllContainmentsCacheGeneration = EObjectImpl.getModelGeneration();
2974
3248
  }
2975
3249
  return this._eAllContainmentsCache;
2976
3250
  }
2977
3251
  getEAllOperations() {
2978
3252
  if (this._eAllOperationsCacheGeneration !== EObjectImpl.getModelGeneration()) {
2979
- this._eAllOperationsCache = (() => {
2980
- const operations = /* @__PURE__ */ new Set();
2981
- const visited = /* @__PURE__ */ new Set();
2982
- const visit = (eClass) => {
2983
- if (visited.has(eClass)) return;
2984
- visited.add(eClass);
2985
- eClass.getESuperTypes().forEach(visit);
2986
- for (const generic of eClass.getEGenericSuperTypes()) {
2987
- const raw = generic.getEClassifier();
2988
- if (raw !== void 0 && isEClass(raw)) visit(raw);
2989
- }
2990
- eClass.getEOperations().forEach((operation) => operations.add(operation));
2991
- };
2992
- visit(this);
2993
- return new BasicEList(void 0, void 0, operations);
2994
- })();
3253
+ this._eAllOperationsCache = new UnmodifiableEList(
3254
+ (() => {
3255
+ const operations = /* @__PURE__ */ new Set();
3256
+ const visited = /* @__PURE__ */ new Set();
3257
+ const visit = (eClass) => {
3258
+ if (visited.has(eClass)) return;
3259
+ visited.add(eClass);
3260
+ eClass.getESuperTypes().forEach(visit);
3261
+ for (const generic of eClass.getEGenericSuperTypes()) {
3262
+ const raw = generic.getEClassifier();
3263
+ if (raw !== void 0 && isEClass(raw)) visit(raw);
3264
+ }
3265
+ eClass.getEOperations().forEach((operation) => operations.add(operation));
3266
+ };
3267
+ visit(this);
3268
+ return new BasicEList(void 0, void 0, operations);
3269
+ })()
3270
+ );
2995
3271
  this._eAllOperationsCacheGeneration = EObjectImpl.getModelGeneration();
2996
3272
  }
2997
3273
  return this._eAllOperationsCache;
2998
3274
  }
2999
3275
  getEAllStructuralFeatures() {
3000
3276
  if (this._eAllStructuralFeaturesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3001
- this._eAllStructuralFeaturesCache = (() => {
3002
- const features = /* @__PURE__ */ new Set();
3003
- const visited = /* @__PURE__ */ new Set();
3004
- const visit = (eClass) => {
3005
- if (visited.has(eClass)) return;
3006
- visited.add(eClass);
3007
- eClass.getESuperTypes().forEach(visit);
3008
- for (const generic of eClass.getEGenericSuperTypes()) {
3009
- const raw = generic.getEClassifier();
3010
- if (raw !== void 0 && isEClass(raw)) visit(raw);
3011
- }
3012
- eClass.getEStructuralFeatures().forEach((feature) => features.add(feature));
3013
- };
3014
- visit(this);
3015
- return new BasicEList(void 0, void 0, features);
3016
- })();
3277
+ this._eAllStructuralFeaturesCache = new UnmodifiableEList(
3278
+ (() => {
3279
+ const features = /* @__PURE__ */ new Set();
3280
+ const visited = /* @__PURE__ */ new Set();
3281
+ const visit = (eClass) => {
3282
+ if (visited.has(eClass)) return;
3283
+ visited.add(eClass);
3284
+ eClass.getESuperTypes().forEach(visit);
3285
+ for (const generic of eClass.getEGenericSuperTypes()) {
3286
+ const raw = generic.getEClassifier();
3287
+ if (raw !== void 0 && isEClass(raw)) visit(raw);
3288
+ }
3289
+ eClass.getEStructuralFeatures().forEach((feature) => features.add(feature));
3290
+ };
3291
+ visit(this);
3292
+ return new BasicEList(void 0, void 0, features);
3293
+ })()
3294
+ );
3017
3295
  this._eAllStructuralFeaturesCacheGeneration = EObjectImpl.getModelGeneration();
3018
3296
  }
3019
3297
  return this._eAllStructuralFeaturesCache;
3020
3298
  }
3021
3299
  getEAllSuperTypes() {
3022
3300
  if (this._eAllSuperTypesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3023
- this._eAllSuperTypesCache = (() => {
3024
- const superTypes = /* @__PURE__ */ new Set();
3025
- const visited = /* @__PURE__ */ new Set();
3026
- const visit = (eClass) => {
3027
- if (visited.has(eClass)) return;
3028
- visited.add(eClass);
3029
- for (const sup of eClass.getESuperTypes()) {
3030
- visit(sup);
3031
- superTypes.add(sup);
3032
- }
3033
- for (const generic of eClass.getEGenericSuperTypes()) {
3034
- const raw = generic.getEClassifier();
3035
- if (raw !== void 0 && isEClass(raw)) {
3036
- visit(raw);
3037
- superTypes.add(raw);
3301
+ this._eAllSuperTypesCache = new UnmodifiableEList(
3302
+ (() => {
3303
+ const superTypes = /* @__PURE__ */ new Set();
3304
+ const visited = /* @__PURE__ */ new Set();
3305
+ const visit = (eClass) => {
3306
+ if (visited.has(eClass)) return;
3307
+ visited.add(eClass);
3308
+ for (const sup of eClass.getESuperTypes()) {
3309
+ visit(sup);
3310
+ superTypes.add(sup);
3038
3311
  }
3039
- }
3040
- };
3041
- visit(this);
3042
- return new BasicEList(void 0, void 0, superTypes);
3043
- })();
3312
+ for (const generic of eClass.getEGenericSuperTypes()) {
3313
+ const raw = generic.getEClassifier();
3314
+ if (raw !== void 0 && isEClass(raw)) {
3315
+ visit(raw);
3316
+ superTypes.add(raw);
3317
+ }
3318
+ }
3319
+ };
3320
+ visit(this);
3321
+ return new BasicEList(void 0, void 0, superTypes);
3322
+ })()
3323
+ );
3044
3324
  this._eAllSuperTypesCacheGeneration = EObjectImpl.getModelGeneration();
3045
3325
  }
3046
3326
  return this._eAllSuperTypesCache;
@@ -3062,29 +3342,31 @@ var EClassImpl = class extends EClassifierImpl {
3062
3342
  }
3063
3343
  getEAllGenericSuperTypes() {
3064
3344
  if (this._eAllGenericSuperTypesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3065
- this._eAllGenericSuperTypesCache = (() => {
3066
- const genericSuperTypes = /* @__PURE__ */ new Set();
3067
- const visited = /* @__PURE__ */ new Set();
3068
- const visit = (eClass) => {
3069
- if (visited.has(eClass)) return;
3070
- visited.add(eClass);
3071
- for (const sup of eClass.getESuperTypes()) {
3072
- visit(sup);
3073
- const implicit = new EGenericTypeImpl();
3074
- implicit.setEClassifier(sup);
3075
- genericSuperTypes.add(implicit);
3076
- }
3077
- for (const generic of eClass.getEGenericSuperTypes()) {
3078
- const raw = generic.getEClassifier();
3079
- if (raw !== void 0 && isEClass(raw)) {
3080
- visit(raw);
3081
- genericSuperTypes.add(generic);
3345
+ this._eAllGenericSuperTypesCache = new UnmodifiableEList(
3346
+ (() => {
3347
+ const genericSuperTypes = /* @__PURE__ */ new Set();
3348
+ const visited = /* @__PURE__ */ new Set();
3349
+ const visit = (eClass) => {
3350
+ if (visited.has(eClass)) return;
3351
+ visited.add(eClass);
3352
+ for (const sup of eClass.getESuperTypes()) {
3353
+ visit(sup);
3354
+ const implicit = new EGenericTypeImpl();
3355
+ implicit.setEClassifier(sup);
3356
+ genericSuperTypes.add(implicit);
3082
3357
  }
3083
- }
3084
- };
3085
- visit(this);
3086
- return new BasicEList(void 0, void 0, genericSuperTypes);
3087
- })();
3358
+ for (const generic of eClass.getEGenericSuperTypes()) {
3359
+ const raw = generic.getEClassifier();
3360
+ if (raw !== void 0 && isEClass(raw)) {
3361
+ visit(raw);
3362
+ genericSuperTypes.add(generic);
3363
+ }
3364
+ }
3365
+ };
3366
+ visit(this);
3367
+ return new BasicEList(void 0, void 0, genericSuperTypes);
3368
+ })()
3369
+ );
3088
3370
  this._eAllGenericSuperTypesCacheGeneration = EObjectImpl.getModelGeneration();
3089
3371
  }
3090
3372
  return this._eAllGenericSuperTypesCache;
@@ -3110,7 +3392,8 @@ var EClassImpl = class extends EClassifierImpl {
3110
3392
  }
3111
3393
  getEStructuralFeature(featureIDOrFeatureName) {
3112
3394
  if (typeof featureIDOrFeatureName === "number") {
3113
- return this.getEAllStructuralFeatures().filter((feature) => this.getFeatureID(feature) === featureIDOrFeatureName).at(0);
3395
+ const features = this.getEAllStructuralFeatures();
3396
+ return featureIDOrFeatureName >= 0 && featureIDOrFeatureName < features.size() ? features.get(featureIDOrFeatureName) : void 0;
3114
3397
  }
3115
3398
  if (typeof featureIDOrFeatureName === "string") {
3116
3399
  return this.getEAllStructuralFeatures().filter((feature) => feature.getName() === featureIDOrFeatureName).at(0);
@@ -3118,7 +3401,7 @@ var EClassImpl = class extends EClassifierImpl {
3118
3401
  throw new Error("EClass.getEStructuralFeature(): no overload matches the given arguments.");
3119
3402
  }
3120
3403
  getFeatureID(feature) {
3121
- return feature.getFeatureID();
3404
+ return this.getEAllStructuralFeatures().indexOf(feature);
3122
3405
  }
3123
3406
  getOperationCount() {
3124
3407
  return this.getEAllOperations().size();
@@ -3137,6 +3420,7 @@ var EClassImpl = class extends EClassifierImpl {
3137
3420
  return void 0;
3138
3421
  }
3139
3422
  eGet(feature) {
3423
+ this.requireOwnFeature(feature);
3140
3424
  switch (feature.getFeatureID()) {
3141
3425
  case 8:
3142
3426
  return this._abstract;
@@ -3175,6 +3459,7 @@ var EClassImpl = class extends EClassifierImpl {
3175
3459
  }
3176
3460
  }
3177
3461
  eSet(feature, value) {
3462
+ this.requireOwnFeature(feature);
3178
3463
  switch (feature.getFeatureID()) {
3179
3464
  case 8: {
3180
3465
  const oldValue = this.eGet(feature);
@@ -3259,6 +3544,7 @@ var EClassImpl = class extends EClassifierImpl {
3259
3544
  return;
3260
3545
  }
3261
3546
  }
3547
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3262
3548
  eBootstrapList(featureId) {
3263
3549
  switch (featureId) {
3264
3550
  case 10:
@@ -3278,6 +3564,7 @@ var EClassImpl = class extends EClassifierImpl {
3278
3564
  }
3279
3565
  }
3280
3566
  eIsSet(feature) {
3567
+ this.requireOwnFeature(feature);
3281
3568
  switch (feature.getFeatureID()) {
3282
3569
  case 8:
3283
3570
  return this._abstract !== false;
@@ -3316,6 +3603,7 @@ var EClassImpl = class extends EClassifierImpl {
3316
3603
  }
3317
3604
  }
3318
3605
  eUnset(feature) {
3606
+ this.requireOwnFeature(feature);
3319
3607
  switch (feature.getFeatureID()) {
3320
3608
  case 8: {
3321
3609
  const wasSet = this.eIsSet(feature);
@@ -3381,6 +3669,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3381
3669
  this.eSet(getEcorePackageRef().getEDataType_Serializable(), value);
3382
3670
  }
3383
3671
  eGet(feature) {
3672
+ this.requireOwnFeature(feature);
3384
3673
  switch (feature.getFeatureID()) {
3385
3674
  case 8:
3386
3675
  return this._serializable;
@@ -3389,6 +3678,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3389
3678
  }
3390
3679
  }
3391
3680
  eSet(feature, value) {
3681
+ this.requireOwnFeature(feature);
3392
3682
  switch (feature.getFeatureID()) {
3393
3683
  case 8: {
3394
3684
  const oldValue = this.eGet(feature);
@@ -3424,6 +3714,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3424
3714
  return;
3425
3715
  }
3426
3716
  }
3717
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3427
3718
  eBootstrapList(featureId) {
3428
3719
  switch (featureId) {
3429
3720
  default:
@@ -3431,6 +3722,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3431
3722
  }
3432
3723
  }
3433
3724
  eIsSet(feature) {
3725
+ this.requireOwnFeature(feature);
3434
3726
  switch (feature.getFeatureID()) {
3435
3727
  case 8:
3436
3728
  return this._serializable !== true;
@@ -3439,6 +3731,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3439
3731
  }
3440
3732
  }
3441
3733
  eUnset(feature) {
3734
+ this.requireOwnFeature(feature);
3442
3735
  switch (feature.getFeatureID()) {
3443
3736
  case 8: {
3444
3737
  const wasSet = this.eIsSet(feature);
@@ -3491,6 +3784,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3491
3784
  return this.getELiterals().find((candidate) => candidate.getLiteral() === literal);
3492
3785
  }
3493
3786
  eGet(feature) {
3787
+ this.requireOwnFeature(feature);
3494
3788
  switch (feature.getFeatureID()) {
3495
3789
  case 9:
3496
3790
  return this._eLiterals;
@@ -3499,6 +3793,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3499
3793
  }
3500
3794
  }
3501
3795
  eSet(feature, value) {
3796
+ this.requireOwnFeature(feature);
3502
3797
  switch (feature.getFeatureID()) {
3503
3798
  case 9: {
3504
3799
  const list = this._eLiterals;
@@ -3520,6 +3815,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3520
3815
  return;
3521
3816
  }
3522
3817
  }
3818
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3523
3819
  eBootstrapList(featureId) {
3524
3820
  switch (featureId) {
3525
3821
  case 9:
@@ -3530,6 +3826,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3530
3826
  }
3531
3827
  }
3532
3828
  eIsSet(feature) {
3829
+ this.requireOwnFeature(feature);
3533
3830
  switch (feature.getFeatureID()) {
3534
3831
  case 9:
3535
3832
  return this._eLiteralsCache !== void 0 && this._eLiteralsCache.size() !== 0;
@@ -3538,6 +3835,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3538
3835
  }
3539
3836
  }
3540
3837
  eUnset(feature) {
3838
+ this.requireOwnFeature(feature);
3541
3839
  switch (feature.getFeatureID()) {
3542
3840
  case 9:
3543
3841
  this._eLiteralsCache?.clear();
@@ -3590,6 +3888,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3590
3888
  this._eEnum = value;
3591
3889
  }
3592
3890
  eGet(feature) {
3891
+ this.requireOwnFeature(feature);
3593
3892
  switch (feature.getFeatureID()) {
3594
3893
  case 2:
3595
3894
  return this._value;
@@ -3604,6 +3903,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3604
3903
  }
3605
3904
  }
3606
3905
  eSet(feature, value) {
3906
+ this.requireOwnFeature(feature);
3607
3907
  switch (feature.getFeatureID()) {
3608
3908
  case 2: {
3609
3909
  const oldValue = this.eGet(feature);
@@ -3667,6 +3967,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3667
3967
  return;
3668
3968
  }
3669
3969
  }
3970
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3670
3971
  eBootstrapList(featureId) {
3671
3972
  switch (featureId) {
3672
3973
  default:
@@ -3674,6 +3975,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3674
3975
  }
3675
3976
  }
3676
3977
  eIsSet(feature) {
3978
+ this.requireOwnFeature(feature);
3677
3979
  switch (feature.getFeatureID()) {
3678
3980
  case 2:
3679
3981
  return this._value !== 0;
@@ -3688,6 +3990,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3688
3990
  }
3689
3991
  }
3690
3992
  eUnset(feature) {
3993
+ this.requireOwnFeature(feature);
3691
3994
  switch (feature.getFeatureID()) {
3692
3995
  case 2: {
3693
3996
  const wasSet = this.eIsSet(feature);
@@ -3793,6 +4096,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3793
4096
  getOperationID() {
3794
4097
  return this.operationId;
3795
4098
  }
4099
+ /** Sets the operation's ID; called by generated packages. */
3796
4100
  setOperationID(id) {
3797
4101
  this.operationId = id;
3798
4102
  }
@@ -3834,6 +4138,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3834
4138
  return true;
3835
4139
  }
3836
4140
  eGet(feature) {
4141
+ this.requireOwnFeature(feature);
3837
4142
  switch (feature.getFeatureID()) {
3838
4143
  case 10:
3839
4144
  return this._eContainingClass;
@@ -3850,6 +4155,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3850
4155
  }
3851
4156
  }
3852
4157
  eSet(feature, value) {
4158
+ this.requireOwnFeature(feature);
3853
4159
  switch (feature.getFeatureID()) {
3854
4160
  case 11: {
3855
4161
  const list = this._eTypeParameters;
@@ -3895,6 +4201,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3895
4201
  return;
3896
4202
  }
3897
4203
  }
4204
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3898
4205
  eBootstrapList(featureId) {
3899
4206
  switch (featureId) {
3900
4207
  case 11:
@@ -3914,6 +4221,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3914
4221
  }
3915
4222
  }
3916
4223
  eIsSet(feature) {
4224
+ this.requireOwnFeature(feature);
3917
4225
  switch (feature.getFeatureID()) {
3918
4226
  case 10:
3919
4227
  return this._eContainingClass !== void 0;
@@ -3930,6 +4238,7 @@ var EOperationImpl = class extends ETypedElementImpl {
3930
4238
  }
3931
4239
  }
3932
4240
  eUnset(feature) {
4241
+ this.requireOwnFeature(feature);
3933
4242
  switch (feature.getFeatureID()) {
3934
4243
  case 10: {
3935
4244
  const wasSet = this.eIsSet(feature);
@@ -4019,6 +4328,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4019
4328
  return this.getEClassifiers().filter((cl) => cl.getName() === name).at(0);
4020
4329
  }
4021
4330
  eGet(feature) {
4331
+ this.requireOwnFeature(feature);
4022
4332
  switch (feature.getFeatureID()) {
4023
4333
  case 2:
4024
4334
  return this._nsURI;
@@ -4037,6 +4347,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4037
4347
  }
4038
4348
  }
4039
4349
  eSet(feature, value) {
4350
+ this.requireOwnFeature(feature);
4040
4351
  switch (feature.getFeatureID()) {
4041
4352
  case 2: {
4042
4353
  const oldValue = this.eGet(feature);
@@ -4131,6 +4442,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4131
4442
  return;
4132
4443
  }
4133
4444
  }
4445
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4134
4446
  eBootstrapList(featureId) {
4135
4447
  switch (featureId) {
4136
4448
  case 5:
@@ -4144,6 +4456,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4144
4456
  }
4145
4457
  }
4146
4458
  eIsSet(feature) {
4459
+ this.requireOwnFeature(feature);
4147
4460
  switch (feature.getFeatureID()) {
4148
4461
  case 2:
4149
4462
  return this._nsURI !== void 0;
@@ -4162,6 +4475,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4162
4475
  }
4163
4476
  }
4164
4477
  eUnset(feature) {
4478
+ this.requireOwnFeature(feature);
4165
4479
  switch (feature.getFeatureID()) {
4166
4480
  case 2: {
4167
4481
  const wasSet = this.eIsSet(feature);
@@ -4253,6 +4567,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4253
4567
  this._eOperation = value;
4254
4568
  }
4255
4569
  eGet(feature) {
4570
+ this.requireOwnFeature(feature);
4256
4571
  switch (feature.getFeatureID()) {
4257
4572
  case 10:
4258
4573
  return this._eOperation;
@@ -4261,6 +4576,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4261
4576
  }
4262
4577
  }
4263
4578
  eSet(feature, value) {
4579
+ this.requireOwnFeature(feature);
4264
4580
  switch (feature.getFeatureID()) {
4265
4581
  default:
4266
4582
  super.eSet(feature, value);
@@ -4278,6 +4594,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4278
4594
  return;
4279
4595
  }
4280
4596
  }
4597
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4281
4598
  eBootstrapList(featureId) {
4282
4599
  switch (featureId) {
4283
4600
  default:
@@ -4285,6 +4602,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4285
4602
  }
4286
4603
  }
4287
4604
  eIsSet(feature) {
4605
+ this.requireOwnFeature(feature);
4288
4606
  switch (feature.getFeatureID()) {
4289
4607
  case 10:
4290
4608
  return this._eOperation !== void 0;
@@ -4293,6 +4611,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4293
4611
  }
4294
4612
  }
4295
4613
  eUnset(feature) {
4614
+ this.requireOwnFeature(feature);
4296
4615
  switch (feature.getFeatureID()) {
4297
4616
  case 10: {
4298
4617
  const wasSet = this.eIsSet(feature);
@@ -4360,6 +4679,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4360
4679
  return this._eKeys;
4361
4680
  }
4362
4681
  eGet(feature) {
4682
+ this.requireOwnFeature(feature);
4363
4683
  switch (feature.getFeatureID()) {
4364
4684
  case 18:
4365
4685
  return this._containment;
@@ -4378,6 +4698,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4378
4698
  }
4379
4699
  }
4380
4700
  eSet(feature, value) {
4701
+ this.requireOwnFeature(feature);
4381
4702
  switch (feature.getFeatureID()) {
4382
4703
  case 18: {
4383
4704
  const oldValue = this.eGet(feature);
@@ -4468,6 +4789,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4468
4789
  return;
4469
4790
  }
4470
4791
  }
4792
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4471
4793
  eBootstrapList(featureId) {
4472
4794
  switch (featureId) {
4473
4795
  case 23:
@@ -4478,6 +4800,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4478
4800
  }
4479
4801
  }
4480
4802
  eIsSet(feature) {
4803
+ this.requireOwnFeature(feature);
4481
4804
  switch (feature.getFeatureID()) {
4482
4805
  case 18:
4483
4806
  return this._containment !== false;
@@ -4496,6 +4819,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4496
4819
  }
4497
4820
  }
4498
4821
  eUnset(feature) {
4822
+ this.requireOwnFeature(feature);
4499
4823
  switch (feature.getFeatureID()) {
4500
4824
  case 18: {
4501
4825
  const wasSet = this.eIsSet(feature);
@@ -4601,6 +4925,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4601
4925
  return this._eBounds;
4602
4926
  }
4603
4927
  eGet(feature) {
4928
+ this.requireOwnFeature(feature);
4604
4929
  switch (feature.getFeatureID()) {
4605
4930
  case 2:
4606
4931
  return this._eBounds;
@@ -4609,6 +4934,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4609
4934
  }
4610
4935
  }
4611
4936
  eSet(feature, value) {
4937
+ this.requireOwnFeature(feature);
4612
4938
  switch (feature.getFeatureID()) {
4613
4939
  case 2: {
4614
4940
  const list = this._eBounds;
@@ -4630,6 +4956,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4630
4956
  return;
4631
4957
  }
4632
4958
  }
4959
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4633
4960
  eBootstrapList(featureId) {
4634
4961
  switch (featureId) {
4635
4962
  case 2:
@@ -4640,6 +4967,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4640
4967
  }
4641
4968
  }
4642
4969
  eIsSet(feature) {
4970
+ this.requireOwnFeature(feature);
4643
4971
  switch (feature.getFeatureID()) {
4644
4972
  case 2:
4645
4973
  return this._eBoundsCache !== void 0 && this._eBoundsCache.size() !== 0;
@@ -4648,6 +4976,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4648
4976
  }
4649
4977
  }
4650
4978
  eUnset(feature) {
4979
+ this.requireOwnFeature(feature);
4651
4980
  switch (feature.getFeatureID()) {
4652
4981
  case 2:
4653
4982
  this._eBoundsCache?.clear();
@@ -4825,26 +5154,20 @@ var ResourceFactoryRegistryImpl = class {
4825
5154
  const byExtension = this.factoriesByExtension.get(extension);
4826
5155
  if (byExtension) return byExtension;
4827
5156
  }
4828
- return this.factoriesByProtocol.get(uri.getScheme());
5157
+ const scheme = uri.getScheme();
5158
+ return scheme === void 0 ? void 0 : this.factoriesByProtocol.get(scheme);
4829
5159
  }
4830
5160
  };
4831
5161
 
4832
5162
  // src/resource/resource-utils.ts
4833
- var resourceByRoot = /* @__PURE__ */ new WeakMap();
4834
5163
  function associateRoot(root, resource) {
4835
- resourceByRoot.set(root, resource);
5164
+ root.eSetDirectResource(resource);
4836
5165
  }
4837
5166
  function dissociateRoot(root) {
4838
- resourceByRoot.delete(root);
5167
+ root.eSetDirectResource(void 0);
4839
5168
  }
4840
5169
  function getResourceOf(obj) {
4841
- let current = obj;
4842
- let container = current.eContainer();
4843
- while (container) {
4844
- current = container;
4845
- container = current.eContainer();
4846
- }
4847
- return resourceByRoot.get(current);
5170
+ return obj.eResource();
4848
5171
  }
4849
5172
 
4850
5173
  // src/resource/resource-impl.ts
@@ -4855,13 +5178,28 @@ var ResourceContentsList = class extends BasicEList {
4855
5178
  }
4856
5179
  owningResource;
4857
5180
  add(item) {
5181
+ if (this.contains(item)) return;
5182
+ this.detachFromCurrentOwner(item);
4858
5183
  super.add(item);
4859
5184
  associateRoot(item, this.owningResource);
4860
5185
  }
4861
5186
  addAt(index, item) {
5187
+ if (this.contains(item)) return;
5188
+ this.detachFromCurrentOwner(item);
4862
5189
  super.addAt(index, item);
4863
5190
  associateRoot(item, this.owningResource);
4864
5191
  }
5192
+ detachFromCurrentOwner(item) {
5193
+ const container = item.eContainer();
5194
+ if (container) {
5195
+ item.eBasicDetachFromContainer();
5196
+ return;
5197
+ }
5198
+ const oldResource = getResourceOf(item);
5199
+ if (oldResource && oldResource !== this.owningResource) {
5200
+ oldResource.getContents().remove(item);
5201
+ }
5202
+ }
4865
5203
  addAll(items) {
4866
5204
  for (const item of items) this.add(item);
4867
5205
  }
@@ -4910,6 +5248,7 @@ var ResourceImpl = class {
4910
5248
  getSerializer() {
4911
5249
  return this.serializer;
4912
5250
  }
5251
+ /** @internal */
4913
5252
  eSetResourceSet(resourceSet) {
4914
5253
  this.resourceSet = resourceSet;
4915
5254
  }
@@ -4922,26 +5261,9 @@ var ResourceImpl = class {
4922
5261
  isLoaded() {
4923
5262
  return this.loaded;
4924
5263
  }
4925
- /**
4926
- * Concurrency-protected: `loaded` only flips to true once deserialize() fully finishes, so
4927
- * multiple concurrent load() calls for this exact resource - genuinely racing, none of them
4928
- * blocking on any of the others' own completion - used to each independently see
4929
- * `!resource.isLoaded()` and start their own, fully separate deserialize() call. Collapsed here
4930
- * into one: a call made while another is already in flight awaits that same, single,
4931
- * already-running promise instead. The real fix for a real, confirmed exponential-blowup hazard
4932
- * found this way: a self-referential metamodel (e.g. a "Feature contains child Features" style
4933
- * containment cycle - a normal, valid pattern, not a modeling error) can have many concurrent,
4934
- * independent resolve() calls converge on the same not-yet-finished resource.
4935
- *
4936
- * What this does NOT, and cannot, fix on its own: a caller that *directly awaits* a nested
4937
- * load() call on this exact resource, from within this resource's own still-running
4938
- * deserialize() itself, still deadlocks - confirmed directly, not just reasoned about. The
4939
- * shared, returned promise can only resolve once deserialize() returns, but deserialize() would
4940
- * now be waiting on that very promise, a genuine circular wait no Resource-level guard can
4941
- * break. A caller with that exact shape (e.g. SnapshotSerializer's own reconstruction of a
4942
- * self-referential metamodel) has to avoid making the reentrant load() call at all instead -
4943
- * see SnapshotSerializer's own registry.objectFor() short-circuit for how.
4944
- */
5264
+ // A load already in progress is shared: a self-referential model can trigger many concurrent
5265
+ // resolve() calls into the same resource. A load() awaited from inside this resource's own
5266
+ // deserialize() would still deadlock.
4945
5267
  async load() {
4946
5268
  if (this.loadInProgress) return this.loadInProgress;
4947
5269
  this.loadInProgress = this.doLoad();
@@ -5131,22 +5453,38 @@ var URI = class _URI {
5131
5453
  hasAuthority;
5132
5454
  path;
5133
5455
  fragment;
5456
+ /**
5457
+ * Parses `scheme:path`, `scheme://path` or, without a scheme, a relative reference. Never throws;
5458
+ * resolve a relative reference against a base before using it as a document location.
5459
+ */
5134
5460
  static parse(uriString) {
5135
- const match = /^([a-zA-Z][a-zA-Z0-9+.-]*):(\/\/)?([^#]*)(?:#(.*))?$/.exec(uriString);
5136
- if (!match) {
5137
- throw new Error(`Not a valid absolute URI: '${uriString}' (expected "scheme:path" or "scheme://path")`);
5461
+ const absolute = /^([a-zA-Z][a-zA-Z0-9+.-]*):(\/\/)?([^#]*)(?:#(.*))?$/.exec(uriString);
5462
+ if (absolute) {
5463
+ const [, scheme, authorityMarker, path2, fragment2] = absolute;
5464
+ return new _URI(scheme, authorityMarker === "//", path2, fragment2);
5138
5465
  }
5139
- const [, scheme, authorityMarker, path, fragment] = match;
5140
- return new _URI(scheme, authorityMarker === "//", path, fragment);
5466
+ const [, path, fragment] = /^([^#]*)(?:#(.*))?$/.exec(uriString);
5467
+ return new _URI(void 0, false, path, fragment);
5141
5468
  }
5142
- /** Convenience for the common case of wrapping a filesystem path. */
5469
+ /**
5470
+ * A `file:` URI for a file system path, as EMF's `URI.createFileURI`. Backslashes become slashes,
5471
+ * a drive letter path (`C:\models\a.xmi`) becomes absolute, and each segment is percent-encoded
5472
+ * except for `:`. Converting back to a path is the job of a `UriConverter`.
5473
+ */
5143
5474
  static createFileURI(path) {
5144
- const normalized = path.startsWith("/") ? path : `/${path}`;
5145
- return new _URI("file", true, normalized, void 0);
5475
+ const normalized = path.replace(/\\/g, "/");
5476
+ const absolute = normalized.startsWith("/") ? normalized : `/${normalized}`;
5477
+ const encoded = absolute.split("/").map(encodePathSegment).join("/");
5478
+ return new _URI("file", true, encoded, void 0);
5146
5479
  }
5480
+ /** Undefined for a relative reference - see the class doc comment. */
5147
5481
  getScheme() {
5148
5482
  return this.scheme;
5149
5483
  }
5484
+ /** A relative reference, as opposed to one naming an absolute document location. */
5485
+ isRelative() {
5486
+ return this.scheme === void 0;
5487
+ }
5150
5488
  getPath() {
5151
5489
  return this.path;
5152
5490
  }
@@ -5166,15 +5504,58 @@ var URI = class _URI {
5166
5504
  trimFragment() {
5167
5505
  return this.fragment === void 0 ? this : this.withFragment(void 0);
5168
5506
  }
5507
+ /**
5508
+ * This URI made absolute against `base` if it is relative, unchanged otherwise. Keeps this URI's
5509
+ * fragment and ignores `base`'s.
5510
+ */
5511
+ resolve(base) {
5512
+ if (!this.isRelative()) return this;
5513
+ const baseDir = base.path.slice(0, base.path.lastIndexOf("/") + 1);
5514
+ const merged = this.path.startsWith("/") ? this.path : baseDir + this.path;
5515
+ return new _URI(base.scheme, base.hasAuthority, normalizePath(merged), this.fragment);
5516
+ }
5517
+ /**
5518
+ * The shortest relative reference from `base` to this URI if both have the same scheme and
5519
+ * authority, unchanged otherwise. The inverse of {@link resolve}.
5520
+ */
5521
+ deresolve(base) {
5522
+ if (this.isRelative() || this.scheme !== base.scheme || this.hasAuthority !== base.hasAuthority) return this;
5523
+ const baseDirSegments = base.path.split("/").slice(0, -1);
5524
+ const targetSegments = this.path.split("/");
5525
+ let common = 0;
5526
+ while (common < baseDirSegments.length && common < targetSegments.length && baseDirSegments[common] === targetSegments[common]) {
5527
+ common++;
5528
+ }
5529
+ const upSegments = baseDirSegments.slice(common).map(() => "..");
5530
+ const relativePath = [...upSegments, ...targetSegments.slice(common)].join("/");
5531
+ return new _URI(void 0, false, relativePath, this.fragment);
5532
+ }
5169
5533
  toString() {
5534
+ const schemePart = this.scheme !== void 0 ? `${this.scheme}:` : "";
5170
5535
  const authority = this.hasAuthority ? "//" : "";
5171
5536
  const fragmentPart = this.fragment !== void 0 ? `#${this.fragment}` : "";
5172
- return `${this.scheme}:${authority}${this.path}${fragmentPart}`;
5537
+ return `${schemePart}${authority}${this.path}${fragmentPart}`;
5173
5538
  }
5174
5539
  equals(other) {
5175
5540
  return this.toString() === other.toString();
5176
5541
  }
5177
5542
  };
5543
+ function normalizePath(path) {
5544
+ const segments = path.split("/");
5545
+ const result = [];
5546
+ for (const segment of segments) {
5547
+ if (segment === ".") continue;
5548
+ if (segment === ".." && result.length > 0 && result[result.length - 1] !== "" && result.at(-1) !== "..") {
5549
+ result.pop();
5550
+ } else {
5551
+ result.push(segment);
5552
+ }
5553
+ }
5554
+ return result.join("/");
5555
+ }
5556
+ function encodePathSegment(segment) {
5557
+ return segment.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]/g, (ch) => encodeURIComponent(ch));
5558
+ }
5178
5559
 
5179
5560
  // src/metamodel/EcorePackage.ts
5180
5561
  var Ids = {
@@ -5327,6 +5708,13 @@ var Ids = {
5327
5708
 
5328
5709
  // src/metamodel/impl/EcoreFactoryImpl.ts
5329
5710
  var EcoreFactoryImpl = class extends EFactoryImpl {
5711
+ /**
5712
+ * The factory instance, as EMF's `EcoreFactory.eINSTANCE` (on the class, since
5713
+ * TypeScript interfaces have no statics). Reading it constructs the package if necessary.
5714
+ */
5715
+ static get eINSTANCE() {
5716
+ return getEcorePackageRef().getEFactoryInstance();
5717
+ }
5330
5718
  createEAttribute() {
5331
5719
  return new EAttributeImpl();
5332
5720
  }
@@ -5584,14 +5972,9 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
5584
5972
  _EInvocationTargetException;
5585
5973
  static _instance;
5586
5974
  /**
5587
- * The one explicit entry point that constructs the singleton - call it
5588
- * yourself, with your own factory, before anything else in your program
5589
- * touches EcorePackageImpl.eINSTANCE, to use a custom factory (e.g. one
5590
- * overriding createX() to return your own derived classes). Whichever
5591
- * caller gets here FIRST wins; a later call with a *different* factory
5592
- * is logged and otherwise ignored, rather than silently replacing an
5593
- * already-in-use singleton or throwing on a caller who didn't cause the
5594
- * conflict.
5975
+ * Constructs the package, if that hasn't happened yet, and returns it. To use your own factory
5976
+ * (e.g. one returning subclasses), call this with it before anything reads `eINSTANCE`; a
5977
+ * factory passed after construction is ignored with a warning.
5595
5978
  */
5596
5979
  static init(factory) {
5597
5980
  if (!_EcorePackageImpl._instance) {
@@ -5835,7 +6218,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
5835
6218
  {
5836
6219
  const entry = new EStringToStringMapEntryImpl();
5837
6220
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
5838
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6221
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string");
5839
6222
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
5840
6223
  }
5841
6224
  this._EBigDecimal.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -5861,7 +6244,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
5861
6244
  {
5862
6245
  const entry = new EStringToStringMapEntryImpl();
5863
6246
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
5864
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6247
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint");
5865
6248
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
5866
6249
  }
5867
6250
  this._EBigInteger.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -5971,7 +6354,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
5971
6354
  {
5972
6355
  const entry = new EStringToStringMapEntryImpl();
5973
6356
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
5974
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number []");
6357
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "Uint8Array");
5975
6358
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
5976
6359
  }
5977
6360
  this._EByteArray.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6050,7 +6433,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6050
6433
  {
6051
6434
  const entry = new EStringToStringMapEntryImpl();
6052
6435
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6053
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string []");
6436
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string | undefined");
6054
6437
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6055
6438
  }
6056
6439
  this._ECharacterObject.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6065,7 +6448,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6065
6448
  {
6066
6449
  const entry = new EStringToStringMapEntryImpl();
6067
6450
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6068
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "unknown");
6451
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "Date");
6069
6452
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6070
6453
  }
6071
6454
  this._EDate.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6406,7 +6789,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6406
6789
  {
6407
6790
  const entry = new EStringToStringMapEntryImpl();
6408
6791
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6409
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6792
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint");
6410
6793
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6411
6794
  }
6412
6795
  this._ELong.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6438,7 +6821,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6438
6821
  {
6439
6822
  const entry = new EStringToStringMapEntryImpl();
6440
6823
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6441
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number | undefined");
6824
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint | undefined");
6442
6825
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6443
6826
  }
6444
6827
  this._ELongObject.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6645,40 +7028,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6645
7028
  this._EStringToStringMapEntry = new EClassImpl();
6646
7029
  this._EStringToStringMapEntry.eBasicSetValue(Ids.ENamedElement.name, "EStringToStringMapEntry");
6647
7030
  this._EStringToStringMapEntry.setClassifierID(Ids.EStringToStringMapEntry.self);
6648
- {
6649
- const annotation = new EAnnotationImpl();
6650
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
6651
- {
6652
- const entry = new EStringToStringMapEntryImpl();
6653
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6654
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EStringToStringMapEntry");
6655
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6656
- }
6657
- this._EStringToStringMapEntry.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6658
- }
6659
- {
6660
- const annotation = new EAnnotationImpl();
6661
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
6662
- {
6663
- const entry = new EStringToStringMapEntryImpl();
6664
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6665
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EStringToStringMapEntry");
6666
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6667
- }
6668
- {
6669
- const entry = new EStringToStringMapEntryImpl();
6670
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
6671
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
6672
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6673
- }
6674
- {
6675
- const entry = new EStringToStringMapEntryImpl();
6676
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
6677
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./types/EStringToStringMapEntry");
6678
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6679
- }
6680
- this._EStringToStringMapEntry.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6681
- }
6682
7031
  this.eBootstrapList(Ids.EPackage.eClassifiers).add(this._EStringToStringMapEntry);
6683
7032
  this._ETreeIterator = new EDataTypeImpl();
6684
7033
  this._ETreeIterator.eBasicSetValue(Ids.ENamedElement.name, "ETreeIterator");
@@ -6870,23 +7219,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6870
7219
  this._EClass_eSuperTypes.setContainerClass(EClassImpl);
6871
7220
  this._EClass_eSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
6872
7221
  this._EClass_eSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
6873
- {
6874
- const annotation = new EAnnotationImpl();
6875
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
6876
- {
6877
- const entry = new EStringToStringMapEntryImpl();
6878
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
6879
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
6880
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6881
- }
6882
- {
6883
- const entry = new EStringToStringMapEntryImpl();
6884
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
6885
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
6886
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6887
- }
6888
- this._EClass_eSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6889
- }
6890
7222
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eSuperTypes);
6891
7223
  this._EClass_eOperations = new EReferenceImpl();
6892
7224
  this._EClass_eOperations.eBasicSetValue(Ids.ENamedElement.name, "eOperations");
@@ -6921,60 +7253,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6921
7253
  this._EClass_eAllAttributes.setContainerClass(EClassImpl);
6922
7254
  this._EClass_eAllAttributes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
6923
7255
  this._EClass_eAllAttributes.eBasicSetValue(Ids.EReference.containment, false);
6924
- {
6925
- const annotation = new EAnnotationImpl();
6926
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
6927
- {
6928
- const entry = new EStringToStringMapEntryImpl();
6929
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
6930
- entry.eBasicSetValue(
6931
- Ids.EStringToStringMapEntry.value,
6932
- "return new BasicEList<EAttribute>(undefined, undefined, this.getEAllStructuralFeatures().filter(isEAttribute) as EAttribute[]);"
6933
- );
6934
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6935
- }
6936
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6937
- }
6938
- {
6939
- const annotation = new EAnnotationImpl();
6940
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
6941
- {
6942
- const entry = new EStringToStringMapEntryImpl();
6943
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6944
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
6945
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6946
- }
6947
- {
6948
- const entry = new EStringToStringMapEntryImpl();
6949
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
6950
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
6951
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6952
- }
6953
- {
6954
- const entry = new EStringToStringMapEntryImpl();
6955
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
6956
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
6957
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6958
- }
6959
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6960
- }
6961
- {
6962
- const annotation = new EAnnotationImpl();
6963
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
6964
- {
6965
- const entry = new EStringToStringMapEntryImpl();
6966
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6967
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEAttribute");
6968
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6969
- }
6970
- {
6971
- const entry = new EStringToStringMapEntryImpl();
6972
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
6973
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
6974
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6975
- }
6976
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
6977
- }
6978
7256
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllAttributes);
6979
7257
  this._EClass_eAllReferences = new EReferenceImpl();
6980
7258
  this._EClass_eAllReferences.eBasicSetValue(Ids.ENamedElement.name, "eAllReferences");
@@ -6992,60 +7270,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6992
7270
  this._EClass_eAllReferences.setContainerClass(EClassImpl);
6993
7271
  this._EClass_eAllReferences.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
6994
7272
  this._EClass_eAllReferences.eBasicSetValue(Ids.EReference.containment, false);
6995
- {
6996
- const annotation = new EAnnotationImpl();
6997
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
6998
- {
6999
- const entry = new EStringToStringMapEntryImpl();
7000
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7001
- entry.eBasicSetValue(
7002
- Ids.EStringToStringMapEntry.value,
7003
- "return new BasicEList<EReference>(undefined, undefined, this.getEAllStructuralFeatures().filter(isEReference) as EReference[]);"
7004
- );
7005
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7006
- }
7007
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7008
- }
7009
- {
7010
- const annotation = new EAnnotationImpl();
7011
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7012
- {
7013
- const entry = new EStringToStringMapEntryImpl();
7014
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7015
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7016
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7017
- }
7018
- {
7019
- const entry = new EStringToStringMapEntryImpl();
7020
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7021
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7022
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7023
- }
7024
- {
7025
- const entry = new EStringToStringMapEntryImpl();
7026
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7027
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7028
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7029
- }
7030
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7031
- }
7032
- {
7033
- const annotation = new EAnnotationImpl();
7034
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7035
- {
7036
- const entry = new EStringToStringMapEntryImpl();
7037
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7038
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7039
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7040
- }
7041
- {
7042
- const entry = new EStringToStringMapEntryImpl();
7043
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7044
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7045
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7046
- }
7047
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7048
- }
7049
7273
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllReferences);
7050
7274
  this._EClass_eReferences = new EReferenceImpl();
7051
7275
  this._EClass_eReferences.eBasicSetValue(Ids.ENamedElement.name, "eReferences");
@@ -7063,60 +7287,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7063
7287
  this._EClass_eReferences.setContainerClass(EClassImpl);
7064
7288
  this._EClass_eReferences.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7065
7289
  this._EClass_eReferences.eBasicSetValue(Ids.EReference.containment, false);
7066
- {
7067
- const annotation = new EAnnotationImpl();
7068
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7069
- {
7070
- const entry = new EStringToStringMapEntryImpl();
7071
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7072
- entry.eBasicSetValue(
7073
- Ids.EStringToStringMapEntry.value,
7074
- "return new BasicEList<EReference>(undefined, undefined, this.getEStructuralFeatures().filter(isEReference) as EReference[]);"
7075
- );
7076
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7077
- }
7078
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7079
- }
7080
- {
7081
- const annotation = new EAnnotationImpl();
7082
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7083
- {
7084
- const entry = new EStringToStringMapEntryImpl();
7085
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7086
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7087
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7088
- }
7089
- {
7090
- const entry = new EStringToStringMapEntryImpl();
7091
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7092
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7093
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7094
- }
7095
- {
7096
- const entry = new EStringToStringMapEntryImpl();
7097
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7098
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7099
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7100
- }
7101
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7102
- }
7103
- {
7104
- const annotation = new EAnnotationImpl();
7105
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7106
- {
7107
- const entry = new EStringToStringMapEntryImpl();
7108
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7109
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7110
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7111
- }
7112
- {
7113
- const entry = new EStringToStringMapEntryImpl();
7114
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7115
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7116
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7117
- }
7118
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7119
- }
7120
7290
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eReferences);
7121
7291
  this._EClass_eAttributes = new EReferenceImpl();
7122
7292
  this._EClass_eAttributes.eBasicSetValue(Ids.ENamedElement.name, "eAttributes");
@@ -7134,60 +7304,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7134
7304
  this._EClass_eAttributes.setContainerClass(EClassImpl);
7135
7305
  this._EClass_eAttributes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7136
7306
  this._EClass_eAttributes.eBasicSetValue(Ids.EReference.containment, false);
7137
- {
7138
- const annotation = new EAnnotationImpl();
7139
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7140
- {
7141
- const entry = new EStringToStringMapEntryImpl();
7142
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7143
- entry.eBasicSetValue(
7144
- Ids.EStringToStringMapEntry.value,
7145
- "return new BasicEList<EAttribute>(undefined, undefined, this.getEStructuralFeatures().filter(isEAttribute) as EAttribute[]);"
7146
- );
7147
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7148
- }
7149
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7150
- }
7151
- {
7152
- const annotation = new EAnnotationImpl();
7153
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7154
- {
7155
- const entry = new EStringToStringMapEntryImpl();
7156
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7157
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7158
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7159
- }
7160
- {
7161
- const entry = new EStringToStringMapEntryImpl();
7162
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7163
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7164
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7165
- }
7166
- {
7167
- const entry = new EStringToStringMapEntryImpl();
7168
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7169
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7170
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7171
- }
7172
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7173
- }
7174
- {
7175
- const annotation = new EAnnotationImpl();
7176
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7177
- {
7178
- const entry = new EStringToStringMapEntryImpl();
7179
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7180
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEAttribute");
7181
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7182
- }
7183
- {
7184
- const entry = new EStringToStringMapEntryImpl();
7185
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7186
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7187
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7188
- }
7189
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7190
- }
7191
7307
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAttributes);
7192
7308
  this._EClass_eAllContainments = new EReferenceImpl();
7193
7309
  this._EClass_eAllContainments.eBasicSetValue(Ids.ENamedElement.name, "eAllContainments");
@@ -7205,60 +7321,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7205
7321
  this._EClass_eAllContainments.setContainerClass(EClassImpl);
7206
7322
  this._EClass_eAllContainments.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7207
7323
  this._EClass_eAllContainments.eBasicSetValue(Ids.EReference.containment, false);
7208
- {
7209
- const annotation = new EAnnotationImpl();
7210
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7211
- {
7212
- const entry = new EStringToStringMapEntryImpl();
7213
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7214
- entry.eBasicSetValue(
7215
- Ids.EStringToStringMapEntry.value,
7216
- "const references = this.getEAllStructuralFeatures().filter(isEReference) as EReference[];\nreturn new BasicEList<EReference>(undefined, undefined, references.filter(reference => reference.isContainment()));"
7217
- );
7218
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7219
- }
7220
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7221
- }
7222
- {
7223
- const annotation = new EAnnotationImpl();
7224
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7225
- {
7226
- const entry = new EStringToStringMapEntryImpl();
7227
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7228
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7229
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7230
- }
7231
- {
7232
- const entry = new EStringToStringMapEntryImpl();
7233
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7234
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7235
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7236
- }
7237
- {
7238
- const entry = new EStringToStringMapEntryImpl();
7239
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7240
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7241
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7242
- }
7243
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7244
- }
7245
- {
7246
- const annotation = new EAnnotationImpl();
7247
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7248
- {
7249
- const entry = new EStringToStringMapEntryImpl();
7250
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7251
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7252
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7253
- }
7254
- {
7255
- const entry = new EStringToStringMapEntryImpl();
7256
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7257
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7258
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7259
- }
7260
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7261
- }
7262
7324
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllContainments);
7263
7325
  this._EClass_eAllOperations = new EReferenceImpl();
7264
7326
  this._EClass_eAllOperations.eBasicSetValue(Ids.ENamedElement.name, "eAllOperations");
@@ -7276,60 +7338,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7276
7338
  this._EClass_eAllOperations.setContainerClass(EClassImpl);
7277
7339
  this._EClass_eAllOperations.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7278
7340
  this._EClass_eAllOperations.eBasicSetValue(Ids.EReference.containment, false);
7279
- {
7280
- const annotation = new EAnnotationImpl();
7281
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7282
- {
7283
- const entry = new EStringToStringMapEntryImpl();
7284
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7285
- entry.eBasicSetValue(
7286
- Ids.EStringToStringMapEntry.value,
7287
- "const operations = new Set<EOperation>();\nconst visited = new Set<EClass>();\nconst visit = (eClass: EClass): void => {\n if (visited.has(eClass)) return;\n visited.add(eClass);\n eClass.getESuperTypes().forEach(visit);\n for (const generic of eClass.getEGenericSuperTypes()) {\n const raw = generic.getEClassifier();\n if (raw !== undefined && isEClass(raw)) visit(raw);\n }\n eClass.getEOperations().forEach(operation => operations.add(operation));\n};\nvisit(this);\nreturn new BasicEList<EOperation>(undefined, undefined, operations);"
7288
- );
7289
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7290
- }
7291
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7292
- }
7293
- {
7294
- const annotation = new EAnnotationImpl();
7295
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7296
- {
7297
- const entry = new EStringToStringMapEntryImpl();
7298
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7299
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7300
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7301
- }
7302
- {
7303
- const entry = new EStringToStringMapEntryImpl();
7304
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7305
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7306
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7307
- }
7308
- {
7309
- const entry = new EStringToStringMapEntryImpl();
7310
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7311
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7312
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7313
- }
7314
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7315
- }
7316
- {
7317
- const annotation = new EAnnotationImpl();
7318
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7319
- {
7320
- const entry = new EStringToStringMapEntryImpl();
7321
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7322
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7323
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7324
- }
7325
- {
7326
- const entry = new EStringToStringMapEntryImpl();
7327
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7328
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7329
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7330
- }
7331
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7332
- }
7333
7341
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllOperations);
7334
7342
  this._EClass_eAllStructuralFeatures = new EReferenceImpl();
7335
7343
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.ENamedElement.name, "eAllStructuralFeatures");
@@ -7347,60 +7355,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7347
7355
  this._EClass_eAllStructuralFeatures.setContainerClass(EClassImpl);
7348
7356
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7349
7357
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.EReference.containment, false);
7350
- {
7351
- const annotation = new EAnnotationImpl();
7352
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7353
- {
7354
- const entry = new EStringToStringMapEntryImpl();
7355
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7356
- entry.eBasicSetValue(
7357
- Ids.EStringToStringMapEntry.value,
7358
- "const features = new Set<EStructuralFeature>();\nconst visited = new Set<EClass>();\nconst visit = (eClass: EClass): void => {\n if (visited.has(eClass)) return;\n visited.add(eClass);\n eClass.getESuperTypes().forEach(visit);\n for (const generic of eClass.getEGenericSuperTypes()) {\n const raw = generic.getEClassifier();\n if (raw !== undefined && isEClass(raw)) visit(raw);\n }\n eClass.getEStructuralFeatures().forEach(feature => features.add(feature));\n};\nvisit(this);\nreturn new BasicEList<EStructuralFeature>(undefined, undefined, features);"
7359
- );
7360
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7361
- }
7362
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7363
- }
7364
- {
7365
- const annotation = new EAnnotationImpl();
7366
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7367
- {
7368
- const entry = new EStringToStringMapEntryImpl();
7369
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7370
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7371
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7372
- }
7373
- {
7374
- const entry = new EStringToStringMapEntryImpl();
7375
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7376
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7377
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7378
- }
7379
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7380
- }
7381
- {
7382
- const annotation = new EAnnotationImpl();
7383
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7384
- {
7385
- const entry = new EStringToStringMapEntryImpl();
7386
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7387
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7388
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7389
- }
7390
- {
7391
- const entry = new EStringToStringMapEntryImpl();
7392
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7393
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7394
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7395
- }
7396
- {
7397
- const entry = new EStringToStringMapEntryImpl();
7398
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7399
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7400
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7401
- }
7402
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7403
- }
7404
7358
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllStructuralFeatures);
7405
7359
  this._EClass_eAllSuperTypes = new EReferenceImpl();
7406
7360
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.ENamedElement.name, "eAllSuperTypes");
@@ -7418,60 +7372,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7418
7372
  this._EClass_eAllSuperTypes.setContainerClass(EClassImpl);
7419
7373
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7420
7374
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
7421
- {
7422
- const annotation = new EAnnotationImpl();
7423
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7424
- {
7425
- const entry = new EStringToStringMapEntryImpl();
7426
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7427
- entry.eBasicSetValue(
7428
- Ids.EStringToStringMapEntry.value,
7429
- "const superTypes = new Set<EClass>();\nconst visited = new Set<EClass>();\nconst visit = (eClass: EClass): void => {\n if (visited.has(eClass)) return;\n visited.add(eClass);\n for (const sup of eClass.getESuperTypes()) {\n visit(sup);\n superTypes.add(sup);\n }\n for (const generic of eClass.getEGenericSuperTypes()) {\n const raw = generic.getEClassifier();\n if (raw !== undefined && isEClass(raw)) {\n visit(raw);\n superTypes.add(raw);\n }\n }\n};\nvisit(this);\nreturn new BasicEList<EClass>(undefined, undefined, superTypes);"
7430
- );
7431
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7432
- }
7433
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7434
- }
7435
- {
7436
- const annotation = new EAnnotationImpl();
7437
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7438
- {
7439
- const entry = new EStringToStringMapEntryImpl();
7440
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7441
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7442
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7443
- }
7444
- {
7445
- const entry = new EStringToStringMapEntryImpl();
7446
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7447
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7448
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7449
- }
7450
- {
7451
- const entry = new EStringToStringMapEntryImpl();
7452
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7453
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7454
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7455
- }
7456
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7457
- }
7458
- {
7459
- const annotation = new EAnnotationImpl();
7460
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7461
- {
7462
- const entry = new EStringToStringMapEntryImpl();
7463
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7464
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7465
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7466
- }
7467
- {
7468
- const entry = new EStringToStringMapEntryImpl();
7469
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7470
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7471
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7472
- }
7473
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7474
- }
7475
7375
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllSuperTypes);
7476
7376
  this._EClass_eIDAttribute = new EReferenceImpl();
7477
7377
  this._EClass_eIDAttribute.eBasicSetValue(Ids.ENamedElement.name, "eIDAttribute");
@@ -7489,17 +7389,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7489
7389
  this._EClass_eIDAttribute.setContainerClass(EClassImpl);
7490
7390
  this._EClass_eIDAttribute.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7491
7391
  this._EClass_eIDAttribute.eBasicSetValue(Ids.EReference.containment, false);
7492
- {
7493
- const annotation = new EAnnotationImpl();
7494
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7495
- {
7496
- const entry = new EStringToStringMapEntryImpl();
7497
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7498
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllAttributes().find(a => a.isID());");
7499
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7500
- }
7501
- this._EClass_eIDAttribute.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7502
- }
7503
7392
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eIDAttribute);
7504
7393
  this._EClass_eStructuralFeatures = new EReferenceImpl();
7505
7394
  this._EClass_eStructuralFeatures.eBasicSetValue(Ids.ENamedElement.name, "eStructuralFeatures");
@@ -7534,23 +7423,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7534
7423
  this._EClass_eGenericSuperTypes.setContainerClass(EClassImpl);
7535
7424
  this._EClass_eGenericSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7536
7425
  this._EClass_eGenericSuperTypes.eBasicSetValue(Ids.EReference.containment, true);
7537
- {
7538
- const annotation = new EAnnotationImpl();
7539
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
7540
- {
7541
- const entry = new EStringToStringMapEntryImpl();
7542
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
7543
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7544
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7545
- }
7546
- {
7547
- const entry = new EStringToStringMapEntryImpl();
7548
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
7549
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7550
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7551
- }
7552
- this._EClass_eGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7553
- }
7554
7426
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eGenericSuperTypes);
7555
7427
  this._EClass_eAllGenericSuperTypes = new EReferenceImpl();
7556
7428
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.ENamedElement.name, "eAllGenericSuperTypes");
@@ -7568,83 +7440,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7568
7440
  this._EClass_eAllGenericSuperTypes.setContainerClass(EClassImpl);
7569
7441
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7570
7442
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
7571
- {
7572
- const annotation = new EAnnotationImpl();
7573
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7574
- {
7575
- const entry = new EStringToStringMapEntryImpl();
7576
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7577
- entry.eBasicSetValue(
7578
- Ids.EStringToStringMapEntry.value,
7579
- "const genericSuperTypes = new Set<EGenericType>();\nconst visited = new Set<EClass>();\nconst visit = (eClass: EClass): void => {\n if (visited.has(eClass)) return;\n visited.add(eClass);\n for (const sup of eClass.getESuperTypes()) {\n visit(sup);\n const implicit = new EGenericTypeImpl();\n implicit.setEClassifier(sup);\n genericSuperTypes.add(implicit);\n }\n for (const generic of eClass.getEGenericSuperTypes()) {\n const raw = generic.getEClassifier();\n if (raw !== undefined && isEClass(raw)) {\n visit(raw);\n genericSuperTypes.add(generic);\n }\n }\n};\nvisit(this);\nreturn new BasicEList<EGenericType>(undefined, undefined, genericSuperTypes);"
7580
- );
7581
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7582
- }
7583
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7584
- }
7585
- {
7586
- const annotation = new EAnnotationImpl();
7587
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7588
- {
7589
- const entry = new EStringToStringMapEntryImpl();
7590
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7591
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7592
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7593
- }
7594
- {
7595
- const entry = new EStringToStringMapEntryImpl();
7596
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7597
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7598
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7599
- }
7600
- {
7601
- const entry = new EStringToStringMapEntryImpl();
7602
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7603
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7604
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7605
- }
7606
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7607
- }
7608
- {
7609
- const annotation = new EAnnotationImpl();
7610
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7611
- {
7612
- const entry = new EStringToStringMapEntryImpl();
7613
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7614
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7615
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7616
- }
7617
- {
7618
- const entry = new EStringToStringMapEntryImpl();
7619
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7620
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7621
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7622
- }
7623
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7624
- }
7625
- {
7626
- const annotation = new EAnnotationImpl();
7627
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7628
- {
7629
- const entry = new EStringToStringMapEntryImpl();
7630
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7631
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EGenericTypeImpl");
7632
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7633
- }
7634
- {
7635
- const entry = new EStringToStringMapEntryImpl();
7636
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7637
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7638
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7639
- }
7640
- {
7641
- const entry = new EStringToStringMapEntryImpl();
7642
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7643
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EGenericTypeImpl.js");
7644
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7645
- }
7646
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7647
- }
7648
7443
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllGenericSuperTypes);
7649
7444
  this._EClassifier_instanceClassName = new EAttributeImpl();
7650
7445
  this._EClassifier_instanceClassName.eBasicSetValue(Ids.ENamedElement.name, "instanceClassName");
@@ -7661,23 +7456,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7661
7456
  this._EClassifier_instanceClassName.setFeatureID(Ids.EClassifier.instanceClassName);
7662
7457
  this._EClassifier_instanceClassName.setContainerClass(EClassifierImpl);
7663
7458
  this._EClassifier_instanceClassName.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClassifier);
7664
- {
7665
- const annotation = new EAnnotationImpl();
7666
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
7667
- {
7668
- const entry = new EStringToStringMapEntryImpl();
7669
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
7670
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7671
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7672
- }
7673
- {
7674
- const entry = new EStringToStringMapEntryImpl();
7675
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
7676
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7677
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7678
- }
7679
- this._EClassifier_instanceClassName.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7680
- }
7681
7459
  this._EClassifier.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClassifier_instanceClassName);
7682
7460
  this._EClassifier_instanceClass = new EAttributeImpl();
7683
7461
  this._EClassifier_instanceClass.eBasicSetValue(Ids.ENamedElement.name, "instanceClass");
@@ -7726,23 +7504,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7726
7504
  this._EClassifier_instanceTypeName.setFeatureID(Ids.EClassifier.instanceTypeName);
7727
7505
  this._EClassifier_instanceTypeName.setContainerClass(EClassifierImpl);
7728
7506
  this._EClassifier_instanceTypeName.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClassifier);
7729
- {
7730
- const annotation = new EAnnotationImpl();
7731
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
7732
- {
7733
- const entry = new EStringToStringMapEntryImpl();
7734
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
7735
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7736
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7737
- }
7738
- {
7739
- const entry = new EStringToStringMapEntryImpl();
7740
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
7741
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7742
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7743
- }
7744
- this._EClassifier_instanceTypeName.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7745
- }
7746
7507
  this._EClassifier.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClassifier_instanceTypeName);
7747
7508
  this._EClassifier_ePackage = new EReferenceImpl();
7748
7509
  this._EClassifier_ePackage.eBasicSetValue(Ids.ENamedElement.name, "ePackage");
@@ -7790,6 +7551,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7790
7551
  this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
7791
7552
  this._EDataType_serializable.eBasicSetValue(Ids.ETypedElement.ordered, true);
7792
7553
  this._EDataType_serializable.eBasicSetValue(Ids.ETypedElement.unique, true);
7554
+ this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
7793
7555
  this._EDataType_serializable.setFeatureID(Ids.EDataType.serializable);
7794
7556
  this._EDataType_serializable.setContainerClass(EDataTypeImpl);
7795
7557
  this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EDataType);
@@ -7858,26 +7620,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7858
7620
  this._EEnumLiteral_literal.setFeatureID(Ids.EEnumLiteral.literal);
7859
7621
  this._EEnumLiteral_literal.setContainerClass(EEnumLiteralImpl);
7860
7622
  this._EEnumLiteral_literal.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EEnumLiteral);
7861
- {
7862
- const annotation = new EAnnotationImpl();
7863
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7864
- {
7865
- const entry = new EStringToStringMapEntryImpl();
7866
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7867
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this._literal ?? this.getName();");
7868
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7869
- }
7870
- {
7871
- const entry = new EStringToStringMapEntryImpl();
7872
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
7873
- entry.eBasicSetValue(
7874
- Ids.EStringToStringMapEntry.value,
7875
- "const oldValue = this._literal;\nif (oldValue === value) return;\nconst wasSet = this._literal !== undefined;\nthis._literal = value;\nthis.eDidRemove(undefined, oldValue);\nthis.eDidAdd(undefined, value);\nconst feature = getEcorePackageRef().getEEnumLiteral_Literal();\nthis.eNotify({ eventType: 'SET', notifier: this, feature, oldValue, newValue: value, position: undefined, wasSet });"
7876
- );
7877
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7878
- }
7879
- this._EEnumLiteral_literal.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7880
- }
7881
7623
  this._EEnumLiteral.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EEnumLiteral_literal);
7882
7624
  this._EEnumLiteral_eEnum = new EReferenceImpl();
7883
7625
  this._EEnumLiteral_eEnum.eBasicSetValue(Ids.ENamedElement.name, "eEnum");
@@ -8013,23 +7755,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8013
7755
  this._EOperation_eExceptions.setContainerClass(EOperationImpl);
8014
7756
  this._EOperation_eExceptions.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EOperation);
8015
7757
  this._EOperation_eExceptions.eBasicSetValue(Ids.EReference.containment, false);
8016
- {
8017
- const annotation = new EAnnotationImpl();
8018
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8019
- {
8020
- const entry = new EStringToStringMapEntryImpl();
8021
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8022
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8023
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8024
- }
8025
- {
8026
- const entry = new EStringToStringMapEntryImpl();
8027
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8028
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8029
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8030
- }
8031
- this._EOperation_eExceptions.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8032
- }
8033
7758
  this._EOperation.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EOperation_eExceptions);
8034
7759
  this._EOperation_eGenericExceptions = new EReferenceImpl();
8035
7760
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.ENamedElement.name, "eGenericExceptions");
@@ -8047,23 +7772,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8047
7772
  this._EOperation_eGenericExceptions.setContainerClass(EOperationImpl);
8048
7773
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EOperation);
8049
7774
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.EReference.containment, true);
8050
- {
8051
- const annotation = new EAnnotationImpl();
8052
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8053
- {
8054
- const entry = new EStringToStringMapEntryImpl();
8055
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8056
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8057
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8058
- }
8059
- {
8060
- const entry = new EStringToStringMapEntryImpl();
8061
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8062
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8063
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8064
- }
8065
- this._EOperation_eGenericExceptions.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8066
- }
8067
7775
  this._EOperation.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EOperation_eGenericExceptions);
8068
7776
  this._EPackage_nsURI = new EAttributeImpl();
8069
7777
  this._EPackage_nsURI.eBasicSetValue(Ids.ENamedElement.name, "nsURI");
@@ -8226,6 +7934,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8226
7934
  this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8227
7935
  this._EReference_resolveProxies.eBasicSetValue(Ids.ETypedElement.ordered, true);
8228
7936
  this._EReference_resolveProxies.eBasicSetValue(Ids.ETypedElement.unique, true);
7937
+ this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8229
7938
  this._EReference_resolveProxies.setFeatureID(Ids.EReference.resolveProxies);
8230
7939
  this._EReference_resolveProxies.setContainerClass(EReferenceImpl);
8231
7940
  this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EReference);
@@ -8293,6 +8002,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8293
8002
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8294
8003
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.ETypedElement.ordered, true);
8295
8004
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.ETypedElement.unique, true);
8005
+ this._EStructuralFeature_changeable.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8296
8006
  this._EStructuralFeature_changeable.setFeatureID(Ids.EStructuralFeature.changeable);
8297
8007
  this._EStructuralFeature_changeable.setContainerClass(EStructuralFeatureImpl);
8298
8008
  this._EStructuralFeature_changeable.eBasicSetValue(
@@ -8440,6 +8150,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8440
8150
  this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8441
8151
  this._ETypedElement_ordered.eBasicSetValue(Ids.ETypedElement.ordered, true);
8442
8152
  this._ETypedElement_ordered.eBasicSetValue(Ids.ETypedElement.unique, true);
8153
+ this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8443
8154
  this._ETypedElement_ordered.setFeatureID(Ids.ETypedElement.ordered);
8444
8155
  this._ETypedElement_ordered.setContainerClass(ETypedElementImpl);
8445
8156
  this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8456,6 +8167,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8456
8167
  this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8457
8168
  this._ETypedElement_unique.eBasicSetValue(Ids.ETypedElement.ordered, true);
8458
8169
  this._ETypedElement_unique.eBasicSetValue(Ids.ETypedElement.unique, true);
8170
+ this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8459
8171
  this._ETypedElement_unique.setFeatureID(Ids.ETypedElement.unique);
8460
8172
  this._ETypedElement_unique.setContainerClass(ETypedElementImpl);
8461
8173
  this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8488,6 +8200,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8488
8200
  this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8489
8201
  this._ETypedElement_upperBound.eBasicSetValue(Ids.ETypedElement.ordered, true);
8490
8202
  this._ETypedElement_upperBound.eBasicSetValue(Ids.ETypedElement.unique, true);
8203
+ this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "1");
8491
8204
  this._ETypedElement_upperBound.setFeatureID(Ids.ETypedElement.upperBound);
8492
8205
  this._ETypedElement_upperBound.setContainerClass(ETypedElementImpl);
8493
8206
  this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8540,37 +8253,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8540
8253
  this._ETypedElement_eType.setContainerClass(ETypedElementImpl);
8541
8254
  this._ETypedElement_eType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
8542
8255
  this._ETypedElement_eType.eBasicSetValue(Ids.EReference.containment, false);
8543
- {
8544
- const annotation = new EAnnotationImpl();
8545
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8546
- {
8547
- const entry = new EStringToStringMapEntryImpl();
8548
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8549
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8550
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8551
- }
8552
- {
8553
- const entry = new EStringToStringMapEntryImpl();
8554
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8555
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8556
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8557
- }
8558
- this._ETypedElement_eType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8559
- }
8560
- {
8561
- const annotation = new EAnnotationImpl();
8562
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8563
- {
8564
- const entry = new EStringToStringMapEntryImpl();
8565
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
8566
- entry.eBasicSetValue(
8567
- Ids.EStringToStringMapEntry.value,
8568
- "const oldValue = this._eType;\nconst wasSet = this._eType !== undefined;\nthis._eType = value;\nthis._eGenericType = undefined;\nthis.eDidAdd(undefined, value);\nconst feature = getEcorePackageRef().getETypedElement_EType();\nthis.eNotify({ eventType: 'SET', notifier: this, feature, oldValue, newValue: value, position: undefined, wasSet });"
8569
- );
8570
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8571
- }
8572
- this._ETypedElement_eType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8573
- }
8574
8256
  this._ETypedElement.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._ETypedElement_eType);
8575
8257
  this._ETypedElement_eGenericType = new EReferenceImpl();
8576
8258
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.ENamedElement.name, "eGenericType");
@@ -8588,37 +8270,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8588
8270
  this._ETypedElement_eGenericType.setContainerClass(ETypedElementImpl);
8589
8271
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
8590
8272
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.EReference.containment, true);
8591
- {
8592
- const annotation = new EAnnotationImpl();
8593
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8594
- {
8595
- const entry = new EStringToStringMapEntryImpl();
8596
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8597
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8598
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8599
- }
8600
- {
8601
- const entry = new EStringToStringMapEntryImpl();
8602
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8603
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8604
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8605
- }
8606
- this._ETypedElement_eGenericType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8607
- }
8608
- {
8609
- const annotation = new EAnnotationImpl();
8610
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8611
- {
8612
- const entry = new EStringToStringMapEntryImpl();
8613
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
8614
- entry.eBasicSetValue(
8615
- Ids.EStringToStringMapEntry.value,
8616
- "const feature = getEcorePackageRef().getETypedElement_EGenericType();\nconst oldValue = this.eGet(feature);\nconst wasSet = this.eIsSet(feature);\nthis.eBasicSetValue(feature, value);\nthis.eDidRemove(feature, oldValue);\nthis.eDidAdd(feature, value);\nthis.eNotify({ eventType: 'SET', notifier: this, feature, oldValue, newValue: value, position: undefined, wasSet });\nconst oldEType = this._eType;\nconst eTypeWasSet = oldEType !== undefined;\nthis._eType = value?.getERawType();\nconst eTypeFeature = getEcorePackageRef().getETypedElement_EType();\nthis.eNotify({ eventType: 'SET', notifier: this, feature: eTypeFeature, oldValue: oldEType, newValue: this._eType, position: undefined, wasSet: eTypeWasSet });"
8617
- );
8618
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8619
- }
8620
- this._ETypedElement_eGenericType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8621
- }
8622
8273
  this._ETypedElement.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._ETypedElement_eGenericType);
8623
8274
  this._EStringToStringMapEntry_key = new EAttributeImpl();
8624
8275
  this._EStringToStringMapEntry_key.eBasicSetValue(Ids.ENamedElement.name, "key");
@@ -8708,20 +8359,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8708
8359
  this._EGenericType_eRawType.setContainerClass(EGenericTypeImpl);
8709
8360
  this._EGenericType_eRawType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EGenericType);
8710
8361
  this._EGenericType_eRawType.eBasicSetValue(Ids.EReference.containment, false);
8711
- {
8712
- const annotation = new EAnnotationImpl();
8713
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8714
- {
8715
- const entry = new EStringToStringMapEntryImpl();
8716
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
8717
- entry.eBasicSetValue(
8718
- Ids.EStringToStringMapEntry.value,
8719
- "if (this.getEClassifier() !== undefined) return this.getEClassifier();\nconst typeParameter = this.getETypeParameter();\nif (typeParameter !== undefined && !typeParameter.getEBounds().isEmpty()) {\n const bound = typeParameter.getEBounds().get(0);\n return bound.getERawType();\n}\nconst upperBound = this.getEUpperBound();\nif (upperBound !== undefined) return upperBound.getERawType();\nreturn getEcorePackageRef().getEJavaObject();"
8720
- );
8721
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8722
- }
8723
- this._EGenericType_eRawType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8724
- }
8725
8362
  this._EGenericType.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EGenericType_eRawType);
8726
8363
  this._EGenericType_eLowerBound = new EReferenceImpl();
8727
8364
  this._EGenericType_eLowerBound.eBasicSetValue(Ids.ENamedElement.name, "eLowerBound");
@@ -8803,54 +8440,12 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8803
8440
  this._EClass_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8804
8441
  this._EClass_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op0);
8805
8442
  this._EClass_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op0_p0);
8806
- {
8807
- const annotation = new EAnnotationImpl();
8808
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8809
- {
8810
- const entry = new EStringToStringMapEntryImpl();
8811
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8812
- entry.eBasicSetValue(
8813
- Ids.EStringToStringMapEntry.value,
8814
- "const visited = new Set<EClass>();\nconst pending: EClass[] = [someClass];\nwhile (pending.length > 0) {\n const current = pending.pop()!;\n if (current === this) return true;\n if (visited.has(current)) continue;\n visited.add(current);\n pending.push(...current.getESuperTypes());\n for (const generic of current.getEGenericSuperTypes()) {\n const raw = generic.getEClassifier();\n if (raw !== undefined && isEClass(raw)) pending.push(raw);\n }\n}\nreturn false;"
8815
- );
8816
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8817
- }
8818
- this._EClass_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8819
- }
8820
- {
8821
- const annotation = new EAnnotationImpl();
8822
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
8823
- {
8824
- const entry = new EStringToStringMapEntryImpl();
8825
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
8826
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
8827
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8828
- }
8829
- {
8830
- const entry = new EStringToStringMapEntryImpl();
8831
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
8832
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
8833
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8834
- }
8835
- this._EClass_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8836
- }
8837
8443
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op0);
8838
8444
  this._EClass_op1 = new EOperationImpl();
8839
8445
  this._EClass_op1.eBasicSetValue(Ids.ENamedElement.name, "getFeatureCount");
8840
8446
  this._EClass_op1.eBasicSetValue(Ids.ETypedElement.eType, this._EInt);
8841
8447
  this._EClass_op1.eBasicSetValue(Ids.EOperation.eContainingClass, this._EClass);
8842
8448
  this._EClass_op1.setOperationID(Ids.EClass.op1);
8843
- {
8844
- const annotation = new EAnnotationImpl();
8845
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8846
- {
8847
- const entry = new EStringToStringMapEntryImpl();
8848
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8849
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllStructuralFeatures().size();");
8850
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8851
- }
8852
- this._EClass_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8853
- }
8854
8449
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op1);
8855
8450
  this._EClass_op2 = new EOperationImpl();
8856
8451
  this._EClass_op2.eBasicSetValue(Ids.ENamedElement.name, "getEStructuralFeature");
@@ -8863,21 +8458,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8863
8458
  this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.lowerBound, 0);
8864
8459
  this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8865
8460
  this._EClass_op2_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op2);
8866
- this._EClass_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op2_p0);
8867
- {
8868
- const annotation = new EAnnotationImpl();
8869
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8870
- {
8871
- const entry = new EStringToStringMapEntryImpl();
8872
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8873
- entry.eBasicSetValue(
8874
- Ids.EStringToStringMapEntry.value,
8875
- "return this.getEAllStructuralFeatures().filter(feature => this.getFeatureID(feature) === featureIDOrFeatureName).at(0);"
8876
- );
8877
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8878
- }
8879
- this._EClass_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8880
- }
8461
+ this._EClass_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op2_p0);
8881
8462
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op2);
8882
8463
  this._EClass_op3 = new EOperationImpl();
8883
8464
  this._EClass_op3.eBasicSetValue(Ids.ENamedElement.name, "getFeatureID");
@@ -8891,43 +8472,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8891
8472
  this._EClass_op3_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8892
8473
  this._EClass_op3_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op3);
8893
8474
  this._EClass_op3.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op3_p0);
8894
- {
8895
- const annotation = new EAnnotationImpl();
8896
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8897
- {
8898
- const entry = new EStringToStringMapEntryImpl();
8899
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8900
- entry.eBasicSetValue(
8901
- Ids.EStringToStringMapEntry.value,
8902
- "return (feature as EStructuralFeatureImpl).getFeatureID();"
8903
- );
8904
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8905
- }
8906
- this._EClass_op3.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8907
- }
8908
- {
8909
- const annotation = new EAnnotationImpl();
8910
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
8911
- {
8912
- const entry = new EStringToStringMapEntryImpl();
8913
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
8914
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EStructuralFeatureImpl");
8915
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8916
- }
8917
- {
8918
- const entry = new EStringToStringMapEntryImpl();
8919
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
8920
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
8921
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8922
- }
8923
- {
8924
- const entry = new EStringToStringMapEntryImpl();
8925
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
8926
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EStructuralFeatureImpl");
8927
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8928
- }
8929
- this._EClass_op3.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8930
- }
8931
8475
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op3);
8932
8476
  this._EClass_op4 = new EOperationImpl();
8933
8477
  this._EClass_op4.eBasicSetValue(Ids.ENamedElement.name, "getEStructuralFeature");
@@ -8941,37 +8485,12 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8941
8485
  this._EClass_op4_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8942
8486
  this._EClass_op4_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op4);
8943
8487
  this._EClass_op4.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op4_p0);
8944
- {
8945
- const annotation = new EAnnotationImpl();
8946
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8947
- {
8948
- const entry = new EStringToStringMapEntryImpl();
8949
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8950
- entry.eBasicSetValue(
8951
- Ids.EStringToStringMapEntry.value,
8952
- "return this.getEAllStructuralFeatures().filter(feature => feature.getName() === featureIDOrFeatureName).at(0);"
8953
- );
8954
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8955
- }
8956
- this._EClass_op4.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8957
- }
8958
8488
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op4);
8959
8489
  this._EClass_op5 = new EOperationImpl();
8960
8490
  this._EClass_op5.eBasicSetValue(Ids.ENamedElement.name, "getOperationCount");
8961
8491
  this._EClass_op5.eBasicSetValue(Ids.ETypedElement.eType, this._EInt);
8962
8492
  this._EClass_op5.eBasicSetValue(Ids.EOperation.eContainingClass, this._EClass);
8963
8493
  this._EClass_op5.setOperationID(Ids.EClass.op5);
8964
- {
8965
- const annotation = new EAnnotationImpl();
8966
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8967
- {
8968
- const entry = new EStringToStringMapEntryImpl();
8969
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8970
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllOperations().size();");
8971
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8972
- }
8973
- this._EClass_op5.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8974
- }
8975
8494
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op5);
8976
8495
  this._EClass_op6 = new EOperationImpl();
8977
8496
  this._EClass_op6.eBasicSetValue(Ids.ENamedElement.name, "getEOperation");
@@ -8985,20 +8504,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8985
8504
  this._EClass_op6_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8986
8505
  this._EClass_op6_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op6);
8987
8506
  this._EClass_op6.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op6_p0);
8988
- {
8989
- const annotation = new EAnnotationImpl();
8990
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
8991
- {
8992
- const entry = new EStringToStringMapEntryImpl();
8993
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
8994
- entry.eBasicSetValue(
8995
- Ids.EStringToStringMapEntry.value,
8996
- "return this.getEAllOperations().filter(op => this.getOperationID(op) === operationID).at(0);"
8997
- );
8998
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8999
- }
9000
- this._EClass_op6.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9001
- }
9002
8507
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op6);
9003
8508
  this._EClass_op7 = new EOperationImpl();
9004
8509
  this._EClass_op7.eBasicSetValue(Ids.ENamedElement.name, "getOperationID");
@@ -9012,43 +8517,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9012
8517
  this._EClass_op7_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9013
8518
  this._EClass_op7_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op7);
9014
8519
  this._EClass_op7.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op7_p0);
9015
- {
9016
- const annotation = new EAnnotationImpl();
9017
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9018
- {
9019
- const entry = new EStringToStringMapEntryImpl();
9020
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9021
- entry.eBasicSetValue(
9022
- Ids.EStringToStringMapEntry.value,
9023
- "return (operation as EOperationImpl).getOperationID();"
9024
- );
9025
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9026
- }
9027
- this._EClass_op7.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9028
- }
9029
- {
9030
- const annotation = new EAnnotationImpl();
9031
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9032
- {
9033
- const entry = new EStringToStringMapEntryImpl();
9034
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9035
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EOperationImpl");
9036
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9037
- }
9038
- {
9039
- const entry = new EStringToStringMapEntryImpl();
9040
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9041
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9042
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9043
- }
9044
- {
9045
- const entry = new EStringToStringMapEntryImpl();
9046
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9047
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EOperationImpl");
9048
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9049
- }
9050
- this._EClass_op7.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9051
- }
9052
8520
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op7);
9053
8521
  this._EClass_op8 = new EOperationImpl();
9054
8522
  this._EClass_op8.eBasicSetValue(Ids.ENamedElement.name, "getOverride");
@@ -9062,20 +8530,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9062
8530
  this._EClass_op8_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9063
8531
  this._EClass_op8_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op8);
9064
8532
  this._EClass_op8.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op8_p0);
9065
- {
9066
- const annotation = new EAnnotationImpl();
9067
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9068
- {
9069
- const entry = new EStringToStringMapEntryImpl();
9070
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9071
- entry.eBasicSetValue(
9072
- Ids.EStringToStringMapEntry.value,
9073
- "if (operation.getEContainingClass() === this) return undefined;\nfor (const candidate of this.getEAllOperations()) {\n if (candidate.isOverrideOf(operation)) return candidate;\n}\nreturn undefined;"
9074
- );
9075
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9076
- }
9077
- this._EClass_op8.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9078
- }
9079
8533
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op8);
9080
8534
  this._EClassifier_op0 = new EOperationImpl();
9081
8535
  this._EClassifier_op0.eBasicSetValue(Ids.ENamedElement.name, "isInstance");
@@ -9089,46 +8543,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9089
8543
  this._EClassifier_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9090
8544
  this._EClassifier_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClassifier_op0);
9091
8545
  this._EClassifier_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EClassifier_op0_p0);
9092
- {
9093
- const annotation = new EAnnotationImpl();
9094
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9095
- {
9096
- const entry = new EStringToStringMapEntryImpl();
9097
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9098
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return object instanceof EObjectImpl;");
9099
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9100
- }
9101
- {
9102
- const entry = new EStringToStringMapEntryImpl();
9103
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "use-type-name");
9104
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EObjectImpl");
9105
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9106
- }
9107
- this._EClassifier_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9108
- }
9109
- {
9110
- const annotation = new EAnnotationImpl();
9111
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9112
- {
9113
- const entry = new EStringToStringMapEntryImpl();
9114
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9115
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EObjectImpl");
9116
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9117
- }
9118
- {
9119
- const entry = new EStringToStringMapEntryImpl();
9120
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9121
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9122
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9123
- }
9124
- {
9125
- const entry = new EStringToStringMapEntryImpl();
9126
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9127
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EObjectImpl");
9128
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9129
- }
9130
- this._EClassifier_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9131
- }
9132
8546
  this._EClassifier.eBootstrapList(Ids.EClass.eOperations).add(this._EClassifier_op0);
9133
8547
  this._EClassifier_op1 = new EOperationImpl();
9134
8548
  this._EClassifier_op1.eBasicSetValue(Ids.ENamedElement.name, "getClassifierID");
@@ -9148,20 +8562,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9148
8562
  this._EEnum_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9149
8563
  this._EEnum_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op0);
9150
8564
  this._EEnum_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op0_p0);
9151
- {
9152
- const annotation = new EAnnotationImpl();
9153
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9154
- {
9155
- const entry = new EStringToStringMapEntryImpl();
9156
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9157
- entry.eBasicSetValue(
9158
- Ids.EStringToStringMapEntry.value,
9159
- "return this.getELiterals().find(literal => literal.getName() === name);"
9160
- );
9161
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9162
- }
9163
- this._EEnum_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9164
- }
9165
8565
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op0);
9166
8566
  this._EEnum_op1 = new EOperationImpl();
9167
8567
  this._EEnum_op1.eBasicSetValue(Ids.ENamedElement.name, "getEEnumLiteral");
@@ -9175,20 +8575,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9175
8575
  this._EEnum_op1_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9176
8576
  this._EEnum_op1_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op1);
9177
8577
  this._EEnum_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op1_p0);
9178
- {
9179
- const annotation = new EAnnotationImpl();
9180
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9181
- {
9182
- const entry = new EStringToStringMapEntryImpl();
9183
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9184
- entry.eBasicSetValue(
9185
- Ids.EStringToStringMapEntry.value,
9186
- "return this.getELiterals().find(literal => literal.getValue() === value);"
9187
- );
9188
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9189
- }
9190
- this._EEnum_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9191
- }
9192
8578
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op1);
9193
8579
  this._EEnum_op2 = new EOperationImpl();
9194
8580
  this._EEnum_op2.eBasicSetValue(Ids.ENamedElement.name, "getEEnumLiteralByLiteral");
@@ -9202,20 +8588,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9202
8588
  this._EEnum_op2_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9203
8589
  this._EEnum_op2_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op2);
9204
8590
  this._EEnum_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op2_p0);
9205
- {
9206
- const annotation = new EAnnotationImpl();
9207
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9208
- {
9209
- const entry = new EStringToStringMapEntryImpl();
9210
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9211
- entry.eBasicSetValue(
9212
- Ids.EStringToStringMapEntry.value,
9213
- "return this.getELiterals().find(candidate => candidate.getLiteral() === literal);"
9214
- );
9215
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9216
- }
9217
- this._EEnum_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9218
- }
9219
8591
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op2);
9220
8592
  this._EFactory_op0 = new EOperationImpl();
9221
8593
  this._EFactory_op0.eBasicSetValue(Ids.ENamedElement.name, "create");
@@ -9228,43 +8600,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9228
8600
  this._EFactory_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9229
8601
  this._EFactory_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op0);
9230
8602
  this._EFactory_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op0_p0);
9231
- {
9232
- const annotation = new EAnnotationImpl();
9233
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9234
- {
9235
- const entry = new EStringToStringMapEntryImpl();
9236
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9237
- entry.eBasicSetValue(
9238
- Ids.EStringToStringMapEntry.value,
9239
- "if (eClass.isAbstract() || eClass.isInterface()) {\n throw new Error(`Cannot create an instance of '${eClass.getName()}': it is abstract or an interface.`);\n}\nconsole.warn(\n `No factory recognizes classifier id ${eClass.getClassifierID()} (${eClass.getName()}) - falling back to a DynamicEObjectImpl. ` +\n 'Add a concrete factory for it to avoid this.'\n);\nreturn new DynamicEObjectImpl(eClass);"
9240
- );
9241
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9242
- }
9243
- this._EFactory_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9244
- }
9245
- {
9246
- const annotation = new EAnnotationImpl();
9247
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9248
- {
9249
- const entry = new EStringToStringMapEntryImpl();
9250
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9251
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "DynamicEObjectImpl");
9252
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9253
- }
9254
- {
9255
- const entry = new EStringToStringMapEntryImpl();
9256
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9257
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9258
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9259
- }
9260
- {
9261
- const entry = new EStringToStringMapEntryImpl();
9262
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9263
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/DynamicEObjectImpl.js");
9264
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9265
- }
9266
- this._EFactory_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9267
- }
9268
8603
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op0);
9269
8604
  this._EFactory_op1 = new EOperationImpl();
9270
8605
  this._EFactory_op1.eBasicSetValue(Ids.ENamedElement.name, "createFromString");
@@ -9285,20 +8620,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9285
8620
  this._EFactory_op1_p1.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9286
8621
  this._EFactory_op1_p1.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op1);
9287
8622
  this._EFactory_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op1_p1);
9288
- {
9289
- const annotation = new EAnnotationImpl();
9290
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9291
- {
9292
- const entry = new EStringToStringMapEntryImpl();
9293
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9294
- entry.eBasicSetValue(
9295
- Ids.EStringToStringMapEntry.value,
9296
- "if (this.getEPackage() !== undefined && eDataType.getEPackage() !== this.getEPackage()) {\n throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);\n}\nswitch (eDataType.getName()) {\n case 'EString':\n return literalValue;\n case 'EInt':\n case 'EIntegerObject':\n case 'ELong':\n case 'ELongObject':\n case 'EDouble':\n case 'EDoubleObject':\n case 'EFloat':\n case 'EFloatObject':\n case 'EShort':\n case 'EShortObject':\n case 'EByte':\n case 'EByteObject':\n return Number(literalValue);\n case 'EBigInteger':\n return BigInt(literalValue);\n case 'EBoolean':\n case 'EBooleanObject':\n return literalValue === 'true';\n case 'EChar':\n case 'ECharacterObject':\n return literalValue.charAt(0);\n case 'EDate':\n return new Date(literalValue);\n default:\n return literalValue;\n}"
9297
- );
9298
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9299
- }
9300
- this._EFactory_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9301
- }
9302
8623
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op1);
9303
8624
  this._EFactory_op2 = new EOperationImpl();
9304
8625
  this._EFactory_op2.eBasicSetValue(Ids.ENamedElement.name, "convertToString");
@@ -9319,20 +8640,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9319
8640
  this._EFactory_op2_p1.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9320
8641
  this._EFactory_op2_p1.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op2);
9321
8642
  this._EFactory_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op2_p1);
9322
- {
9323
- const annotation = new EAnnotationImpl();
9324
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9325
- {
9326
- const entry = new EStringToStringMapEntryImpl();
9327
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9328
- entry.eBasicSetValue(
9329
- Ids.EStringToStringMapEntry.value,
9330
- "if (this.getEPackage() !== undefined && eDataType.getEPackage() !== this.getEPackage()) {\n throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);\n}\nif (eDataType.getName() === 'EDate' && instanceValue instanceof Date) {\n return instanceValue.toISOString();\n}\nreturn String(instanceValue);"
9331
- );
9332
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9333
- }
9334
- this._EFactory_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9335
- }
9336
8643
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op2);
9337
8644
  this._EModelElement_op0 = new EOperationImpl();
9338
8645
  this._EModelElement_op0.eBasicSetValue(Ids.ENamedElement.name, "getEAnnotation");
@@ -9346,20 +8653,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9346
8653
  this._EModelElement_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9347
8654
  this._EModelElement_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EModelElement_op0);
9348
8655
  this._EModelElement_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EModelElement_op0_p0);
9349
- {
9350
- const annotation = new EAnnotationImpl();
9351
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9352
- {
9353
- const entry = new EStringToStringMapEntryImpl();
9354
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9355
- entry.eBasicSetValue(
9356
- Ids.EStringToStringMapEntry.value,
9357
- "return this.getEAnnotations().filter(ann => ann.getSource() === source).at(0);"
9358
- );
9359
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9360
- }
9361
- this._EModelElement_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9362
- }
9363
8656
  this._EModelElement.eBootstrapList(Ids.EClass.eOperations).add(this._EModelElement_op0);
9364
8657
  this._EOperation_op0 = new EOperationImpl();
9365
8658
  this._EOperation_op0.eBasicSetValue(Ids.ENamedElement.name, "getOperationID");
@@ -9379,20 +8672,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9379
8672
  this._EOperation_op1_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9380
8673
  this._EOperation_op1_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EOperation_op1);
9381
8674
  this._EOperation_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EOperation_op1_p0);
9382
- {
9383
- const annotation = new EAnnotationImpl();
9384
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9385
- {
9386
- const entry = new EStringToStringMapEntryImpl();
9387
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9388
- entry.eBasicSetValue(
9389
- Ids.EStringToStringMapEntry.value,
9390
- "if (someOperation === this) return false;\nconst thisClass = this.getEContainingClass();\nconst otherClass = someOperation.getEContainingClass();\nif (thisClass === undefined || otherClass === undefined) return false;\nif (thisClass === otherClass) return false;\nif (!otherClass.isSuperTypeOf(thisClass)) return false;\nif (this.getName() !== someOperation.getName()) return false;\nconst params = this.getEParameters();\nconst otherParams = someOperation.getEParameters();\nif (params.size() !== otherParams.size()) return false;\nfor (let i = 0; i < params.size(); i++) {\n if (params.get(i)!.getEType() !== otherParams.get(i)!.getEType()) return false;\n}\nreturn true;"
9391
- );
9392
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9393
- }
9394
- this._EOperation_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9395
- }
9396
8675
  this._EOperation.eBootstrapList(Ids.EClass.eOperations).add(this._EOperation_op1);
9397
8676
  this._EPackage_op0 = new EOperationImpl();
9398
8677
  this._EPackage_op0.eBasicSetValue(Ids.ENamedElement.name, "getEClassifier");
@@ -9406,20 +8685,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9406
8685
  this._EPackage_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9407
8686
  this._EPackage_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EPackage_op0);
9408
8687
  this._EPackage_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EPackage_op0_p0);
9409
- {
9410
- const annotation = new EAnnotationImpl();
9411
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9412
- {
9413
- const entry = new EStringToStringMapEntryImpl();
9414
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9415
- entry.eBasicSetValue(
9416
- Ids.EStringToStringMapEntry.value,
9417
- "return this.getEClassifiers().filter(cl => cl.getName() === name).at(0);"
9418
- );
9419
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9420
- }
9421
- this._EPackage_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9422
- }
9423
8688
  this._EPackage.eBootstrapList(Ids.EClass.eOperations).add(this._EPackage_op0);
9424
8689
  this._EStructuralFeature_op0 = new EOperationImpl();
9425
8690
  this._EStructuralFeature_op0.eBasicSetValue(Ids.ENamedElement.name, "getFeatureID");
@@ -9929,6 +9194,9 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9929
9194
  return this._EInvocationTargetException;
9930
9195
  }
9931
9196
  };
9197
+ registerEcorePackageInitializer(() => {
9198
+ void EcorePackageImpl.eINSTANCE;
9199
+ });
9932
9200
  // Annotate the CommonJS export names for ESM import in node:
9933
9201
  0 && (module.exports = {
9934
9202
  BasicEList,
@@ -9962,9 +9230,12 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9962
9230
  ResourceImpl,
9963
9231
  ResourceSetImpl,
9964
9232
  URI,
9233
+ UnmodifiableEList,
9965
9234
  UriConverterRegistryImpl,
9966
9235
  associateRoot,
9967
9236
  computeFragment,
9237
+ convertToString,
9238
+ createFromString,
9968
9239
  createInstanceOf,
9969
9240
  createProxy,
9970
9241
  detailValue,