@typemf/core 0.7.0 → 0.8.1

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,
@@ -176,27 +179,19 @@ var BasicEList = class {
176
179
  [Symbol.iterator]() {
177
180
  return this.items[Symbol.iterator]();
178
181
  }
179
- /**
180
- * Internal - adds without containment/opposite side effects. Used by
181
- * EObjectImpl when this list is the *other* end of a change whose
182
- * bookkeeping is already being handled.
183
- */
182
+ /** @internal Adds without containment, opposite or notification side effects. */
184
183
  basicAdd(item) {
185
184
  if (this.rejectsDuplicate(item)) return;
186
185
  this.items.push(item);
187
186
  }
188
- /** Internal - removes without containment/opposite side effects. */
187
+ /** @internal Removes without containment, opposite or notification side effects. */
189
188
  basicRemove(item) {
190
189
  const index = this.items.indexOf(item);
191
190
  if (index === -1) return false;
192
191
  this.items.splice(index, 1);
193
192
  return true;
194
193
  }
195
- /**
196
- * Reference lists are always unique (as in EMF): re-adding a member is a
197
- * no-op rather than a duplicate entry, which is also what keeps
198
- * inverse-add from double-inserting.
199
- */
194
+ /** Reference lists are unique, as in EMF: adding an element already present does nothing. */
200
195
  rejectsDuplicate(item) {
201
196
  return !!this.feature && isReference(this.feature) && this.items.includes(item);
202
197
  }
@@ -231,10 +226,7 @@ var BasicEList = class {
231
226
  }
232
227
  }
233
228
  /**
234
- * CORE-12: the element stays in the list throughout - no containment/opposite change, so
235
- * unlike onAdded/onRemoved there's no eDidAdd/eDidRemove to call, only the notification
236
- * (real EMF's own MOVE: oldValue is the OLD position, newValue is the moved element, position
237
- * is the NEW position).
229
+ * Notifies a `MOVE`; the element stays in the list, so containers and opposites are unchanged.
238
230
  */
239
231
  onMoved(item, fromIndex, toIndex) {
240
232
  if (!this.owner || !this.feature) return;
@@ -253,6 +245,63 @@ function isReference(feature) {
253
245
  return "isContainment" in feature;
254
246
  }
255
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
+
256
305
  // src/metamodel/impl/EObjectImpl.ts
257
306
  var fallbackIdCounter = 0;
258
307
  function findRoot(obj) {
@@ -269,28 +318,11 @@ var EObjectImpl = class _EObjectImpl {
269
318
  _eContainingFeature;
270
319
  _eProxy = false;
271
320
  frozen = false;
272
- /** Only ever set on a root (see eSetDirectResource) - a non-root's eResource() is found by
273
- * walking up to its root via eContainer() instead, exactly like real EMF's own
274
- * eDirectResource field. */
321
+ /** Set only on a root of a resource's contents; other objects find their resource via their root. */
275
322
  _eDirectResource;
276
323
  /**
277
- * Marks this object (and, recursively, everything it contains) as no longer intended to be
278
- * mutated. Matches real EMF's own design precisely: a queryable flag, not enforced in every
279
- * setter. Real EMF's own enforcement is a single `assert !isFrozen()` in one place
280
- * (eSetDirectResource) - a mechanism that is itself frequently inactive in production Java
281
- * (assertions are off by default unless -ea is passed). Given that, invasively guarding every
282
- * setter here would be enforcing something more strictly than the system being ported actually
283
- * does.
284
- *
285
- * Lives here, on EObjectImpl - the one foundational file the self-hosted swap never overwrites
286
- * - rather than as per-class overrides on EClassImpl/EEnumImpl/EPackageImpl the way hand-written
287
- * core originally had it (those files are generated now). The cascade itself is generic and
288
- * reflective (every containment reference this object's own metaclass declares, via
289
- * getEAllContainments()), not a hardcoded list of "this class's own children" per subclass -
290
- * genuinely more complete than the old per-class version (which only ever froze the specific
291
- * containment features each override happened to name, missing e.g. eAnnotations), and cascades
292
- * transitively for free (a contained child's own freeze() call reaches its own children in
293
- * 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.
294
326
  */
295
327
  freeze() {
296
328
  for (const feature of this.eClass().getEAllContainments()) {
@@ -306,18 +338,13 @@ var EObjectImpl = class _EObjectImpl {
306
338
  isFrozen() {
307
339
  return this.frozen;
308
340
  }
309
- /** Freezes `child` if it is itself an EObjectImpl - real EMF's own conditional cascade helper. */
310
341
  freezeChild(child) {
311
342
  if (child instanceof _EObjectImpl) child.freeze();
312
343
  }
313
344
  /**
314
- * EMF rejects a feature that doesn't belong to this object's own class outright, rather than
315
- * dispatching on `feature.getFeatureID()` alone - two unrelated classes' features can share the
316
- * same id (each is only unique within its own declaring class, or - for a dynamic class with
317
- * multiple supertypes, see CORE-05 - within `getEAllStructuralFeatures()`'s own position-based
318
- * scheme), so reading or writing by id alone silently hits the wrong field when a caller passes
319
- * a feature from some other EClass entirely. Every generated eGet/eSet/eIsSet/eUnset
320
- * (eclass.njk) and DynamicEObjectImpl call this first, before dispatching on the id.
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.
321
348
  */
322
349
  requireOwnFeature(feature) {
323
350
  if (!this.eClass().getEAllStructuralFeatures().contains(feature)) {
@@ -343,15 +370,9 @@ var EObjectImpl = class _EObjectImpl {
343
370
  this.deliverFlag = deliver;
344
371
  }
345
372
  /**
346
- * Internal - fires `notification` to every listener whose own `feature` (if any) matches this
347
- * one, unless eSetDeliver(false) is currently suppressing delivery. Called directly from the
348
- * actual mutation call sites (the eSet default dance, BasicEList.onAdded/onRemoved, eUnset,
349
- * and any feature's own custom setter body) - deliberately NOT derived from eDidAdd/eDidRemove,
350
- * since a single logical change (one eSet call) fires those twice (a remove of the old value,
351
- * an add of the new one), which would produce two notifications instead of the one real EMF (and
352
- * this project's own settled design) expects for a SET. eDidAdd/eDidRemove keep their existing,
353
- * unchanged responsibility (the counter bump and containment/opposite wiring); this is a
354
- * 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.
355
376
  */
356
377
  eNotify(notification) {
357
378
  if (!this.deliverFlag || this.listeners.length === 0) return;
@@ -369,64 +390,32 @@ var EObjectImpl = class _EObjectImpl {
369
390
  eResource() {
370
391
  return findRoot(this)._eDirectResource;
371
392
  }
372
- /**
373
- * Internal - not part of the public EObject API, same as eBasicSetContainer/eSetProxy. Called
374
- * by Resource's own contents list (resource/resource-impl.ts) as an object enters/leaves
375
- * getContents() - the only time an object's OWN eResource() is ever set directly; every other
376
- * object's eResource() is found by walking up to its root instead (see eResource() above).
377
- * Resetting a former root's own direct resource when it becomes contained elsewhere, or leaves
378
- * a resource's contents, is resource-impl.ts's responsibility, not this method's.
379
- */
393
+ /** @internal Records the resource of a root; called by a resource's contents list. */
380
394
  eSetDirectResource(resource) {
381
395
  this._eDirectResource = resource;
382
396
  }
383
- /**
384
- * Internal - called by BasicEList (for many-valued containment features)
385
- * and by single-valued containment setters to update the backpointer.
386
- * Not part of the public EObject API.
387
- */
397
+ /** @internal Sets the container back-pointer, without touching the container's feature. */
388
398
  eBasicSetContainer(container, feature) {
389
399
  this._eContainer = container;
390
400
  this._eContainingFeature = feature;
391
401
  }
392
402
  /**
393
- * Internal - side effects of `value` having just been stored into
394
- * `this.feature` (the store itself has already happened): take ownership
395
- * if `feature` is a containment, and update the opposite end if it has
396
- * one. Called by BasicEList and by single-valued setters.
397
- */
398
- /**
399
- * A single, global counter bumped on every eDidAdd/eDidRemove ANYWHERE in
400
- * the loaded model - i.e. every feature mutation, of any kind (reference
401
- * or attribute, many- or single-valued), on any object, not only the
402
- * metamodel-structural features (eStructuralFeatures/eOperations/
403
- * eSuperTypes/eGenericSuperTypes) a first version of this scoped the
404
- * bump to. That narrower scope was WRONG, found by a real, failing test:
405
- * a custom `get` body is free to read ANY feature (a feature computed
406
- * from another ordinary attribute, say - not only structural
407
- * relationships), so a change to that OTHER feature must ALSO invalidate
408
- * the cache, and a name-based allowlist can never anticipate every such
409
- * dependency a body might have. Bumping on every mutation is the only
410
- * scope that's correct for an arbitrary `get` body, not just the
411
- * specific eAll*-style ones that motivated this - see eclass.njk's
412
- * getter-caching shape, which stores the generation a cache was computed
413
- * at and recomputes once the current one has moved past it.
414
- *
415
- * Deliberately GLOBAL, not scoped to the specific object that changed:
416
- * pinpointing exactly which caches an edit could affect would need
417
- * either tracking each cache's real dependencies (not attempted) or a
418
- * reverse (subtypes) graph for the structural case specifically (this
419
- * project has neither). Bumping globally invalidates more than strictly
420
- * necessary on every edit, but never leaves anything stale - correct,
421
- * simple, and still a good fit for the motivating usage pattern: model
422
- * edits cluster at construction/load time, reads cluster at
423
- * serialization time, and the two rarely interleave, so in practice
424
- * 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.
425
408
  */
426
409
  static modelGeneration = 0;
410
+ /** The current model generation (see `modelGeneration`); read by generated caching code. */
427
411
  static getModelGeneration() {
428
412
  return _EObjectImpl.modelGeneration;
429
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
+ */
430
419
  eDidAdd(feature, value) {
431
420
  _EObjectImpl.modelGeneration++;
432
421
  if (!feature || !isReference2(feature) || !(value instanceof _EObjectImpl)) return;
@@ -435,9 +424,8 @@ var EObjectImpl = class _EObjectImpl {
435
424
  if (opposite) value.eInverseAdd(this, opposite);
436
425
  }
437
426
  /**
438
- * Internal - side effects of `value` having just been removed from
439
- * `this.feature` (the store itself has already happened): release
440
- * 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.
441
429
  */
442
430
  eDidRemove(feature, value) {
443
431
  _EObjectImpl.modelGeneration++;
@@ -447,10 +435,9 @@ var EObjectImpl = class _EObjectImpl {
447
435
  if (opposite) value.eInverseRemove(this, opposite);
448
436
  }
449
437
  /**
450
- * Internal - `otherEnd` just started referencing `this` through
451
- * `feature.getEOpposite()`; make `this.feature` point back at `otherEnd`.
452
- * For a single-valued `feature` this displaces the previous value, whose
453
- * 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.
454
441
  */
455
442
  eInverseAdd(otherEnd, feature) {
456
443
  if (feature.isMany()) {
@@ -487,18 +474,16 @@ var EObjectImpl = class _EObjectImpl {
487
474
  if (feature.isContainment()) otherEnd.eBasicMoveInto(this, feature);
488
475
  }
489
476
  /**
490
- * Internal - `otherEnd` just stopped referencing `this` through
491
- * `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`.
492
479
  */
493
480
  eInverseRemove(otherEnd, feature) {
494
481
  this.eBasicRemoveValue(feature, otherEnd);
495
482
  if (feature.isContainment()) otherEnd.eBasicReleaseFrom(this, feature);
496
483
  }
497
484
  /**
498
- * Makes `container.feature` the sole owner of `this`. If `this` was
499
- * contained elsewhere, it is removed from the old containing feature
500
- * (and that feature's opposite on `this` is cleared) first, so an object
501
- * 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.
502
487
  */
503
488
  eBasicMoveInto(container, feature) {
504
489
  const oldContainer = this._eContainer;
@@ -517,12 +502,8 @@ var EObjectImpl = class _EObjectImpl {
517
502
  }
518
503
  }
519
504
  /**
520
- * Internal - detaches `this` from whatever containment feature currently holds it (clearing the
521
- * old container's own feature value and opposite, same cleanup eBasicMoveInto does for a move
522
- * into a new container), without moving it anywhere new. Not part of the public EObject API;
523
- * used by Resource's own contents list (resource/resource-impl.ts) when an already-contained
524
- * object becomes a document root instead - EMF semantics: adding moves the object, it never
525
- * belongs to a container and a resource's roots at the same time.
505
+ * @internal Removes this object from its container without adding it anywhere; used when it
506
+ * becomes a root of a resource.
526
507
  */
527
508
  eBasicDetachFromContainer() {
528
509
  const oldContainer = this._eContainer;
@@ -535,13 +516,8 @@ var EObjectImpl = class _EObjectImpl {
535
516
  this.eBasicSetContainer(void 0, void 0);
536
517
  }
537
518
  /**
538
- * CORE-09: every caller of this (eInverseRemove's own "opposite stopped referencing me", and
539
- * eBasicMoveInto/eBasicDetachFromContainer clearing an old container or its opposite) silently
540
- * mutated storage with no notification - the affected object's own listeners (and the instance
541
- * editor's webview relay) never found out, even though a real change happened. Fires the same
542
- * REMOVE/SET a plain eSet()/BasicEList.remove() would have, for whichever of those the normal
543
- * path this bypasses (deliberately, to avoid re-triggering containment/opposite bookkeeping
544
- * recursively) would otherwise have fired.
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.
545
521
  */
546
522
  eBasicRemoveValue(feature, value) {
547
523
  if (feature.isMany()) {
@@ -580,19 +556,17 @@ var EObjectImpl = class _EObjectImpl {
580
556
  return list;
581
557
  }
582
558
  eContents() {
583
- const result = new BasicEList();
559
+ const result = [];
584
560
  for (const feature of this.eClass().getEAllStructuralFeatures()) {
585
561
  if (!isContainmentReference(feature)) continue;
586
562
  const value = this.eGet(feature);
587
563
  if (feature.isMany()) {
588
- if (isEListOfEObject(value)) {
589
- for (const child of value) result.add(child);
590
- }
564
+ if (isEListOfEObject(value)) result.push(...value);
591
565
  } else if (isEObject(value)) {
592
- result.add(value);
566
+ result.push(value);
593
567
  }
594
568
  }
595
- return result;
569
+ return new UnmodifiableEList(result);
596
570
  }
597
571
  eAllContents() {
598
572
  const result = [];
@@ -605,13 +579,7 @@ var EObjectImpl = class _EObjectImpl {
605
579
  eIsProxy() {
606
580
  return this._eProxy;
607
581
  }
608
- /**
609
- * Internal - flips the proxy flag. Not part of the public EObject interface, same as
610
- * eBasicSetContainer/eBasicSetValue; only `resource/proxy.ts`'s createProxy() calls this, right
611
- * after constructing a real instance of the target EClass through its own factory - a proxy is
612
- * not a separate class, just an ordinary, freshly-constructed instance flagged as a stand-in
613
- * until something resolves it.
614
- */
582
+ /** @internal Marks this object as a proxy; called by `createProxy()`. */
615
583
  eSetProxy(flag) {
616
584
  this._eProxy = flag;
617
585
  }
@@ -750,6 +718,7 @@ var EStringToStringMapEntryImpl = class extends EObjectImpl {
750
718
  throw new Error(`Feature ${String(featureId)} on EStringToStringMapEntry is many-valued or unknown.`);
751
719
  }
752
720
  }
721
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
753
722
  eBootstrapList(featureId) {
754
723
  switch (featureId) {
755
724
  default:
@@ -814,7 +783,7 @@ function createInstanceOf(eClass) {
814
783
  const factory = pkg?.getEFactoryInstance();
815
784
  if (!factory) {
816
785
  throw new Error(
817
- `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()).`
818
787
  );
819
788
  }
820
789
  return factory.create(eClass);
@@ -833,6 +802,15 @@ function setDetailValue(details, key, value) {
833
802
  entry.setValue(value);
834
803
  details.add(entry);
835
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
+ }
836
814
 
837
815
  // src/metamodel/impl/DynamicEObjectImpl.ts
838
816
  var DynamicEObjectImpl = class extends EObjectImpl {
@@ -966,6 +944,7 @@ var EModelElementImpl = class extends EObjectImpl {
966
944
  throw new Error(`Feature ${String(featureId)} on EModelElement is many-valued or unknown.`);
967
945
  }
968
946
  }
947
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
969
948
  eBootstrapList(featureId) {
970
949
  switch (featureId) {
971
950
  case 0:
@@ -996,6 +975,68 @@ var EModelElementImpl = class extends EObjectImpl {
996
975
  }
997
976
  };
998
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
+
999
1040
  // src/metamodel/impl/EFactoryImpl.ts
1000
1041
  var EFactoryImpl = class extends EModelElementImpl {
1001
1042
  _ePackage;
@@ -1021,32 +1062,69 @@ var EFactoryImpl = class extends EModelElementImpl {
1021
1062
  if (this.getEPackage() !== void 0 && eDataType.getEPackage() !== this.getEPackage()) {
1022
1063
  throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);
1023
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
+ }
1024
1079
  switch (eDataType.getName()) {
1025
1080
  case "EString":
1026
1081
  return literalValue;
1027
1082
  case "EInt":
1028
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));
1029
1091
  case "ELong":
1030
1092
  case "ELongObject":
1093
+ return integer(-9223372036854775808n, 9223372036854775807n);
1094
+ case "EBigInteger":
1095
+ return integer();
1031
1096
  case "EDouble":
1032
1097
  case "EDoubleObject":
1033
1098
  case "EFloat":
1034
1099
  case "EFloatObject":
1035
- case "EShort":
1036
- case "EShortObject":
1037
- case "EByte":
1038
- case "EByteObject":
1039
- return Number(literalValue);
1040
- case "EBigInteger":
1041
- 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;
1042
1108
  case "EBoolean":
1043
1109
  case "EBooleanObject":
1044
- return literalValue === "true";
1110
+ if (text.toLowerCase() === "true") return true;
1111
+ if (text.toLowerCase() === "false") return false;
1112
+ throw invalid();
1045
1113
  case "EChar":
1046
1114
  case "ECharacterObject":
1047
- return literalValue.charAt(0);
1048
- case "EDate":
1049
- 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
+ }
1050
1128
  default:
1051
1129
  return literalValue;
1052
1130
  }
@@ -1055,8 +1133,10 @@ var EFactoryImpl = class extends EModelElementImpl {
1055
1133
  if (this.getEPackage() !== void 0 && eDataType.getEPackage() !== this.getEPackage()) {
1056
1134
  throw new Error(`The datatype '${eDataType.getName()}' is not a valid classifier of this factory's package.`);
1057
1135
  }
1058
- if (eDataType.getName() === "EDate" && instanceValue instanceof Date) {
1059
- 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("");
1060
1140
  }
1061
1141
  return String(instanceValue);
1062
1142
  }
@@ -1106,6 +1186,7 @@ var EFactoryImpl = class extends EModelElementImpl {
1106
1186
  return;
1107
1187
  }
1108
1188
  }
1189
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1109
1190
  eBootstrapList(featureId) {
1110
1191
  switch (featureId) {
1111
1192
  default:
@@ -1149,6 +1230,7 @@ var EFactoryImpl = class extends EModelElementImpl {
1149
1230
 
1150
1231
  // src/metamodel/impl/DynamicEFactoryImpl.ts
1151
1232
  var DynamicEFactoryImpl = class extends EFactoryImpl {
1233
+ /** @throws Error if `eClass` is abstract or an interface. */
1152
1234
  create(eClass) {
1153
1235
  if (eClass.isAbstract() || eClass.isInterface()) {
1154
1236
  throw new Error(`Cannot instantiate '${eClass.getName()}': it is abstract or an interface.`);
@@ -1296,6 +1378,7 @@ var EAnnotationImpl = class extends EModelElementImpl {
1296
1378
  return;
1297
1379
  }
1298
1380
  }
1381
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1299
1382
  eBootstrapList(featureId) {
1300
1383
  switch (featureId) {
1301
1384
  case 2:
@@ -1437,6 +1520,7 @@ var ENamedElementImpl = class extends EModelElementImpl {
1437
1520
  return;
1438
1521
  }
1439
1522
  }
1523
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1440
1524
  eBootstrapList(featureId) {
1441
1525
  switch (featureId) {
1442
1526
  default:
@@ -1701,6 +1785,7 @@ var ETypedElementImpl = class extends ENamedElementImpl {
1701
1785
  return;
1702
1786
  }
1703
1787
  }
1788
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
1704
1789
  eBootstrapList(featureId) {
1705
1790
  switch (featureId) {
1706
1791
  default:
@@ -1874,7 +1959,8 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1874
1959
  _volatile = false;
1875
1960
  _transient = false;
1876
1961
  _defaultValueLiteral;
1877
- _defaultValue;
1962
+ _defaultValueCache;
1963
+ _defaultValueCacheGeneration = -1;
1878
1964
  _unsettable = false;
1879
1965
  _derived = false;
1880
1966
  _eContainingClass;
@@ -1882,6 +1968,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1882
1968
  getFeatureID() {
1883
1969
  return this.featureId;
1884
1970
  }
1971
+ /** Sets the feature's ID; called by generated packages. */
1885
1972
  setFeatureID(id) {
1886
1973
  this.featureId = id;
1887
1974
  }
@@ -1889,6 +1976,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1889
1976
  getContainerClass() {
1890
1977
  return this.containerClass;
1891
1978
  }
1979
+ /** Sets the implementation class of the declaring class; called by generated packages. */
1892
1980
  setContainerClass(cls) {
1893
1981
  this.containerClass = cls;
1894
1982
  }
@@ -1920,10 +2008,19 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1920
2008
  this.eSet(getEcorePackageRef().getEStructuralFeature_DefaultValueLiteral(), value);
1921
2009
  }
1922
2010
  getDefaultValue() {
1923
- return this._defaultValue;
1924
- }
1925
- setDefaultValue(value) {
1926
- 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;
1927
2024
  }
1928
2025
  isUnsettable() {
1929
2026
  return this._unsettable;
@@ -1955,7 +2052,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
1955
2052
  case 13:
1956
2053
  return this._defaultValueLiteral;
1957
2054
  case 14:
1958
- return this._defaultValue;
2055
+ return this.getDefaultValue();
1959
2056
  case 15:
1960
2057
  return this._unsettable;
1961
2058
  case 16:
@@ -2097,9 +2194,6 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
2097
2194
  case 13:
2098
2195
  this._defaultValueLiteral = value;
2099
2196
  return;
2100
- case 14:
2101
- this._defaultValue = value;
2102
- return;
2103
2197
  case 15:
2104
2198
  this._unsettable = value;
2105
2199
  return;
@@ -2114,6 +2208,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
2114
2208
  return;
2115
2209
  }
2116
2210
  }
2211
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2117
2212
  eBootstrapList(featureId) {
2118
2213
  switch (featureId) {
2119
2214
  default:
@@ -2132,7 +2227,7 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
2132
2227
  case 13:
2133
2228
  return this._defaultValueLiteral !== void 0;
2134
2229
  case 14:
2135
- return this._defaultValue !== void 0;
2230
+ return this.getDefaultValue() !== void 0;
2136
2231
  case 15:
2137
2232
  return this._unsettable !== false;
2138
2233
  case 16:
@@ -2210,22 +2305,6 @@ var EStructuralFeatureImpl = class extends ETypedElementImpl {
2210
2305
  });
2211
2306
  return;
2212
2307
  }
2213
- case 14: {
2214
- const wasSet = this.eIsSet(feature);
2215
- const oldValue = this._defaultValue;
2216
- this._defaultValue = void 0;
2217
- this.eDidRemove(feature, oldValue);
2218
- this.eNotify({
2219
- eventType: "UNSET",
2220
- notifier: this,
2221
- feature,
2222
- oldValue,
2223
- newValue: void 0,
2224
- position: void 0,
2225
- wasSet
2226
- });
2227
- return;
2228
- }
2229
2308
  case 15: {
2230
2309
  const wasSet = this.eIsSet(feature);
2231
2310
  const oldValue = this._unsettable;
@@ -2348,6 +2427,7 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2348
2427
  return;
2349
2428
  }
2350
2429
  }
2430
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2351
2431
  eBootstrapList(featureId) {
2352
2432
  switch (featureId) {
2353
2433
  default:
@@ -2411,7 +2491,8 @@ var EAttributeImpl = class extends EStructuralFeatureImpl {
2411
2491
  var EClassifierImpl = class extends ENamedElementImpl {
2412
2492
  _instanceClassName;
2413
2493
  _instanceClass;
2414
- _defaultValue;
2494
+ _defaultValueCache;
2495
+ _defaultValueCacheGeneration = -1;
2415
2496
  _instanceTypeName;
2416
2497
  _ePackage;
2417
2498
  _eTypeParametersCache;
@@ -2426,6 +2507,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2426
2507
  getClassifierID() {
2427
2508
  return this.classifierId;
2428
2509
  }
2510
+ /** Sets the classifier's ID; called by generated packages. */
2429
2511
  setClassifierID(id) {
2430
2512
  this.classifierId = id;
2431
2513
  }
@@ -2445,10 +2527,36 @@ var EClassifierImpl = class extends ENamedElementImpl {
2445
2527
  this._instanceClass = value;
2446
2528
  }
2447
2529
  getDefaultValue() {
2448
- return this._defaultValue;
2449
- }
2450
- setDefaultValue(value) {
2451
- 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;
2452
2560
  }
2453
2561
  getInstanceTypeName() {
2454
2562
  return this._instanceTypeName;
@@ -2469,16 +2577,17 @@ var EClassifierImpl = class extends ENamedElementImpl {
2469
2577
  switch (this.eClass().getName()) {
2470
2578
  case "EClass":
2471
2579
  return object instanceof EObjectImpl && this.isSuperTypeOf(object.eClass());
2580
+ case "EEnum":
2581
+ return typeof object === "string" && this.getEEnumLiteralByLiteral(object) !== void 0;
2472
2582
  default:
2473
2583
  switch (this.getName()) {
2474
2584
  case "EString":
2475
2585
  case "EChar":
2476
2586
  case "ECharacterObject":
2587
+ case "EBigDecimal":
2477
2588
  return typeof object === "string";
2478
2589
  case "EInt":
2479
2590
  case "EIntegerObject":
2480
- case "ELong":
2481
- case "ELongObject":
2482
2591
  case "EDouble":
2483
2592
  case "EDoubleObject":
2484
2593
  case "EFloat":
@@ -2488,6 +2597,8 @@ var EClassifierImpl = class extends ENamedElementImpl {
2488
2597
  case "EByte":
2489
2598
  case "EByteObject":
2490
2599
  return typeof object === "number";
2600
+ case "ELong":
2601
+ case "ELongObject":
2491
2602
  case "EBigInteger":
2492
2603
  return typeof object === "bigint";
2493
2604
  case "EBoolean":
@@ -2495,6 +2606,8 @@ var EClassifierImpl = class extends ENamedElementImpl {
2495
2606
  return typeof object === "boolean";
2496
2607
  case "EDate":
2497
2608
  return object instanceof Date;
2609
+ case "EByteArray":
2610
+ return object instanceof Uint8Array;
2498
2611
  default:
2499
2612
  return object !== void 0 && object !== null;
2500
2613
  }
@@ -2508,7 +2621,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2508
2621
  case 3:
2509
2622
  return this._instanceClass;
2510
2623
  case 4:
2511
- return this._defaultValue;
2624
+ return this.getDefaultValue();
2512
2625
  case 5:
2513
2626
  return this._instanceTypeName;
2514
2627
  case 6:
@@ -2579,9 +2692,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2579
2692
  case 3:
2580
2693
  this._instanceClass = value;
2581
2694
  return;
2582
- case 4:
2583
- this._defaultValue = value;
2584
- return;
2585
2695
  case 5:
2586
2696
  this._instanceTypeName = value;
2587
2697
  return;
@@ -2593,6 +2703,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2593
2703
  return;
2594
2704
  }
2595
2705
  }
2706
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2596
2707
  eBootstrapList(featureId) {
2597
2708
  switch (featureId) {
2598
2709
  case 7:
@@ -2610,7 +2721,7 @@ var EClassifierImpl = class extends ENamedElementImpl {
2610
2721
  case 3:
2611
2722
  return this._instanceClass !== void 0;
2612
2723
  case 4:
2613
- return this._defaultValue !== void 0;
2724
+ return this.getDefaultValue() !== void 0;
2614
2725
  case 5:
2615
2726
  return this._instanceTypeName !== void 0;
2616
2727
  case 6:
@@ -2656,22 +2767,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2656
2767
  });
2657
2768
  return;
2658
2769
  }
2659
- case 4: {
2660
- const wasSet = this.eIsSet(feature);
2661
- const oldValue = this._defaultValue;
2662
- this._defaultValue = void 0;
2663
- this.eDidRemove(feature, oldValue);
2664
- this.eNotify({
2665
- eventType: "UNSET",
2666
- notifier: this,
2667
- feature,
2668
- oldValue,
2669
- newValue: void 0,
2670
- position: void 0,
2671
- wasSet
2672
- });
2673
- return;
2674
- }
2675
2770
  case 5: {
2676
2771
  const wasSet = this.eIsSet(feature);
2677
2772
  const oldValue = this._instanceTypeName;
@@ -2714,68 +2809,6 @@ var EClassifierImpl = class extends ENamedElementImpl {
2714
2809
  }
2715
2810
  };
2716
2811
 
2717
- // src/metamodel/util/EcoreTypeGuards.ts
2718
- function hasEClass(obj) {
2719
- return obj !== null && typeof obj === "object" && typeof obj.eClass === "function";
2720
- }
2721
- function isEAttribute(obj) {
2722
- return hasEClass(obj) && getEcorePackageRef().getEAttribute().isSuperTypeOf(obj.eClass());
2723
- }
2724
- function isEAnnotation(obj) {
2725
- return hasEClass(obj) && getEcorePackageRef().getEAnnotation().isSuperTypeOf(obj.eClass());
2726
- }
2727
- function isEClass(obj) {
2728
- return hasEClass(obj) && getEcorePackageRef().getEClass().isSuperTypeOf(obj.eClass());
2729
- }
2730
- function isEClassifier(obj) {
2731
- return hasEClass(obj) && getEcorePackageRef().getEClassifier().isSuperTypeOf(obj.eClass());
2732
- }
2733
- function isEDataType(obj) {
2734
- return hasEClass(obj) && getEcorePackageRef().getEDataType().isSuperTypeOf(obj.eClass());
2735
- }
2736
- function isEEnum(obj) {
2737
- return hasEClass(obj) && getEcorePackageRef().getEEnum().isSuperTypeOf(obj.eClass());
2738
- }
2739
- function isEEnumLiteral(obj) {
2740
- return hasEClass(obj) && getEcorePackageRef().getEEnumLiteral().isSuperTypeOf(obj.eClass());
2741
- }
2742
- function isEFactory(obj) {
2743
- return hasEClass(obj) && getEcorePackageRef().getEFactory().isSuperTypeOf(obj.eClass());
2744
- }
2745
- function isEModelElement(obj) {
2746
- return hasEClass(obj) && getEcorePackageRef().getEModelElement().isSuperTypeOf(obj.eClass());
2747
- }
2748
- function isENamedElement(obj) {
2749
- return hasEClass(obj) && getEcorePackageRef().getENamedElement().isSuperTypeOf(obj.eClass());
2750
- }
2751
- function isEOperation(obj) {
2752
- return hasEClass(obj) && getEcorePackageRef().getEOperation().isSuperTypeOf(obj.eClass());
2753
- }
2754
- function isEPackage(obj) {
2755
- return hasEClass(obj) && getEcorePackageRef().getEPackage().isSuperTypeOf(obj.eClass());
2756
- }
2757
- function isEParameter(obj) {
2758
- return hasEClass(obj) && getEcorePackageRef().getEParameter().isSuperTypeOf(obj.eClass());
2759
- }
2760
- function isEReference(obj) {
2761
- return hasEClass(obj) && getEcorePackageRef().getEReference().isSuperTypeOf(obj.eClass());
2762
- }
2763
- function isEStructuralFeature(obj) {
2764
- return hasEClass(obj) && getEcorePackageRef().getEStructuralFeature().isSuperTypeOf(obj.eClass());
2765
- }
2766
- function isETypedElement(obj) {
2767
- return hasEClass(obj) && getEcorePackageRef().getETypedElement().isSuperTypeOf(obj.eClass());
2768
- }
2769
- function isEStringToStringMapEntry(obj) {
2770
- return hasEClass(obj) && getEcorePackageRef().getEStringToStringMapEntry().isSuperTypeOf(obj.eClass());
2771
- }
2772
- function isEGenericType(obj) {
2773
- return hasEClass(obj) && getEcorePackageRef().getEGenericType().isSuperTypeOf(obj.eClass());
2774
- }
2775
- function isETypeParameter(obj) {
2776
- return hasEClass(obj) && getEcorePackageRef().getETypeParameter().isSuperTypeOf(obj.eClass());
2777
- }
2778
-
2779
2812
  // src/metamodel/impl/EGenericTypeImpl.ts
2780
2813
  var EGenericTypeImpl = class extends EObjectImpl {
2781
2814
  _eUpperBound;
@@ -2963,6 +2996,7 @@ var EGenericTypeImpl = class extends EObjectImpl {
2963
2996
  throw new Error(`Feature ${String(featureId)} on EGenericType is many-valued or unknown.`);
2964
2997
  }
2965
2998
  }
2999
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
2966
3000
  eBootstrapList(featureId) {
2967
3001
  switch (featureId) {
2968
3002
  case 1:
@@ -3140,137 +3174,153 @@ var EClassImpl = class extends EClassifierImpl {
3140
3174
  }
3141
3175
  getEAllAttributes() {
3142
3176
  if (this._eAllAttributesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3143
- this._eAllAttributesCache = (() => {
3144
- return new BasicEList(
3145
- void 0,
3146
- void 0,
3147
- this.getEAllStructuralFeatures().filter(isEAttribute)
3148
- );
3149
- })();
3177
+ this._eAllAttributesCache = new UnmodifiableEList(
3178
+ (() => {
3179
+ return new BasicEList(
3180
+ void 0,
3181
+ void 0,
3182
+ this.getEAllStructuralFeatures().filter(isEAttribute)
3183
+ );
3184
+ })()
3185
+ );
3150
3186
  this._eAllAttributesCacheGeneration = EObjectImpl.getModelGeneration();
3151
3187
  }
3152
3188
  return this._eAllAttributesCache;
3153
3189
  }
3154
3190
  getEAllReferences() {
3155
3191
  if (this._eAllReferencesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3156
- this._eAllReferencesCache = (() => {
3157
- return new BasicEList(
3158
- void 0,
3159
- void 0,
3160
- this.getEAllStructuralFeatures().filter(isEReference)
3161
- );
3162
- })();
3192
+ this._eAllReferencesCache = new UnmodifiableEList(
3193
+ (() => {
3194
+ return new BasicEList(
3195
+ void 0,
3196
+ void 0,
3197
+ this.getEAllStructuralFeatures().filter(isEReference)
3198
+ );
3199
+ })()
3200
+ );
3163
3201
  this._eAllReferencesCacheGeneration = EObjectImpl.getModelGeneration();
3164
3202
  }
3165
3203
  return this._eAllReferencesCache;
3166
3204
  }
3167
3205
  getEReferences() {
3168
3206
  if (this._eReferencesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3169
- this._eReferencesCache = (() => {
3170
- return new BasicEList(
3171
- void 0,
3172
- void 0,
3173
- this.getEStructuralFeatures().filter(isEReference)
3174
- );
3175
- })();
3207
+ this._eReferencesCache = new UnmodifiableEList(
3208
+ (() => {
3209
+ return new BasicEList(
3210
+ void 0,
3211
+ void 0,
3212
+ this.getEStructuralFeatures().filter(isEReference)
3213
+ );
3214
+ })()
3215
+ );
3176
3216
  this._eReferencesCacheGeneration = EObjectImpl.getModelGeneration();
3177
3217
  }
3178
3218
  return this._eReferencesCache;
3179
3219
  }
3180
3220
  getEAttributes() {
3181
3221
  if (this._eAttributesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3182
- this._eAttributesCache = (() => {
3183
- return new BasicEList(
3184
- void 0,
3185
- void 0,
3186
- this.getEStructuralFeatures().filter(isEAttribute)
3187
- );
3188
- })();
3222
+ this._eAttributesCache = new UnmodifiableEList(
3223
+ (() => {
3224
+ return new BasicEList(
3225
+ void 0,
3226
+ void 0,
3227
+ this.getEStructuralFeatures().filter(isEAttribute)
3228
+ );
3229
+ })()
3230
+ );
3189
3231
  this._eAttributesCacheGeneration = EObjectImpl.getModelGeneration();
3190
3232
  }
3191
3233
  return this._eAttributesCache;
3192
3234
  }
3193
3235
  getEAllContainments() {
3194
3236
  if (this._eAllContainmentsCacheGeneration !== EObjectImpl.getModelGeneration()) {
3195
- this._eAllContainmentsCache = (() => {
3196
- const references = this.getEAllStructuralFeatures().filter(isEReference);
3197
- return new BasicEList(
3198
- void 0,
3199
- void 0,
3200
- references.filter((reference) => reference.isContainment())
3201
- );
3202
- })();
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
+ );
3203
3247
  this._eAllContainmentsCacheGeneration = EObjectImpl.getModelGeneration();
3204
3248
  }
3205
3249
  return this._eAllContainmentsCache;
3206
3250
  }
3207
3251
  getEAllOperations() {
3208
3252
  if (this._eAllOperationsCacheGeneration !== EObjectImpl.getModelGeneration()) {
3209
- this._eAllOperationsCache = (() => {
3210
- const operations = /* @__PURE__ */ new Set();
3211
- const visited = /* @__PURE__ */ new Set();
3212
- const visit = (eClass) => {
3213
- if (visited.has(eClass)) return;
3214
- visited.add(eClass);
3215
- eClass.getESuperTypes().forEach(visit);
3216
- for (const generic of eClass.getEGenericSuperTypes()) {
3217
- const raw = generic.getEClassifier();
3218
- if (raw !== void 0 && isEClass(raw)) visit(raw);
3219
- }
3220
- eClass.getEOperations().forEach((operation) => operations.add(operation));
3221
- };
3222
- visit(this);
3223
- return new BasicEList(void 0, void 0, operations);
3224
- })();
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
+ );
3225
3271
  this._eAllOperationsCacheGeneration = EObjectImpl.getModelGeneration();
3226
3272
  }
3227
3273
  return this._eAllOperationsCache;
3228
3274
  }
3229
3275
  getEAllStructuralFeatures() {
3230
3276
  if (this._eAllStructuralFeaturesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3231
- this._eAllStructuralFeaturesCache = (() => {
3232
- const features = /* @__PURE__ */ new Set();
3233
- const visited = /* @__PURE__ */ new Set();
3234
- const visit = (eClass) => {
3235
- if (visited.has(eClass)) return;
3236
- visited.add(eClass);
3237
- eClass.getESuperTypes().forEach(visit);
3238
- for (const generic of eClass.getEGenericSuperTypes()) {
3239
- const raw = generic.getEClassifier();
3240
- if (raw !== void 0 && isEClass(raw)) visit(raw);
3241
- }
3242
- eClass.getEStructuralFeatures().forEach((feature) => features.add(feature));
3243
- };
3244
- visit(this);
3245
- return new BasicEList(void 0, void 0, features);
3246
- })();
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
+ );
3247
3295
  this._eAllStructuralFeaturesCacheGeneration = EObjectImpl.getModelGeneration();
3248
3296
  }
3249
3297
  return this._eAllStructuralFeaturesCache;
3250
3298
  }
3251
3299
  getEAllSuperTypes() {
3252
3300
  if (this._eAllSuperTypesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3253
- this._eAllSuperTypesCache = (() => {
3254
- const superTypes = /* @__PURE__ */ new Set();
3255
- const visited = /* @__PURE__ */ new Set();
3256
- const visit = (eClass) => {
3257
- if (visited.has(eClass)) return;
3258
- visited.add(eClass);
3259
- for (const sup of eClass.getESuperTypes()) {
3260
- visit(sup);
3261
- superTypes.add(sup);
3262
- }
3263
- for (const generic of eClass.getEGenericSuperTypes()) {
3264
- const raw = generic.getEClassifier();
3265
- if (raw !== void 0 && isEClass(raw)) {
3266
- visit(raw);
3267
- 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);
3268
3311
  }
3269
- }
3270
- };
3271
- visit(this);
3272
- return new BasicEList(void 0, void 0, superTypes);
3273
- })();
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
+ );
3274
3324
  this._eAllSuperTypesCacheGeneration = EObjectImpl.getModelGeneration();
3275
3325
  }
3276
3326
  return this._eAllSuperTypesCache;
@@ -3292,29 +3342,31 @@ var EClassImpl = class extends EClassifierImpl {
3292
3342
  }
3293
3343
  getEAllGenericSuperTypes() {
3294
3344
  if (this._eAllGenericSuperTypesCacheGeneration !== EObjectImpl.getModelGeneration()) {
3295
- this._eAllGenericSuperTypesCache = (() => {
3296
- const genericSuperTypes = /* @__PURE__ */ new Set();
3297
- const visited = /* @__PURE__ */ new Set();
3298
- const visit = (eClass) => {
3299
- if (visited.has(eClass)) return;
3300
- visited.add(eClass);
3301
- for (const sup of eClass.getESuperTypes()) {
3302
- visit(sup);
3303
- const implicit = new EGenericTypeImpl();
3304
- implicit.setEClassifier(sup);
3305
- genericSuperTypes.add(implicit);
3306
- }
3307
- for (const generic of eClass.getEGenericSuperTypes()) {
3308
- const raw = generic.getEClassifier();
3309
- if (raw !== void 0 && isEClass(raw)) {
3310
- visit(raw);
3311
- 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);
3312
3357
  }
3313
- }
3314
- };
3315
- visit(this);
3316
- return new BasicEList(void 0, void 0, genericSuperTypes);
3317
- })();
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
+ );
3318
3370
  this._eAllGenericSuperTypesCacheGeneration = EObjectImpl.getModelGeneration();
3319
3371
  }
3320
3372
  return this._eAllGenericSuperTypesCache;
@@ -3492,6 +3544,7 @@ var EClassImpl = class extends EClassifierImpl {
3492
3544
  return;
3493
3545
  }
3494
3546
  }
3547
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3495
3548
  eBootstrapList(featureId) {
3496
3549
  switch (featureId) {
3497
3550
  case 10:
@@ -3661,6 +3714,7 @@ var EDataTypeImpl = class extends EClassifierImpl {
3661
3714
  return;
3662
3715
  }
3663
3716
  }
3717
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3664
3718
  eBootstrapList(featureId) {
3665
3719
  switch (featureId) {
3666
3720
  default:
@@ -3761,6 +3815,7 @@ var EEnumImpl = class extends EDataTypeImpl {
3761
3815
  return;
3762
3816
  }
3763
3817
  }
3818
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3764
3819
  eBootstrapList(featureId) {
3765
3820
  switch (featureId) {
3766
3821
  case 9:
@@ -3912,6 +3967,7 @@ var EEnumLiteralImpl = class extends ENamedElementImpl {
3912
3967
  return;
3913
3968
  }
3914
3969
  }
3970
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
3915
3971
  eBootstrapList(featureId) {
3916
3972
  switch (featureId) {
3917
3973
  default:
@@ -4040,6 +4096,7 @@ var EOperationImpl = class extends ETypedElementImpl {
4040
4096
  getOperationID() {
4041
4097
  return this.operationId;
4042
4098
  }
4099
+ /** Sets the operation's ID; called by generated packages. */
4043
4100
  setOperationID(id) {
4044
4101
  this.operationId = id;
4045
4102
  }
@@ -4144,6 +4201,7 @@ var EOperationImpl = class extends ETypedElementImpl {
4144
4201
  return;
4145
4202
  }
4146
4203
  }
4204
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4147
4205
  eBootstrapList(featureId) {
4148
4206
  switch (featureId) {
4149
4207
  case 11:
@@ -4384,6 +4442,7 @@ var EPackageImpl = class extends ENamedElementImpl {
4384
4442
  return;
4385
4443
  }
4386
4444
  }
4445
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4387
4446
  eBootstrapList(featureId) {
4388
4447
  switch (featureId) {
4389
4448
  case 5:
@@ -4535,6 +4594,7 @@ var EParameterImpl = class extends ETypedElementImpl {
4535
4594
  return;
4536
4595
  }
4537
4596
  }
4597
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4538
4598
  eBootstrapList(featureId) {
4539
4599
  switch (featureId) {
4540
4600
  default:
@@ -4729,6 +4789,7 @@ var EReferenceImpl = class extends EStructuralFeatureImpl {
4729
4789
  return;
4730
4790
  }
4731
4791
  }
4792
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4732
4793
  eBootstrapList(featureId) {
4733
4794
  switch (featureId) {
4734
4795
  case 23:
@@ -4895,6 +4956,7 @@ var ETypeParameterImpl = class extends ENamedElementImpl {
4895
4956
  return;
4896
4957
  }
4897
4958
  }
4959
+ /** @internal The list of the many-valued feature `featureId`, for bootstrapping the package. */
4898
4960
  eBootstrapList(featureId) {
4899
4961
  switch (featureId) {
4900
4962
  case 2:
@@ -5186,6 +5248,7 @@ var ResourceImpl = class {
5186
5248
  getSerializer() {
5187
5249
  return this.serializer;
5188
5250
  }
5251
+ /** @internal */
5189
5252
  eSetResourceSet(resourceSet) {
5190
5253
  this.resourceSet = resourceSet;
5191
5254
  }
@@ -5198,26 +5261,9 @@ var ResourceImpl = class {
5198
5261
  isLoaded() {
5199
5262
  return this.loaded;
5200
5263
  }
5201
- /**
5202
- * Concurrency-protected: `loaded` only flips to true once deserialize() fully finishes, so
5203
- * multiple concurrent load() calls for this exact resource - genuinely racing, none of them
5204
- * blocking on any of the others' own completion - used to each independently see
5205
- * `!resource.isLoaded()` and start their own, fully separate deserialize() call. Collapsed here
5206
- * into one: a call made while another is already in flight awaits that same, single,
5207
- * already-running promise instead. The real fix for a real, confirmed exponential-blowup hazard
5208
- * found this way: a self-referential metamodel (e.g. a "Feature contains child Features" style
5209
- * containment cycle - a normal, valid pattern, not a modeling error) can have many concurrent,
5210
- * independent resolve() calls converge on the same not-yet-finished resource.
5211
- *
5212
- * What this does NOT, and cannot, fix on its own: a caller that *directly awaits* a nested
5213
- * load() call on this exact resource, from within this resource's own still-running
5214
- * deserialize() itself, still deadlocks - confirmed directly, not just reasoned about. The
5215
- * shared, returned promise can only resolve once deserialize() returns, but deserialize() would
5216
- * now be waiting on that very promise, a genuine circular wait no Resource-level guard can
5217
- * break. A caller with that exact shape (e.g. SnapshotSerializer's own reconstruction of a
5218
- * self-referential metamodel) has to avoid making the reentrant load() call at all instead -
5219
- * see SnapshotSerializer's own registry.objectFor() short-circuit for how.
5220
- */
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.
5221
5267
  async load() {
5222
5268
  if (this.loadInProgress) return this.loadInProgress;
5223
5269
  this.loadInProgress = this.doLoad();
@@ -5407,9 +5453,10 @@ var URI = class _URI {
5407
5453
  hasAuthority;
5408
5454
  path;
5409
5455
  fragment;
5410
- /** Parses an absolute URI ("scheme:path" / "scheme://path") or a relative reference (anything
5411
- * else - a bare path, with no scheme). Never throws: a string with no recognizable scheme is
5412
- * relative, not invalid - resolve() against a base URI before using it as a document location. */
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
+ */
5413
5460
  static parse(uriString) {
5414
5461
  const absolute = /^([a-zA-Z][a-zA-Z0-9+.-]*):(\/\/)?([^#]*)(?:#(.*))?$/.exec(uriString);
5415
5462
  if (absolute) {
@@ -5420,18 +5467,9 @@ var URI = class _URI {
5420
5467
  return new _URI(void 0, false, path, fragment);
5421
5468
  }
5422
5469
  /**
5423
- * Convenience for the common case of wrapping a filesystem path (CORE-06). Backslashes become
5424
- * forward slashes first - a Windows `fsPath` ("C:\Users\a b\m.xmi") has none of its own, so this
5425
- * is purely "native path -> URI path" translation, matching real EMF's own `URI.createFileURI`;
5426
- * it naturally also makes a drive-letter path absolute, the same way a POSIX path already was,
5427
- * with no separate case needed (`C:/...` doesn't start with "/" yet, so it gets one prepended,
5428
- * same as any other non-absolute input). Each path segment is then percent-encoded (a reserved
5429
- * character - most commonly a space in a real file path - would otherwise corrupt `resolve`/
5430
- * `deresolve`'s own segment splitting, or the URI text once serialized into an `href`); `:` is
5431
- * deliberately left unescaped (valid unencoded in a URI path segment, and this is exactly what
5432
- * keeps a drive letter readable as "C:" rather than "C%3A", matching Eclipse's own Windows file
5433
- * URIs). `getPath()`/`toString()` return this encoded form - decoding back to a native path is
5434
- * `@typemf/node`'s own job (NODE-01's `fileURLToPath`), not this class's.
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`.
5435
5473
  */
5436
5474
  static createFileURI(path) {
5437
5475
  const normalized = path.replace(/\\/g, "/");
@@ -5467,9 +5505,8 @@ var URI = class _URI {
5467
5505
  return this.fragment === void 0 ? this : this.withFragment(void 0);
5468
5506
  }
5469
5507
  /**
5470
- * This URI, made absolute against `base` if it is relative; returned unchanged otherwise.
5471
- * `base`'s own fragment is irrelevant and ignored - only its scheme/authority/path (i.e. "which
5472
- * document") anchor the result; this URI's own fragment (if any) is kept as-is.
5508
+ * This URI made absolute against `base` if it is relative, unchanged otherwise. Keeps this URI's
5509
+ * fragment and ignores `base`'s.
5473
5510
  */
5474
5511
  resolve(base) {
5475
5512
  if (!this.isRelative()) return this;
@@ -5478,11 +5515,8 @@ var URI = class _URI {
5478
5515
  return new _URI(base.scheme, base.hasAuthority, normalizePath(merged), this.fragment);
5479
5516
  }
5480
5517
  /**
5481
- * The shortest relative reference from `base` to this URI, when both share a scheme and
5482
- * authority (the common, same-workspace case this is actually for) - this URI unchanged
5483
- * otherwise, since there is then nothing meaningful to make relative against. Already-relative
5484
- * stays unchanged either way. The inverse of resolve(): `uri.deresolve(base).resolve(base)`
5485
- * reconstructs the original absolute path.
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}.
5486
5520
  */
5487
5521
  deresolve(base) {
5488
5522
  if (this.isRelative() || this.scheme !== base.scheme || this.hasAuthority !== base.hasAuthority) return this;
@@ -5674,10 +5708,10 @@ var Ids = {
5674
5708
 
5675
5709
  // src/metamodel/impl/EcoreFactoryImpl.ts
5676
5710
  var EcoreFactoryImpl = class extends EFactoryImpl {
5677
- /** The one canonical factory instance - real EMF's own `EcoreFactory.eINSTANCE`, which this project
5678
- * ports onto the Impl class rather than the interface (TypeScript interfaces have no statics).
5679
- * Reading this also constructs the package singleton on first use (CORE-01), via the same
5680
- * lazy initializer EcorePackageImpl.eINSTANCE itself goes through. */
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
+ */
5681
5715
  static get eINSTANCE() {
5682
5716
  return getEcorePackageRef().getEFactoryInstance();
5683
5717
  }
@@ -5938,14 +5972,9 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
5938
5972
  _EInvocationTargetException;
5939
5973
  static _instance;
5940
5974
  /**
5941
- * The one explicit entry point that constructs the singleton - call it
5942
- * yourself, with your own factory, before anything else in your program
5943
- * touches EcorePackageImpl.eINSTANCE, to use a custom factory (e.g. one
5944
- * overriding createX() to return your own derived classes). Whichever
5945
- * caller gets here FIRST wins; a later call with a *different* factory
5946
- * is logged and otherwise ignored, rather than silently replacing an
5947
- * already-in-use singleton or throwing on a caller who didn't cause the
5948
- * 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.
5949
5978
  */
5950
5979
  static init(factory) {
5951
5980
  if (!_EcorePackageImpl._instance) {
@@ -6189,7 +6218,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6189
6218
  {
6190
6219
  const entry = new EStringToStringMapEntryImpl();
6191
6220
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6192
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6221
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string");
6193
6222
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6194
6223
  }
6195
6224
  this._EBigDecimal.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6215,7 +6244,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6215
6244
  {
6216
6245
  const entry = new EStringToStringMapEntryImpl();
6217
6246
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6218
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6247
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint");
6219
6248
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6220
6249
  }
6221
6250
  this._EBigInteger.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6325,7 +6354,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6325
6354
  {
6326
6355
  const entry = new EStringToStringMapEntryImpl();
6327
6356
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6328
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number []");
6357
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "Uint8Array");
6329
6358
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6330
6359
  }
6331
6360
  this._EByteArray.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6404,7 +6433,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6404
6433
  {
6405
6434
  const entry = new EStringToStringMapEntryImpl();
6406
6435
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6407
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string []");
6436
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "string | undefined");
6408
6437
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6409
6438
  }
6410
6439
  this._ECharacterObject.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6419,7 +6448,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6419
6448
  {
6420
6449
  const entry = new EStringToStringMapEntryImpl();
6421
6450
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6422
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "unknown");
6451
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "Date");
6423
6452
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6424
6453
  }
6425
6454
  this._EDate.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6760,7 +6789,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6760
6789
  {
6761
6790
  const entry = new EStringToStringMapEntryImpl();
6762
6791
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6763
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number");
6792
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint");
6764
6793
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6765
6794
  }
6766
6795
  this._ELong.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6792,7 +6821,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6792
6821
  {
6793
6822
  const entry = new EStringToStringMapEntryImpl();
6794
6823
  entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
6795
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "number | undefined");
6824
+ entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "bigint | undefined");
6796
6825
  annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
6797
6826
  }
6798
6827
  this._ELongObject.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
@@ -6999,40 +7028,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
6999
7028
  this._EStringToStringMapEntry = new EClassImpl();
7000
7029
  this._EStringToStringMapEntry.eBasicSetValue(Ids.ENamedElement.name, "EStringToStringMapEntry");
7001
7030
  this._EStringToStringMapEntry.setClassifierID(Ids.EStringToStringMapEntry.self);
7002
- {
7003
- const annotation = new EAnnotationImpl();
7004
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
7005
- {
7006
- const entry = new EStringToStringMapEntryImpl();
7007
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7008
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EStringToStringMapEntry");
7009
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7010
- }
7011
- this._EStringToStringMapEntry.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7012
- }
7013
- {
7014
- const annotation = new EAnnotationImpl();
7015
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7016
- {
7017
- const entry = new EStringToStringMapEntryImpl();
7018
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7019
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EStringToStringMapEntry");
7020
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7021
- }
7022
- {
7023
- const entry = new EStringToStringMapEntryImpl();
7024
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7025
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7026
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7027
- }
7028
- {
7029
- const entry = new EStringToStringMapEntryImpl();
7030
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7031
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./types/EStringToStringMapEntry");
7032
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7033
- }
7034
- this._EStringToStringMapEntry.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7035
- }
7036
7031
  this.eBootstrapList(Ids.EPackage.eClassifiers).add(this._EStringToStringMapEntry);
7037
7032
  this._ETreeIterator = new EDataTypeImpl();
7038
7033
  this._ETreeIterator.eBasicSetValue(Ids.ENamedElement.name, "ETreeIterator");
@@ -7224,23 +7219,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7224
7219
  this._EClass_eSuperTypes.setContainerClass(EClassImpl);
7225
7220
  this._EClass_eSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7226
7221
  this._EClass_eSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
7227
- {
7228
- const annotation = new EAnnotationImpl();
7229
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
7230
- {
7231
- const entry = new EStringToStringMapEntryImpl();
7232
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
7233
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7234
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7235
- }
7236
- {
7237
- const entry = new EStringToStringMapEntryImpl();
7238
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
7239
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7240
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7241
- }
7242
- this._EClass_eSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7243
- }
7244
7222
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eSuperTypes);
7245
7223
  this._EClass_eOperations = new EReferenceImpl();
7246
7224
  this._EClass_eOperations.eBasicSetValue(Ids.ENamedElement.name, "eOperations");
@@ -7275,60 +7253,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7275
7253
  this._EClass_eAllAttributes.setContainerClass(EClassImpl);
7276
7254
  this._EClass_eAllAttributes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7277
7255
  this._EClass_eAllAttributes.eBasicSetValue(Ids.EReference.containment, false);
7278
- {
7279
- const annotation = new EAnnotationImpl();
7280
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7281
- {
7282
- const entry = new EStringToStringMapEntryImpl();
7283
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7284
- entry.eBasicSetValue(
7285
- Ids.EStringToStringMapEntry.value,
7286
- "return new BasicEList<EAttribute>(undefined, undefined, this.getEAllStructuralFeatures().filter(isEAttribute) as EAttribute[]);"
7287
- );
7288
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7289
- }
7290
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7291
- }
7292
- {
7293
- const annotation = new EAnnotationImpl();
7294
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7295
- {
7296
- const entry = new EStringToStringMapEntryImpl();
7297
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7298
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7299
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7300
- }
7301
- {
7302
- const entry = new EStringToStringMapEntryImpl();
7303
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7304
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7305
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7306
- }
7307
- {
7308
- const entry = new EStringToStringMapEntryImpl();
7309
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7310
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7311
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7312
- }
7313
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7314
- }
7315
- {
7316
- const annotation = new EAnnotationImpl();
7317
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7318
- {
7319
- const entry = new EStringToStringMapEntryImpl();
7320
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7321
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEAttribute");
7322
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7323
- }
7324
- {
7325
- const entry = new EStringToStringMapEntryImpl();
7326
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7327
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7328
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7329
- }
7330
- this._EClass_eAllAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7331
- }
7332
7256
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllAttributes);
7333
7257
  this._EClass_eAllReferences = new EReferenceImpl();
7334
7258
  this._EClass_eAllReferences.eBasicSetValue(Ids.ENamedElement.name, "eAllReferences");
@@ -7346,60 +7270,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7346
7270
  this._EClass_eAllReferences.setContainerClass(EClassImpl);
7347
7271
  this._EClass_eAllReferences.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7348
7272
  this._EClass_eAllReferences.eBasicSetValue(Ids.EReference.containment, false);
7349
- {
7350
- const annotation = new EAnnotationImpl();
7351
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7352
- {
7353
- const entry = new EStringToStringMapEntryImpl();
7354
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7355
- entry.eBasicSetValue(
7356
- Ids.EStringToStringMapEntry.value,
7357
- "return new BasicEList<EReference>(undefined, undefined, this.getEAllStructuralFeatures().filter(isEReference) as EReference[]);"
7358
- );
7359
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7360
- }
7361
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7362
- }
7363
- {
7364
- const annotation = new EAnnotationImpl();
7365
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7366
- {
7367
- const entry = new EStringToStringMapEntryImpl();
7368
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7369
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7370
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7371
- }
7372
- {
7373
- const entry = new EStringToStringMapEntryImpl();
7374
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7375
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7376
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7377
- }
7378
- {
7379
- const entry = new EStringToStringMapEntryImpl();
7380
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7381
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7382
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7383
- }
7384
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7385
- }
7386
- {
7387
- const annotation = new EAnnotationImpl();
7388
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7389
- {
7390
- const entry = new EStringToStringMapEntryImpl();
7391
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7392
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7393
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7394
- }
7395
- {
7396
- const entry = new EStringToStringMapEntryImpl();
7397
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7398
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7399
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7400
- }
7401
- this._EClass_eAllReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7402
- }
7403
7273
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllReferences);
7404
7274
  this._EClass_eReferences = new EReferenceImpl();
7405
7275
  this._EClass_eReferences.eBasicSetValue(Ids.ENamedElement.name, "eReferences");
@@ -7417,60 +7287,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7417
7287
  this._EClass_eReferences.setContainerClass(EClassImpl);
7418
7288
  this._EClass_eReferences.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7419
7289
  this._EClass_eReferences.eBasicSetValue(Ids.EReference.containment, false);
7420
- {
7421
- const annotation = new EAnnotationImpl();
7422
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7423
- {
7424
- const entry = new EStringToStringMapEntryImpl();
7425
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7426
- entry.eBasicSetValue(
7427
- Ids.EStringToStringMapEntry.value,
7428
- "return new BasicEList<EReference>(undefined, undefined, this.getEStructuralFeatures().filter(isEReference) as EReference[]);"
7429
- );
7430
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7431
- }
7432
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7433
- }
7434
- {
7435
- const annotation = new EAnnotationImpl();
7436
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7437
- {
7438
- const entry = new EStringToStringMapEntryImpl();
7439
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7440
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7441
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7442
- }
7443
- {
7444
- const entry = new EStringToStringMapEntryImpl();
7445
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7446
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7447
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7448
- }
7449
- {
7450
- const entry = new EStringToStringMapEntryImpl();
7451
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7452
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7453
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7454
- }
7455
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7456
- }
7457
- {
7458
- const annotation = new EAnnotationImpl();
7459
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7460
- {
7461
- const entry = new EStringToStringMapEntryImpl();
7462
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7463
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7464
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7465
- }
7466
- {
7467
- const entry = new EStringToStringMapEntryImpl();
7468
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7469
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7470
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7471
- }
7472
- this._EClass_eReferences.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7473
- }
7474
7290
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eReferences);
7475
7291
  this._EClass_eAttributes = new EReferenceImpl();
7476
7292
  this._EClass_eAttributes.eBasicSetValue(Ids.ENamedElement.name, "eAttributes");
@@ -7488,60 +7304,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7488
7304
  this._EClass_eAttributes.setContainerClass(EClassImpl);
7489
7305
  this._EClass_eAttributes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7490
7306
  this._EClass_eAttributes.eBasicSetValue(Ids.EReference.containment, false);
7491
- {
7492
- const annotation = new EAnnotationImpl();
7493
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7494
- {
7495
- const entry = new EStringToStringMapEntryImpl();
7496
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7497
- entry.eBasicSetValue(
7498
- Ids.EStringToStringMapEntry.value,
7499
- "return new BasicEList<EAttribute>(undefined, undefined, this.getEStructuralFeatures().filter(isEAttribute) as EAttribute[]);"
7500
- );
7501
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7502
- }
7503
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7504
- }
7505
- {
7506
- const annotation = new EAnnotationImpl();
7507
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7508
- {
7509
- const entry = new EStringToStringMapEntryImpl();
7510
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7511
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7512
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7513
- }
7514
- {
7515
- const entry = new EStringToStringMapEntryImpl();
7516
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7517
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7518
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7519
- }
7520
- {
7521
- const entry = new EStringToStringMapEntryImpl();
7522
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7523
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7524
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7525
- }
7526
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7527
- }
7528
- {
7529
- const annotation = new EAnnotationImpl();
7530
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7531
- {
7532
- const entry = new EStringToStringMapEntryImpl();
7533
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7534
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEAttribute");
7535
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7536
- }
7537
- {
7538
- const entry = new EStringToStringMapEntryImpl();
7539
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7540
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7541
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7542
- }
7543
- this._EClass_eAttributes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7544
- }
7545
7307
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAttributes);
7546
7308
  this._EClass_eAllContainments = new EReferenceImpl();
7547
7309
  this._EClass_eAllContainments.eBasicSetValue(Ids.ENamedElement.name, "eAllContainments");
@@ -7559,60 +7321,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7559
7321
  this._EClass_eAllContainments.setContainerClass(EClassImpl);
7560
7322
  this._EClass_eAllContainments.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7561
7323
  this._EClass_eAllContainments.eBasicSetValue(Ids.EReference.containment, false);
7562
- {
7563
- const annotation = new EAnnotationImpl();
7564
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7565
- {
7566
- const entry = new EStringToStringMapEntryImpl();
7567
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7568
- entry.eBasicSetValue(
7569
- Ids.EStringToStringMapEntry.value,
7570
- "const references = this.getEAllStructuralFeatures().filter(isEReference) as EReference[];\nreturn new BasicEList<EReference>(undefined, undefined, references.filter(reference => reference.isContainment()));"
7571
- );
7572
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7573
- }
7574
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7575
- }
7576
- {
7577
- const annotation = new EAnnotationImpl();
7578
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7579
- {
7580
- const entry = new EStringToStringMapEntryImpl();
7581
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7582
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7583
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7584
- }
7585
- {
7586
- const entry = new EStringToStringMapEntryImpl();
7587
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7588
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7589
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7590
- }
7591
- {
7592
- const entry = new EStringToStringMapEntryImpl();
7593
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7594
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7595
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7596
- }
7597
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7598
- }
7599
- {
7600
- const annotation = new EAnnotationImpl();
7601
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7602
- {
7603
- const entry = new EStringToStringMapEntryImpl();
7604
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7605
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEReference");
7606
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7607
- }
7608
- {
7609
- const entry = new EStringToStringMapEntryImpl();
7610
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7611
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7612
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7613
- }
7614
- this._EClass_eAllContainments.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7615
- }
7616
7324
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllContainments);
7617
7325
  this._EClass_eAllOperations = new EReferenceImpl();
7618
7326
  this._EClass_eAllOperations.eBasicSetValue(Ids.ENamedElement.name, "eAllOperations");
@@ -7630,60 +7338,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7630
7338
  this._EClass_eAllOperations.setContainerClass(EClassImpl);
7631
7339
  this._EClass_eAllOperations.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7632
7340
  this._EClass_eAllOperations.eBasicSetValue(Ids.EReference.containment, false);
7633
- {
7634
- const annotation = new EAnnotationImpl();
7635
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7636
- {
7637
- const entry = new EStringToStringMapEntryImpl();
7638
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7639
- entry.eBasicSetValue(
7640
- Ids.EStringToStringMapEntry.value,
7641
- "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);"
7642
- );
7643
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7644
- }
7645
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7646
- }
7647
- {
7648
- const annotation = new EAnnotationImpl();
7649
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7650
- {
7651
- const entry = new EStringToStringMapEntryImpl();
7652
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7653
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7654
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7655
- }
7656
- {
7657
- const entry = new EStringToStringMapEntryImpl();
7658
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7659
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7660
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7661
- }
7662
- {
7663
- const entry = new EStringToStringMapEntryImpl();
7664
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7665
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7666
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7667
- }
7668
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7669
- }
7670
- {
7671
- const annotation = new EAnnotationImpl();
7672
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7673
- {
7674
- const entry = new EStringToStringMapEntryImpl();
7675
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7676
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7677
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7678
- }
7679
- {
7680
- const entry = new EStringToStringMapEntryImpl();
7681
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7682
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7683
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7684
- }
7685
- this._EClass_eAllOperations.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7686
- }
7687
7341
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllOperations);
7688
7342
  this._EClass_eAllStructuralFeatures = new EReferenceImpl();
7689
7343
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.ENamedElement.name, "eAllStructuralFeatures");
@@ -7701,60 +7355,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7701
7355
  this._EClass_eAllStructuralFeatures.setContainerClass(EClassImpl);
7702
7356
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7703
7357
  this._EClass_eAllStructuralFeatures.eBasicSetValue(Ids.EReference.containment, false);
7704
- {
7705
- const annotation = new EAnnotationImpl();
7706
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7707
- {
7708
- const entry = new EStringToStringMapEntryImpl();
7709
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7710
- entry.eBasicSetValue(
7711
- Ids.EStringToStringMapEntry.value,
7712
- "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);"
7713
- );
7714
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7715
- }
7716
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7717
- }
7718
- {
7719
- const annotation = new EAnnotationImpl();
7720
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7721
- {
7722
- const entry = new EStringToStringMapEntryImpl();
7723
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7724
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7725
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7726
- }
7727
- {
7728
- const entry = new EStringToStringMapEntryImpl();
7729
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7730
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7731
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7732
- }
7733
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7734
- }
7735
- {
7736
- const annotation = new EAnnotationImpl();
7737
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7738
- {
7739
- const entry = new EStringToStringMapEntryImpl();
7740
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7741
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7742
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7743
- }
7744
- {
7745
- const entry = new EStringToStringMapEntryImpl();
7746
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7747
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7748
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7749
- }
7750
- {
7751
- const entry = new EStringToStringMapEntryImpl();
7752
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7753
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7754
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7755
- }
7756
- this._EClass_eAllStructuralFeatures.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7757
- }
7758
7358
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllStructuralFeatures);
7759
7359
  this._EClass_eAllSuperTypes = new EReferenceImpl();
7760
7360
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.ENamedElement.name, "eAllSuperTypes");
@@ -7772,60 +7372,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7772
7372
  this._EClass_eAllSuperTypes.setContainerClass(EClassImpl);
7773
7373
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7774
7374
  this._EClass_eAllSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
7775
- {
7776
- const annotation = new EAnnotationImpl();
7777
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7778
- {
7779
- const entry = new EStringToStringMapEntryImpl();
7780
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7781
- entry.eBasicSetValue(
7782
- Ids.EStringToStringMapEntry.value,
7783
- "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);"
7784
- );
7785
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7786
- }
7787
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7788
- }
7789
- {
7790
- const annotation = new EAnnotationImpl();
7791
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7792
- {
7793
- const entry = new EStringToStringMapEntryImpl();
7794
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7795
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7796
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7797
- }
7798
- {
7799
- const entry = new EStringToStringMapEntryImpl();
7800
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7801
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7802
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7803
- }
7804
- {
7805
- const entry = new EStringToStringMapEntryImpl();
7806
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7807
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7808
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7809
- }
7810
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7811
- }
7812
- {
7813
- const annotation = new EAnnotationImpl();
7814
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7815
- {
7816
- const entry = new EStringToStringMapEntryImpl();
7817
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7818
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7819
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7820
- }
7821
- {
7822
- const entry = new EStringToStringMapEntryImpl();
7823
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7824
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7825
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7826
- }
7827
- this._EClass_eAllSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7828
- }
7829
7375
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllSuperTypes);
7830
7376
  this._EClass_eIDAttribute = new EReferenceImpl();
7831
7377
  this._EClass_eIDAttribute.eBasicSetValue(Ids.ENamedElement.name, "eIDAttribute");
@@ -7843,17 +7389,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7843
7389
  this._EClass_eIDAttribute.setContainerClass(EClassImpl);
7844
7390
  this._EClass_eIDAttribute.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7845
7391
  this._EClass_eIDAttribute.eBasicSetValue(Ids.EReference.containment, false);
7846
- {
7847
- const annotation = new EAnnotationImpl();
7848
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7849
- {
7850
- const entry = new EStringToStringMapEntryImpl();
7851
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7852
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllAttributes().find(a => a.isID());");
7853
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7854
- }
7855
- this._EClass_eIDAttribute.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7856
- }
7857
7392
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eIDAttribute);
7858
7393
  this._EClass_eStructuralFeatures = new EReferenceImpl();
7859
7394
  this._EClass_eStructuralFeatures.eBasicSetValue(Ids.ENamedElement.name, "eStructuralFeatures");
@@ -7888,23 +7423,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7888
7423
  this._EClass_eGenericSuperTypes.setContainerClass(EClassImpl);
7889
7424
  this._EClass_eGenericSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7890
7425
  this._EClass_eGenericSuperTypes.eBasicSetValue(Ids.EReference.containment, true);
7891
- {
7892
- const annotation = new EAnnotationImpl();
7893
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
7894
- {
7895
- const entry = new EStringToStringMapEntryImpl();
7896
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
7897
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7898
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7899
- }
7900
- {
7901
- const entry = new EStringToStringMapEntryImpl();
7902
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
7903
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
7904
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7905
- }
7906
- this._EClass_eGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7907
- }
7908
7426
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eGenericSuperTypes);
7909
7427
  this._EClass_eAllGenericSuperTypes = new EReferenceImpl();
7910
7428
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.ENamedElement.name, "eAllGenericSuperTypes");
@@ -7922,83 +7440,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
7922
7440
  this._EClass_eAllGenericSuperTypes.setContainerClass(EClassImpl);
7923
7441
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClass);
7924
7442
  this._EClass_eAllGenericSuperTypes.eBasicSetValue(Ids.EReference.containment, false);
7925
- {
7926
- const annotation = new EAnnotationImpl();
7927
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
7928
- {
7929
- const entry = new EStringToStringMapEntryImpl();
7930
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
7931
- entry.eBasicSetValue(
7932
- Ids.EStringToStringMapEntry.value,
7933
- "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);"
7934
- );
7935
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7936
- }
7937
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7938
- }
7939
- {
7940
- const annotation = new EAnnotationImpl();
7941
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7942
- {
7943
- const entry = new EStringToStringMapEntryImpl();
7944
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7945
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "BasicEList");
7946
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7947
- }
7948
- {
7949
- const entry = new EStringToStringMapEntryImpl();
7950
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7951
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7952
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7953
- }
7954
- {
7955
- const entry = new EStringToStringMapEntryImpl();
7956
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7957
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/BasicEList.js");
7958
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7959
- }
7960
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7961
- }
7962
- {
7963
- const annotation = new EAnnotationImpl();
7964
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7965
- {
7966
- const entry = new EStringToStringMapEntryImpl();
7967
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7968
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
7969
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7970
- }
7971
- {
7972
- const entry = new EStringToStringMapEntryImpl();
7973
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7974
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
7975
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7976
- }
7977
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
7978
- }
7979
- {
7980
- const annotation = new EAnnotationImpl();
7981
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
7982
- {
7983
- const entry = new EStringToStringMapEntryImpl();
7984
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
7985
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EGenericTypeImpl");
7986
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7987
- }
7988
- {
7989
- const entry = new EStringToStringMapEntryImpl();
7990
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
7991
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
7992
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7993
- }
7994
- {
7995
- const entry = new EStringToStringMapEntryImpl();
7996
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
7997
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EGenericTypeImpl.js");
7998
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
7999
- }
8000
- this._EClass_eAllGenericSuperTypes.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8001
- }
8002
7443
  this._EClass.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClass_eAllGenericSuperTypes);
8003
7444
  this._EClassifier_instanceClassName = new EAttributeImpl();
8004
7445
  this._EClassifier_instanceClassName.eBasicSetValue(Ids.ENamedElement.name, "instanceClassName");
@@ -8015,23 +7456,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8015
7456
  this._EClassifier_instanceClassName.setFeatureID(Ids.EClassifier.instanceClassName);
8016
7457
  this._EClassifier_instanceClassName.setContainerClass(EClassifierImpl);
8017
7458
  this._EClassifier_instanceClassName.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClassifier);
8018
- {
8019
- const annotation = new EAnnotationImpl();
8020
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8021
- {
8022
- const entry = new EStringToStringMapEntryImpl();
8023
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8024
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8025
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8026
- }
8027
- {
8028
- const entry = new EStringToStringMapEntryImpl();
8029
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8030
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8031
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8032
- }
8033
- this._EClassifier_instanceClassName.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8034
- }
8035
7459
  this._EClassifier.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClassifier_instanceClassName);
8036
7460
  this._EClassifier_instanceClass = new EAttributeImpl();
8037
7461
  this._EClassifier_instanceClass.eBasicSetValue(Ids.ENamedElement.name, "instanceClass");
@@ -8080,23 +7504,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8080
7504
  this._EClassifier_instanceTypeName.setFeatureID(Ids.EClassifier.instanceTypeName);
8081
7505
  this._EClassifier_instanceTypeName.setContainerClass(EClassifierImpl);
8082
7506
  this._EClassifier_instanceTypeName.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EClassifier);
8083
- {
8084
- const annotation = new EAnnotationImpl();
8085
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8086
- {
8087
- const entry = new EStringToStringMapEntryImpl();
8088
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8089
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8090
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8091
- }
8092
- {
8093
- const entry = new EStringToStringMapEntryImpl();
8094
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8095
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8096
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8097
- }
8098
- this._EClassifier_instanceTypeName.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8099
- }
8100
7507
  this._EClassifier.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EClassifier_instanceTypeName);
8101
7508
  this._EClassifier_ePackage = new EReferenceImpl();
8102
7509
  this._EClassifier_ePackage.eBasicSetValue(Ids.ENamedElement.name, "ePackage");
@@ -8144,6 +7551,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8144
7551
  this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8145
7552
  this._EDataType_serializable.eBasicSetValue(Ids.ETypedElement.ordered, true);
8146
7553
  this._EDataType_serializable.eBasicSetValue(Ids.ETypedElement.unique, true);
7554
+ this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8147
7555
  this._EDataType_serializable.setFeatureID(Ids.EDataType.serializable);
8148
7556
  this._EDataType_serializable.setContainerClass(EDataTypeImpl);
8149
7557
  this._EDataType_serializable.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EDataType);
@@ -8212,26 +7620,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8212
7620
  this._EEnumLiteral_literal.setFeatureID(Ids.EEnumLiteral.literal);
8213
7621
  this._EEnumLiteral_literal.setContainerClass(EEnumLiteralImpl);
8214
7622
  this._EEnumLiteral_literal.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EEnumLiteral);
8215
- {
8216
- const annotation = new EAnnotationImpl();
8217
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8218
- {
8219
- const entry = new EStringToStringMapEntryImpl();
8220
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
8221
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this._literal ?? this.getName();");
8222
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8223
- }
8224
- {
8225
- const entry = new EStringToStringMapEntryImpl();
8226
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
8227
- entry.eBasicSetValue(
8228
- Ids.EStringToStringMapEntry.value,
8229
- "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 });"
8230
- );
8231
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8232
- }
8233
- this._EEnumLiteral_literal.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8234
- }
8235
7623
  this._EEnumLiteral.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EEnumLiteral_literal);
8236
7624
  this._EEnumLiteral_eEnum = new EReferenceImpl();
8237
7625
  this._EEnumLiteral_eEnum.eBasicSetValue(Ids.ENamedElement.name, "eEnum");
@@ -8367,23 +7755,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8367
7755
  this._EOperation_eExceptions.setContainerClass(EOperationImpl);
8368
7756
  this._EOperation_eExceptions.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EOperation);
8369
7757
  this._EOperation_eExceptions.eBasicSetValue(Ids.EReference.containment, false);
8370
- {
8371
- const annotation = new EAnnotationImpl();
8372
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8373
- {
8374
- const entry = new EStringToStringMapEntryImpl();
8375
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8376
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8377
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8378
- }
8379
- {
8380
- const entry = new EStringToStringMapEntryImpl();
8381
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8382
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8383
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8384
- }
8385
- this._EOperation_eExceptions.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8386
- }
8387
7758
  this._EOperation.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EOperation_eExceptions);
8388
7759
  this._EOperation_eGenericExceptions = new EReferenceImpl();
8389
7760
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.ENamedElement.name, "eGenericExceptions");
@@ -8401,23 +7772,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8401
7772
  this._EOperation_eGenericExceptions.setContainerClass(EOperationImpl);
8402
7773
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EOperation);
8403
7774
  this._EOperation_eGenericExceptions.eBasicSetValue(Ids.EReference.containment, true);
8404
- {
8405
- const annotation = new EAnnotationImpl();
8406
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8407
- {
8408
- const entry = new EStringToStringMapEntryImpl();
8409
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8410
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8411
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8412
- }
8413
- {
8414
- const entry = new EStringToStringMapEntryImpl();
8415
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8416
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8417
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8418
- }
8419
- this._EOperation_eGenericExceptions.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8420
- }
8421
7775
  this._EOperation.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EOperation_eGenericExceptions);
8422
7776
  this._EPackage_nsURI = new EAttributeImpl();
8423
7777
  this._EPackage_nsURI.eBasicSetValue(Ids.ENamedElement.name, "nsURI");
@@ -8580,6 +7934,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8580
7934
  this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8581
7935
  this._EReference_resolveProxies.eBasicSetValue(Ids.ETypedElement.ordered, true);
8582
7936
  this._EReference_resolveProxies.eBasicSetValue(Ids.ETypedElement.unique, true);
7937
+ this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8583
7938
  this._EReference_resolveProxies.setFeatureID(Ids.EReference.resolveProxies);
8584
7939
  this._EReference_resolveProxies.setContainerClass(EReferenceImpl);
8585
7940
  this._EReference_resolveProxies.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EReference);
@@ -8647,6 +8002,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8647
8002
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8648
8003
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.ETypedElement.ordered, true);
8649
8004
  this._EStructuralFeature_changeable.eBasicSetValue(Ids.ETypedElement.unique, true);
8005
+ this._EStructuralFeature_changeable.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8650
8006
  this._EStructuralFeature_changeable.setFeatureID(Ids.EStructuralFeature.changeable);
8651
8007
  this._EStructuralFeature_changeable.setContainerClass(EStructuralFeatureImpl);
8652
8008
  this._EStructuralFeature_changeable.eBasicSetValue(
@@ -8794,6 +8150,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8794
8150
  this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8795
8151
  this._ETypedElement_ordered.eBasicSetValue(Ids.ETypedElement.ordered, true);
8796
8152
  this._ETypedElement_ordered.eBasicSetValue(Ids.ETypedElement.unique, true);
8153
+ this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8797
8154
  this._ETypedElement_ordered.setFeatureID(Ids.ETypedElement.ordered);
8798
8155
  this._ETypedElement_ordered.setContainerClass(ETypedElementImpl);
8799
8156
  this._ETypedElement_ordered.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8810,6 +8167,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8810
8167
  this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8811
8168
  this._ETypedElement_unique.eBasicSetValue(Ids.ETypedElement.ordered, true);
8812
8169
  this._ETypedElement_unique.eBasicSetValue(Ids.ETypedElement.unique, true);
8170
+ this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "true");
8813
8171
  this._ETypedElement_unique.setFeatureID(Ids.ETypedElement.unique);
8814
8172
  this._ETypedElement_unique.setContainerClass(ETypedElementImpl);
8815
8173
  this._ETypedElement_unique.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8842,6 +8200,7 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8842
8200
  this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.changeable, true);
8843
8201
  this._ETypedElement_upperBound.eBasicSetValue(Ids.ETypedElement.ordered, true);
8844
8202
  this._ETypedElement_upperBound.eBasicSetValue(Ids.ETypedElement.unique, true);
8203
+ this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.defaultValueLiteral, "1");
8845
8204
  this._ETypedElement_upperBound.setFeatureID(Ids.ETypedElement.upperBound);
8846
8205
  this._ETypedElement_upperBound.setContainerClass(ETypedElementImpl);
8847
8206
  this._ETypedElement_upperBound.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
@@ -8894,37 +8253,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8894
8253
  this._ETypedElement_eType.setContainerClass(ETypedElementImpl);
8895
8254
  this._ETypedElement_eType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
8896
8255
  this._ETypedElement_eType.eBasicSetValue(Ids.EReference.containment, false);
8897
- {
8898
- const annotation = new EAnnotationImpl();
8899
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8900
- {
8901
- const entry = new EStringToStringMapEntryImpl();
8902
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8903
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8904
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8905
- }
8906
- {
8907
- const entry = new EStringToStringMapEntryImpl();
8908
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8909
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8910
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8911
- }
8912
- this._ETypedElement_eType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8913
- }
8914
- {
8915
- const annotation = new EAnnotationImpl();
8916
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8917
- {
8918
- const entry = new EStringToStringMapEntryImpl();
8919
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
8920
- entry.eBasicSetValue(
8921
- Ids.EStringToStringMapEntry.value,
8922
- "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 });"
8923
- );
8924
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8925
- }
8926
- this._ETypedElement_eType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8927
- }
8928
8256
  this._ETypedElement.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._ETypedElement_eType);
8929
8257
  this._ETypedElement_eGenericType = new EReferenceImpl();
8930
8258
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.ENamedElement.name, "eGenericType");
@@ -8942,37 +8270,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
8942
8270
  this._ETypedElement_eGenericType.setContainerClass(ETypedElementImpl);
8943
8271
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._ETypedElement);
8944
8272
  this._ETypedElement_eGenericType.eBasicSetValue(Ids.EReference.containment, true);
8945
- {
8946
- const annotation = new EAnnotationImpl();
8947
- annotation.eBasicSetValue(Ids.EAnnotation.source, "http://www.eclipse.org/emf/2002/GenModel");
8948
- {
8949
- const entry = new EStringToStringMapEntryImpl();
8950
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedIsSetVisibility");
8951
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8952
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8953
- }
8954
- {
8955
- const entry = new EStringToStringMapEntryImpl();
8956
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "suppressedUnsetVisibility");
8957
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "true");
8958
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8959
- }
8960
- this._ETypedElement_eGenericType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8961
- }
8962
- {
8963
- const annotation = new EAnnotationImpl();
8964
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
8965
- {
8966
- const entry = new EStringToStringMapEntryImpl();
8967
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "set");
8968
- entry.eBasicSetValue(
8969
- Ids.EStringToStringMapEntry.value,
8970
- "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 });"
8971
- );
8972
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
8973
- }
8974
- this._ETypedElement_eGenericType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
8975
- }
8976
8273
  this._ETypedElement.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._ETypedElement_eGenericType);
8977
8274
  this._EStringToStringMapEntry_key = new EAttributeImpl();
8978
8275
  this._EStringToStringMapEntry_key.eBasicSetValue(Ids.ENamedElement.name, "key");
@@ -9062,20 +8359,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9062
8359
  this._EGenericType_eRawType.setContainerClass(EGenericTypeImpl);
9063
8360
  this._EGenericType_eRawType.eBasicSetValue(Ids.EStructuralFeature.eContainingClass, this._EGenericType);
9064
8361
  this._EGenericType_eRawType.eBasicSetValue(Ids.EReference.containment, false);
9065
- {
9066
- const annotation = new EAnnotationImpl();
9067
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/feature");
9068
- {
9069
- const entry = new EStringToStringMapEntryImpl();
9070
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "get");
9071
- entry.eBasicSetValue(
9072
- Ids.EStringToStringMapEntry.value,
9073
- "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();"
9074
- );
9075
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9076
- }
9077
- this._EGenericType_eRawType.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9078
- }
9079
8362
  this._EGenericType.eBootstrapList(Ids.EClass.eStructuralFeatures).add(this._EGenericType_eRawType);
9080
8363
  this._EGenericType_eLowerBound = new EReferenceImpl();
9081
8364
  this._EGenericType_eLowerBound.eBasicSetValue(Ids.ENamedElement.name, "eLowerBound");
@@ -9157,54 +8440,12 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9157
8440
  this._EClass_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9158
8441
  this._EClass_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op0);
9159
8442
  this._EClass_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op0_p0);
9160
- {
9161
- const annotation = new EAnnotationImpl();
9162
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9163
- {
9164
- const entry = new EStringToStringMapEntryImpl();
9165
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9166
- entry.eBasicSetValue(
9167
- Ids.EStringToStringMapEntry.value,
9168
- "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;"
9169
- );
9170
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9171
- }
9172
- this._EClass_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9173
- }
9174
- {
9175
- const annotation = new EAnnotationImpl();
9176
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9177
- {
9178
- const entry = new EStringToStringMapEntryImpl();
9179
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9180
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "isEClass");
9181
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9182
- }
9183
- {
9184
- const entry = new EStringToStringMapEntryImpl();
9185
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9186
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./util/EcoreTypeGuards.js");
9187
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9188
- }
9189
- this._EClass_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9190
- }
9191
8443
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op0);
9192
8444
  this._EClass_op1 = new EOperationImpl();
9193
8445
  this._EClass_op1.eBasicSetValue(Ids.ENamedElement.name, "getFeatureCount");
9194
8446
  this._EClass_op1.eBasicSetValue(Ids.ETypedElement.eType, this._EInt);
9195
8447
  this._EClass_op1.eBasicSetValue(Ids.EOperation.eContainingClass, this._EClass);
9196
8448
  this._EClass_op1.setOperationID(Ids.EClass.op1);
9197
- {
9198
- const annotation = new EAnnotationImpl();
9199
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9200
- {
9201
- const entry = new EStringToStringMapEntryImpl();
9202
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9203
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllStructuralFeatures().size();");
9204
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9205
- }
9206
- this._EClass_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9207
- }
9208
8449
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op1);
9209
8450
  this._EClass_op2 = new EOperationImpl();
9210
8451
  this._EClass_op2.eBasicSetValue(Ids.ENamedElement.name, "getEStructuralFeature");
@@ -9215,23 +8456,9 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9215
8456
  this._EClass_op2_p0.eBasicSetValue(Ids.ENamedElement.name, "featureID");
9216
8457
  this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.eType, this._EInt);
9217
8458
  this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.lowerBound, 0);
9218
- this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9219
- this._EClass_op2_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op2);
9220
- this._EClass_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op2_p0);
9221
- {
9222
- const annotation = new EAnnotationImpl();
9223
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9224
- {
9225
- const entry = new EStringToStringMapEntryImpl();
9226
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9227
- entry.eBasicSetValue(
9228
- Ids.EStringToStringMapEntry.value,
9229
- "const features = this.getEAllStructuralFeatures(); return featureIDOrFeatureName >= 0 && featureIDOrFeatureName < features.size() ? features.get(featureIDOrFeatureName) : undefined;"
9230
- );
9231
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9232
- }
9233
- this._EClass_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9234
- }
8459
+ this._EClass_op2_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
8460
+ this._EClass_op2_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op2);
8461
+ this._EClass_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op2_p0);
9235
8462
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op2);
9236
8463
  this._EClass_op3 = new EOperationImpl();
9237
8464
  this._EClass_op3.eBasicSetValue(Ids.ENamedElement.name, "getFeatureID");
@@ -9245,20 +8472,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9245
8472
  this._EClass_op3_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9246
8473
  this._EClass_op3_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op3);
9247
8474
  this._EClass_op3.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op3_p0);
9248
- {
9249
- const annotation = new EAnnotationImpl();
9250
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9251
- {
9252
- const entry = new EStringToStringMapEntryImpl();
9253
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9254
- entry.eBasicSetValue(
9255
- Ids.EStringToStringMapEntry.value,
9256
- "return this.getEAllStructuralFeatures().indexOf(feature);"
9257
- );
9258
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9259
- }
9260
- this._EClass_op3.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9261
- }
9262
8475
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op3);
9263
8476
  this._EClass_op4 = new EOperationImpl();
9264
8477
  this._EClass_op4.eBasicSetValue(Ids.ENamedElement.name, "getEStructuralFeature");
@@ -9272,37 +8485,12 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9272
8485
  this._EClass_op4_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9273
8486
  this._EClass_op4_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op4);
9274
8487
  this._EClass_op4.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op4_p0);
9275
- {
9276
- const annotation = new EAnnotationImpl();
9277
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9278
- {
9279
- const entry = new EStringToStringMapEntryImpl();
9280
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9281
- entry.eBasicSetValue(
9282
- Ids.EStringToStringMapEntry.value,
9283
- "return this.getEAllStructuralFeatures().filter(feature => feature.getName() === featureIDOrFeatureName).at(0);"
9284
- );
9285
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9286
- }
9287
- this._EClass_op4.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9288
- }
9289
8488
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op4);
9290
8489
  this._EClass_op5 = new EOperationImpl();
9291
8490
  this._EClass_op5.eBasicSetValue(Ids.ENamedElement.name, "getOperationCount");
9292
8491
  this._EClass_op5.eBasicSetValue(Ids.ETypedElement.eType, this._EInt);
9293
8492
  this._EClass_op5.eBasicSetValue(Ids.EOperation.eContainingClass, this._EClass);
9294
8493
  this._EClass_op5.setOperationID(Ids.EClass.op5);
9295
- {
9296
- const annotation = new EAnnotationImpl();
9297
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9298
- {
9299
- const entry = new EStringToStringMapEntryImpl();
9300
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9301
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "return this.getEAllOperations().size();");
9302
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9303
- }
9304
- this._EClass_op5.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9305
- }
9306
8494
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op5);
9307
8495
  this._EClass_op6 = new EOperationImpl();
9308
8496
  this._EClass_op6.eBasicSetValue(Ids.ENamedElement.name, "getEOperation");
@@ -9316,20 +8504,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9316
8504
  this._EClass_op6_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9317
8505
  this._EClass_op6_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op6);
9318
8506
  this._EClass_op6.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op6_p0);
9319
- {
9320
- const annotation = new EAnnotationImpl();
9321
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9322
- {
9323
- const entry = new EStringToStringMapEntryImpl();
9324
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9325
- entry.eBasicSetValue(
9326
- Ids.EStringToStringMapEntry.value,
9327
- "return this.getEAllOperations().filter(op => this.getOperationID(op) === operationID).at(0);"
9328
- );
9329
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9330
- }
9331
- this._EClass_op6.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9332
- }
9333
8507
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op6);
9334
8508
  this._EClass_op7 = new EOperationImpl();
9335
8509
  this._EClass_op7.eBasicSetValue(Ids.ENamedElement.name, "getOperationID");
@@ -9343,43 +8517,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9343
8517
  this._EClass_op7_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9344
8518
  this._EClass_op7_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op7);
9345
8519
  this._EClass_op7.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op7_p0);
9346
- {
9347
- const annotation = new EAnnotationImpl();
9348
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9349
- {
9350
- const entry = new EStringToStringMapEntryImpl();
9351
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9352
- entry.eBasicSetValue(
9353
- Ids.EStringToStringMapEntry.value,
9354
- "return (operation as EOperationImpl).getOperationID();"
9355
- );
9356
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9357
- }
9358
- this._EClass_op7.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9359
- }
9360
- {
9361
- const annotation = new EAnnotationImpl();
9362
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9363
- {
9364
- const entry = new EStringToStringMapEntryImpl();
9365
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9366
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EOperationImpl");
9367
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9368
- }
9369
- {
9370
- const entry = new EStringToStringMapEntryImpl();
9371
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9372
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9373
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9374
- }
9375
- {
9376
- const entry = new EStringToStringMapEntryImpl();
9377
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9378
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EOperationImpl");
9379
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9380
- }
9381
- this._EClass_op7.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9382
- }
9383
8520
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op7);
9384
8521
  this._EClass_op8 = new EOperationImpl();
9385
8522
  this._EClass_op8.eBasicSetValue(Ids.ENamedElement.name, "getOverride");
@@ -9393,20 +8530,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9393
8530
  this._EClass_op8_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9394
8531
  this._EClass_op8_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClass_op8);
9395
8532
  this._EClass_op8.eBootstrapList(Ids.EOperation.eParameters).add(this._EClass_op8_p0);
9396
- {
9397
- const annotation = new EAnnotationImpl();
9398
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9399
- {
9400
- const entry = new EStringToStringMapEntryImpl();
9401
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9402
- entry.eBasicSetValue(
9403
- Ids.EStringToStringMapEntry.value,
9404
- "if (operation.getEContainingClass() === this) return undefined;\nfor (const candidate of this.getEAllOperations()) {\n if (candidate.isOverrideOf(operation)) return candidate;\n}\nreturn undefined;"
9405
- );
9406
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9407
- }
9408
- this._EClass_op8.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9409
- }
9410
8533
  this._EClass.eBootstrapList(Ids.EClass.eOperations).add(this._EClass_op8);
9411
8534
  this._EClassifier_op0 = new EOperationImpl();
9412
8535
  this._EClassifier_op0.eBasicSetValue(Ids.ENamedElement.name, "isInstance");
@@ -9420,66 +8543,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9420
8543
  this._EClassifier_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9421
8544
  this._EClassifier_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EClassifier_op0);
9422
8545
  this._EClassifier_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EClassifier_op0_p0);
9423
- {
9424
- const annotation = new EAnnotationImpl();
9425
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9426
- {
9427
- const entry = new EStringToStringMapEntryImpl();
9428
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9429
- entry.eBasicSetValue(
9430
- Ids.EStringToStringMapEntry.value,
9431
- "switch (this.eClass().getName()) {\n case 'EClass':\n return object instanceof EObjectImpl && (this as unknown as EClass).isSuperTypeOf((object as EObject).eClass());\n default:\n switch (this.getName()) {\n case 'EString':\n case 'EChar':\n case 'ECharacterObject':\n return typeof object === 'string';\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 typeof object === 'number';\n case 'EBigInteger':\n return typeof object === 'bigint';\n case 'EBoolean':\n case 'EBooleanObject':\n return typeof object === 'boolean';\n case 'EDate':\n return object instanceof Date;\n default:\n return object !== undefined && object !== null;\n }\n}"
9432
- );
9433
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9434
- }
9435
- this._EClassifier_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9436
- }
9437
- {
9438
- const annotation = new EAnnotationImpl();
9439
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9440
- {
9441
- const entry = new EStringToStringMapEntryImpl();
9442
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9443
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EObjectImpl");
9444
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9445
- }
9446
- {
9447
- const entry = new EStringToStringMapEntryImpl();
9448
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9449
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9450
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9451
- }
9452
- {
9453
- const entry = new EStringToStringMapEntryImpl();
9454
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9455
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/EObjectImpl");
9456
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9457
- }
9458
- this._EClassifier_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9459
- }
9460
- {
9461
- const annotation = new EAnnotationImpl();
9462
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9463
- {
9464
- const entry = new EStringToStringMapEntryImpl();
9465
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9466
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "EObject");
9467
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9468
- }
9469
- {
9470
- const entry = new EStringToStringMapEntryImpl();
9471
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9472
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9473
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9474
- }
9475
- {
9476
- const entry = new EStringToStringMapEntryImpl();
9477
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9478
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./types/EObject");
9479
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9480
- }
9481
- this._EClassifier_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9482
- }
9483
8546
  this._EClassifier.eBootstrapList(Ids.EClass.eOperations).add(this._EClassifier_op0);
9484
8547
  this._EClassifier_op1 = new EOperationImpl();
9485
8548
  this._EClassifier_op1.eBasicSetValue(Ids.ENamedElement.name, "getClassifierID");
@@ -9499,20 +8562,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9499
8562
  this._EEnum_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9500
8563
  this._EEnum_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op0);
9501
8564
  this._EEnum_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op0_p0);
9502
- {
9503
- const annotation = new EAnnotationImpl();
9504
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9505
- {
9506
- const entry = new EStringToStringMapEntryImpl();
9507
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9508
- entry.eBasicSetValue(
9509
- Ids.EStringToStringMapEntry.value,
9510
- "return this.getELiterals().find(literal => literal.getName() === name);"
9511
- );
9512
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9513
- }
9514
- this._EEnum_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9515
- }
9516
8565
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op0);
9517
8566
  this._EEnum_op1 = new EOperationImpl();
9518
8567
  this._EEnum_op1.eBasicSetValue(Ids.ENamedElement.name, "getEEnumLiteral");
@@ -9526,20 +8575,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9526
8575
  this._EEnum_op1_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9527
8576
  this._EEnum_op1_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op1);
9528
8577
  this._EEnum_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op1_p0);
9529
- {
9530
- const annotation = new EAnnotationImpl();
9531
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9532
- {
9533
- const entry = new EStringToStringMapEntryImpl();
9534
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9535
- entry.eBasicSetValue(
9536
- Ids.EStringToStringMapEntry.value,
9537
- "return this.getELiterals().find(literal => literal.getValue() === value);"
9538
- );
9539
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9540
- }
9541
- this._EEnum_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9542
- }
9543
8578
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op1);
9544
8579
  this._EEnum_op2 = new EOperationImpl();
9545
8580
  this._EEnum_op2.eBasicSetValue(Ids.ENamedElement.name, "getEEnumLiteralByLiteral");
@@ -9553,20 +8588,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9553
8588
  this._EEnum_op2_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9554
8589
  this._EEnum_op2_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EEnum_op2);
9555
8590
  this._EEnum_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EEnum_op2_p0);
9556
- {
9557
- const annotation = new EAnnotationImpl();
9558
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9559
- {
9560
- const entry = new EStringToStringMapEntryImpl();
9561
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9562
- entry.eBasicSetValue(
9563
- Ids.EStringToStringMapEntry.value,
9564
- "return this.getELiterals().find(candidate => candidate.getLiteral() === literal);"
9565
- );
9566
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9567
- }
9568
- this._EEnum_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9569
- }
9570
8591
  this._EEnum.eBootstrapList(Ids.EClass.eOperations).add(this._EEnum_op2);
9571
8592
  this._EFactory_op0 = new EOperationImpl();
9572
8593
  this._EFactory_op0.eBasicSetValue(Ids.ENamedElement.name, "create");
@@ -9579,43 +8600,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9579
8600
  this._EFactory_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9580
8601
  this._EFactory_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op0);
9581
8602
  this._EFactory_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op0_p0);
9582
- {
9583
- const annotation = new EAnnotationImpl();
9584
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9585
- {
9586
- const entry = new EStringToStringMapEntryImpl();
9587
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9588
- entry.eBasicSetValue(
9589
- Ids.EStringToStringMapEntry.value,
9590
- "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);"
9591
- );
9592
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9593
- }
9594
- this._EFactory_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9595
- }
9596
- {
9597
- const annotation = new EAnnotationImpl();
9598
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator/import");
9599
- {
9600
- const entry = new EStringToStringMapEntryImpl();
9601
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "type");
9602
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "DynamicEObjectImpl");
9603
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9604
- }
9605
- {
9606
- const entry = new EStringToStringMapEntryImpl();
9607
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "from");
9608
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "@typemf/core");
9609
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9610
- }
9611
- {
9612
- const entry = new EStringToStringMapEntryImpl();
9613
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "internal-from");
9614
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.value, "./impl/DynamicEObjectImpl.js");
9615
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9616
- }
9617
- this._EFactory_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9618
- }
9619
8603
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op0);
9620
8604
  this._EFactory_op1 = new EOperationImpl();
9621
8605
  this._EFactory_op1.eBasicSetValue(Ids.ENamedElement.name, "createFromString");
@@ -9636,20 +8620,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9636
8620
  this._EFactory_op1_p1.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9637
8621
  this._EFactory_op1_p1.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op1);
9638
8622
  this._EFactory_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op1_p1);
9639
- {
9640
- const annotation = new EAnnotationImpl();
9641
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9642
- {
9643
- const entry = new EStringToStringMapEntryImpl();
9644
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9645
- entry.eBasicSetValue(
9646
- Ids.EStringToStringMapEntry.value,
9647
- "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}"
9648
- );
9649
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9650
- }
9651
- this._EFactory_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9652
- }
9653
8623
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op1);
9654
8624
  this._EFactory_op2 = new EOperationImpl();
9655
8625
  this._EFactory_op2.eBasicSetValue(Ids.ENamedElement.name, "convertToString");
@@ -9670,20 +8640,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9670
8640
  this._EFactory_op2_p1.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9671
8641
  this._EFactory_op2_p1.eBasicSetValue(Ids.EParameter.eOperation, this._EFactory_op2);
9672
8642
  this._EFactory_op2.eBootstrapList(Ids.EOperation.eParameters).add(this._EFactory_op2_p1);
9673
- {
9674
- const annotation = new EAnnotationImpl();
9675
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9676
- {
9677
- const entry = new EStringToStringMapEntryImpl();
9678
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9679
- entry.eBasicSetValue(
9680
- Ids.EStringToStringMapEntry.value,
9681
- "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);"
9682
- );
9683
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9684
- }
9685
- this._EFactory_op2.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9686
- }
9687
8643
  this._EFactory.eBootstrapList(Ids.EClass.eOperations).add(this._EFactory_op2);
9688
8644
  this._EModelElement_op0 = new EOperationImpl();
9689
8645
  this._EModelElement_op0.eBasicSetValue(Ids.ENamedElement.name, "getEAnnotation");
@@ -9697,20 +8653,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9697
8653
  this._EModelElement_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9698
8654
  this._EModelElement_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EModelElement_op0);
9699
8655
  this._EModelElement_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EModelElement_op0_p0);
9700
- {
9701
- const annotation = new EAnnotationImpl();
9702
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9703
- {
9704
- const entry = new EStringToStringMapEntryImpl();
9705
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9706
- entry.eBasicSetValue(
9707
- Ids.EStringToStringMapEntry.value,
9708
- "return this.getEAnnotations().filter(ann => ann.getSource() === source).at(0);"
9709
- );
9710
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9711
- }
9712
- this._EModelElement_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9713
- }
9714
8656
  this._EModelElement.eBootstrapList(Ids.EClass.eOperations).add(this._EModelElement_op0);
9715
8657
  this._EOperation_op0 = new EOperationImpl();
9716
8658
  this._EOperation_op0.eBasicSetValue(Ids.ENamedElement.name, "getOperationID");
@@ -9730,20 +8672,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9730
8672
  this._EOperation_op1_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9731
8673
  this._EOperation_op1_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EOperation_op1);
9732
8674
  this._EOperation_op1.eBootstrapList(Ids.EOperation.eParameters).add(this._EOperation_op1_p0);
9733
- {
9734
- const annotation = new EAnnotationImpl();
9735
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9736
- {
9737
- const entry = new EStringToStringMapEntryImpl();
9738
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9739
- entry.eBasicSetValue(
9740
- Ids.EStringToStringMapEntry.value,
9741
- "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;"
9742
- );
9743
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9744
- }
9745
- this._EOperation_op1.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9746
- }
9747
8675
  this._EOperation.eBootstrapList(Ids.EClass.eOperations).add(this._EOperation_op1);
9748
8676
  this._EPackage_op0 = new EOperationImpl();
9749
8677
  this._EPackage_op0.eBasicSetValue(Ids.ENamedElement.name, "getEClassifier");
@@ -9757,20 +8685,6 @@ var EcorePackageImpl = class _EcorePackageImpl extends EPackageImpl {
9757
8685
  this._EPackage_op0_p0.eBasicSetValue(Ids.ETypedElement.upperBound, 1);
9758
8686
  this._EPackage_op0_p0.eBasicSetValue(Ids.EParameter.eOperation, this._EPackage_op0);
9759
8687
  this._EPackage_op0.eBootstrapList(Ids.EOperation.eParameters).add(this._EPackage_op0_p0);
9760
- {
9761
- const annotation = new EAnnotationImpl();
9762
- annotation.eBasicSetValue(Ids.EAnnotation.source, "https://typemf.dev/generator");
9763
- {
9764
- const entry = new EStringToStringMapEntryImpl();
9765
- entry.eBasicSetValue(Ids.EStringToStringMapEntry.key, "body");
9766
- entry.eBasicSetValue(
9767
- Ids.EStringToStringMapEntry.value,
9768
- "return this.getEClassifiers().filter(cl => cl.getName() === name).at(0);"
9769
- );
9770
- annotation.eBootstrapList(Ids.EAnnotation.details).add(entry);
9771
- }
9772
- this._EPackage_op0.eBootstrapList(Ids.EModelElement.eAnnotations).add(annotation);
9773
- }
9774
8688
  this._EPackage.eBootstrapList(Ids.EClass.eOperations).add(this._EPackage_op0);
9775
8689
  this._EStructuralFeature_op0 = new EOperationImpl();
9776
8690
  this._EStructuralFeature_op0.eBasicSetValue(Ids.ENamedElement.name, "getFeatureID");
@@ -10316,9 +9230,12 @@ registerEcorePackageInitializer(() => {
10316
9230
  ResourceImpl,
10317
9231
  ResourceSetImpl,
10318
9232
  URI,
9233
+ UnmodifiableEList,
10319
9234
  UriConverterRegistryImpl,
10320
9235
  associateRoot,
10321
9236
  computeFragment,
9237
+ convertToString,
9238
+ createFromString,
10322
9239
  createInstanceOf,
10323
9240
  createProxy,
10324
9241
  detailValue,