diff --git a/SysML2.NET.CodeGenerator.Tests/DataModelLoaderTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/DataModelLoaderTestFixture.cs deleted file mode 100644 index 95028c710..000000000 --- a/SysML2.NET.CodeGenerator.Tests/DataModelLoaderTestFixture.cs +++ /dev/null @@ -1,57 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests -{ - using System; - using System.Linq; - - using ECoreNetto; - - using NUnit.Framework; - - using SysML2.NET.CodeGenerator; - - /// - /// Suite of tests for the class. - /// - [TestFixture] - public class DataModelLoaderTestFixture - { - [Test] - public void Verify_that_the_expected_SysML2_model_is_returned() - { - var ePacakge = DataModelLoader.Load(); - - Assert.That(ePacakge, Is.Not.Null); - - var classes = ePacakge.EClassifiers.OfType(); - - var rootClass = classes.Single(x => x.ESuperTypes.Count == 0); - - Assert.That(rootClass.Name, Is.EqualTo("Element")); - - foreach (var eClass in classes) - { - Console.WriteLine(eClass.Name); - } - } - } -} \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/AnnotatingElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/AnnotatingElement.cs deleted file mode 100644 index 1c35b1dc0..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/AnnotatingElement.cs +++ /dev/null @@ -1,251 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An AnnotatingElement is an Element that provides additional description of or metadata on some other - /// Element. An AnnotatingElement is either attached to its annotatedElements by Annotation - /// Relationships, or it implicitly annotates its owningNamespace.annotatedElement = if - /// annotation->notEmpty() then annotation.annotatedElement else Sequence{owningNamespace} - /// endifownedAnnotatingRelationship = ownedRelationship-> selectByKind(Annotation)-> select(a | - /// a.annotatedElement <> self)annotation = if owningAnnotatingRelationship = null then - /// ownedAnnotatingRelationship else - /// owningAnnotatingRelationship->prepend(owningAnnotatingRelationship) endif - /// - public partial class AnnotatingElement : IAnnotatingElement - { - /// - /// Initializes a new instance of the class. - /// - public AnnotatingElement() - { - this.AliasIds = new List(); - this.IsImpliedIncluded = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property AnnotatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAnnotatedElement() - { - throw new NotImplementedException("Derived property AnnotatedElement not yet supported"); - } - - /// - /// Queries the derived property Annotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAnnotation() - { - throw new NotImplementedException("Derived property Annotation not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotatingRelationship() - { - throw new NotImplementedException("Derived property OwnedAnnotatingRelationship not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Annotation QueryOwningAnnotatingRelationship() - { - throw new NotImplementedException("Derived property OwningAnnotatingRelationship not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Association.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Association.cs deleted file mode 100644 index 8d30d100b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Association.cs +++ /dev/null @@ -1,578 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Association is a Relationship and a Classifier to enable classification of links between things - /// (in the universe). The co-domains (types) of the associationEnd Features are the relatedTypes, as - /// co-domain and participants (linked things) of an Association identify each other.relatedType = - /// associationEnd.typespecializesFromLibrary('Links::Link')oclIsKindOf(Structure) = - /// oclIsKindOf(AssociationStructure)associationEnd->size() = 2 implies - /// specializesFromLibrary('Links::BinaryLink')not isAbstract implies relatedType->size() >= - /// 2associationEnds->size() > 2 implies not specializesFromLibrary('Links::BinaryLink')sourceType = - /// if relatedType->isEmpty() then null else relatedType->first() endiftargetType = if - /// relatedType->size() < 2 then OrderedSet{} else relatedType-> subSequence(2, - /// relatedType->size())-> asOrderedSet() endifownedEndFeature->forAll(type->size() = 1) - /// - public partial class Association : IAssociation - { - /// - /// Initializes a new instance of the class. - /// - public Association() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.IsSufficient = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property AssociationEnd - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAssociationEnd() - { - throw new NotImplementedException("Derived property AssociationEnd not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubclassification - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubclassification() - { - throw new NotImplementedException("Derived property OwnedSubclassification not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property RelatedType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedType() - { - throw new NotImplementedException("Derived property RelatedType not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// Queries the derived property SourceType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QuerySourceType() - { - throw new NotImplementedException("Derived property SourceType not yet supported"); - } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TargetType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTargetType() - { - throw new NotImplementedException("Derived property TargetType not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Dependency.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Dependency.cs deleted file mode 100644 index 9a0df23d0..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Dependency.cs +++ /dev/null @@ -1,269 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Dependency is a Relationship that indicates that one or more client Elements require one more - /// supplier Elements for their complete specification. In general, this means that a change to one of - /// the supplier Elements may necessitate a change to, or re-specification of, the client Elements.Note - /// that a Dependency is entirely a model-level Relationship, without instance-level semantics. - /// - public partial class Dependency : IDependency - { - /// - /// Initializes a new instance of the class. - /// - public Dependency() - { - this.AliasIds = new List(); - this.Client = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Supplier = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The Element or Elements dependent on the supplier Elements. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Client { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The Element or Elements on which the client Elements depend in some respect. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Supplier { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/EnumerationDefinition.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/EnumerationDefinition.cs deleted file mode 100644 index af649f29c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/EnumerationDefinition.cs +++ /dev/null @@ -1,786 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An EnumerationDefinition is an AttributeDefinition all of whose instances are given by an explicit - /// list of enumeratedValues. This is realized by requiring that the EnumerationDefinition have - /// isVariation = true, with the enumeratedValues being its variants. isVariation - /// - public partial class EnumerationDefinition : IEnumerationDefinition - { - /// - /// Initializes a new instance of the class. - /// - public EnumerationDefinition() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsImpliedIncluded = false; - this.IsSufficient = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Queries the derived property DirectedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedUsage() - { - throw new NotImplementedException("Derived property DirectedUsage not yet supported"); - } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EnumeratedValue - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEnumeratedValue() - { - throw new NotImplementedException("Derived property EnumeratedValue not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether this Definition is for a variation point or not. If true, then all the memberships of the - /// Definition must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAction() - { - throw new NotImplementedException("Derived property OwnedAction not yet supported"); - } - - /// - /// Queries the derived property OwnedAllocation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAllocation() - { - throw new NotImplementedException("Derived property OwnedAllocation not yet supported"); - } - - /// - /// Queries the derived property OwnedAnalysisCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnalysisCase() - { - throw new NotImplementedException("Derived property OwnedAnalysisCase not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedAttribute - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAttribute() - { - throw new NotImplementedException("Derived property OwnedAttribute not yet supported"); - } - - /// - /// Queries the derived property OwnedCalculation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedCalculation() - { - throw new NotImplementedException("Derived property OwnedCalculation not yet supported"); - } - - /// - /// Queries the derived property OwnedCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedCase() - { - throw new NotImplementedException("Derived property OwnedCase not yet supported"); - } - - /// - /// Queries the derived property OwnedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedConcern() - { - throw new NotImplementedException("Derived property OwnedConcern not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedConnection - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedConnection() - { - throw new NotImplementedException("Derived property OwnedConnection not yet supported"); - } - - /// - /// Queries the derived property OwnedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedConstraint() - { - throw new NotImplementedException("Derived property OwnedConstraint not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedEnumeration - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEnumeration() - { - throw new NotImplementedException("Derived property OwnedEnumeration not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedFlow - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFlow() - { - throw new NotImplementedException("Derived property OwnedFlow not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedInterface - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedInterface() - { - throw new NotImplementedException("Derived property OwnedInterface not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedItem - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedItem() - { - throw new NotImplementedException("Derived property OwnedItem not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedMetadata - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMetadata() - { - throw new NotImplementedException("Derived property OwnedMetadata not yet supported"); - } - - /// - /// Queries the derived property OwnedOccurrence - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedOccurrence() - { - throw new NotImplementedException("Derived property OwnedOccurrence not yet supported"); - } - - /// - /// Queries the derived property OwnedPart - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedPart() - { - throw new NotImplementedException("Derived property OwnedPart not yet supported"); - } - - /// - /// Queries the derived property OwnedPort - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedPort() - { - throw new NotImplementedException("Derived property OwnedPort not yet supported"); - } - - /// - /// Queries the derived property OwnedReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedReference() - { - throw new NotImplementedException("Derived property OwnedReference not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedRendering - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRendering() - { - throw new NotImplementedException("Derived property OwnedRendering not yet supported"); - } - - /// - /// Queries the derived property OwnedRequirement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRequirement() - { - throw new NotImplementedException("Derived property OwnedRequirement not yet supported"); - } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedState - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedState() - { - throw new NotImplementedException("Derived property OwnedState not yet supported"); - } - - /// - /// Queries the derived property OwnedSubclassification - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubclassification() - { - throw new NotImplementedException("Derived property OwnedSubclassification not yet supported"); - } - - /// - /// Queries the derived property OwnedTransition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTransition() - { - throw new NotImplementedException("Derived property OwnedTransition not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property OwnedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUsage() - { - throw new NotImplementedException("Derived property OwnedUsage not yet supported"); - } - - /// - /// Queries the derived property OwnedUseCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUseCase() - { - throw new NotImplementedException("Derived property OwnedUseCase not yet supported"); - } - - /// - /// Queries the derived property OwnedVerificationCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedVerificationCase() - { - throw new NotImplementedException("Derived property OwnedVerificationCase not yet supported"); - } - - /// - /// Queries the derived property OwnedView - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedView() - { - throw new NotImplementedException("Derived property OwnedView not yet supported"); - } - - /// - /// Queries the derived property OwnedViewpoint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedViewpoint() - { - throw new NotImplementedException("Derived property OwnedViewpoint not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// Queries the derived property Usage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUsage() - { - throw new NotImplementedException("Derived property Usage not yet supported"); - } - - /// - /// Queries the derived property Variant - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariant() - { - throw new NotImplementedException("Derived property Variant not yet supported"); - } - - /// - /// Queries the derived property VariantMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariantMembership() - { - throw new NotImplementedException("Derived property VariantMembership not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Feature.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Feature.cs deleted file mode 100644 index 37f56d3f2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Feature.cs +++ /dev/null @@ -1,815 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Feature is a Type that classifies relations between multiple things (in the universe). The domain - /// of the relation is the intersection of the featuringTypes of the Feature. (The domain of a Feature - /// with no featuringTyps is implicitly the most general Type Base::Anything from the Kernel Semantic - /// Library.) The co-domain of the relation is the intersection of the types of the Feature.In the - /// simplest cases, the featuringTypes and types are Classifiers and the Feature relates two things, one - /// from the domain and one from the range. Examples include cars paired with wheels, people paired with - /// other people, and cars paired with numbers representing the car length.Since Features are Types, - /// their featuringTypes and types can be Features. In this case, the Feature effectively classifies - /// relations between relations, which can be interpreted as the sequence of things related by the - /// domain Feature concatenated with the sequence of things related by the co-domain Feature.The values - /// of a Feature for a given instance of its domain are all the instances of its co-domain that are - /// related to that domain instance by the Feature. The values of a Feature with chainingFeatures are - /// the same as values of the last Feature in the chain, which can be found by starting with values of - /// the first Feature, then using those values as domain instances to obtain valus of the second - /// Feature, and so on, to values of the last Feature.ownedRedefinition = - /// ownedSubsetting->selectByKind(Redefinition)ownedTypeFeaturing = - /// ownedRelationship->selectByKind(TypeFeaturing)-> select(tf | tf.featureOfType = - /// self)ownedSubsetting = ownedSpecialization->selectByKind(Subsetting)ownedTyping = - /// ownedGeneralization->selectByKind(FeatureTyping)type = let types : OrderedSet(Types) = - /// OrderedSet{self}-> -- Note: The closure operation automatically handles circular - /// relationships. closure(typingFeatures()).typing.type->asOrderedSet() in types->reject(t1 | - /// types->exist(t2 | t2 <> t1 and t2.specializes(t1)))multiplicity <> null implies - /// multiplicity.featuringType = featuringType - /// specializesFromLibrary('Base::things')chainingFeature->excludes(self)ownedFeatureChaining = - /// ownedRelationship->selectByKind(FeatureChaining)chainingFeature = - /// ownedFeatureChaining.chainingFeaturechainingFeature->size() <> 1isEnd and owningType <> null implies - /// let i : Integer = owningType.ownedEndFeature->indexOf(self) in - /// owningType.ownedSpecialization.general-> forAll(supertype | - /// supertype.endFeature->size() >= i implies - /// redefines(supertype.endFeature->at(i))direction = null andownedSpecializations->forAll(isImplied) - /// implies ownedMembership-> selectByKind(FeatureValue)-> forAll(fv | - /// specializes(fv.value.result))isEnd and owningType <> null and(owningType.oclIsKindOf(Association) or - /// owningType.oclIsKindOf(Connector)) implies - /// specializesFromLibrary('Links::Link::participant')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Structure)) andowningType <> null - /// and(owningType.oclIsKindOf(Structure) or owningType.type->includes(oclIsKindOf(Structure))) implies - /// - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(Class)) - /// implies specializesFromLibrary('Occurrences::occurrences')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(DataType)) - /// implies specializesFromLibrary('Base::dataValues')owningType <> null - /// andowningType.oclIsKindOf(FlowEnd) andowningType.ownedFeature->at(1) = self implies let flowType - /// : Type = owningType.owningType in flowType <> null implies let i : Integer = - /// flowType.ownedFeature.indexOf(owningType) in (i = 1 implies - /// redefinesFromLibrary('Transfers::Transfer::source::sourceOutput')) and (i = 2 implies - /// redefinesFromLibrary('Transfers::Transfer::source::targetInput')) owningType <> - /// null andnot owningFeatureMembership. oclIsKindOf(ReturnParameterMembership) - /// and(owningType.oclIsKindOf(Behavior) or owningType.oclIsKindOf(Step) and - /// (owningType.oclIsKindOf(InvocationExpression) implies not ownedRedefinition->exists(not - /// isImplied)) implies let i : Integer = owningType.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership))-> - /// indexOf(self) in owningType.ownedSpecialization.general-> forAll(supertype | - /// let ownedParameters : Sequence(Feature) = - /// supertype.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership)) in - /// ownedParameters->size() >= i implies - /// redefines(ownedParameters->at(i))ownedTyping.type->exists(selectByKind(Structure)) implies - /// specializesFromLibary('Objects::objects')owningType <> null and(owningType.oclIsKindOf(Function) and - /// self = owningType.oclAsType(Function).result or owningType.oclIsKindOf(Expression) and self = - /// owningType.oclAsType(Expression).result) implies owningType.ownedSpecialization.general-> - /// select(oclIsKindOf(Function) or oclIsKindOf(Expression))-> forAll(supertype | - /// redefines( if superType.oclIsKindOf(Function) then - /// superType.oclAsType(Function).result else - /// superType.oclAsType(Expression).result endif)ownedFeatureInverting = - /// ownedRelationship->selectByKind(FeatureInverting)-> select(fi | fi.featureInverted = - /// self)featuringType = let featuringTypes : OrderedSet(Type) = - /// featuring.type->asOrderedSet() in if chainingFeature->isEmpty() then featuringTypes else - /// featuringTypes-> union(chainingFeature->first().featuringType)-> - /// asOrderedSet() endifownedReferenceSubsetting = let referenceSubsettings : - /// OrderedSet(ReferenceSubsetting) = ownedSubsetting->selectByKind(ReferenceSubsetting) in if - /// referenceSubsettings->isEmpty() then null else referenceSubsettings->first() - /// endifownedSubsetting->selectByKind(ReferenceSubsetting)->size() <= - /// 1Sequence{2..chainingFeature->size()}->forAll(i | - /// chainingFeature->at(i).isFeaturedWithin(chainingFeature->at(i-1)))isPortion - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::portions')featureTarget = if - /// chainingFeature->isEmpty() then self else chainingFeature->last() endifownedCrossSubsetting = let - /// crossSubsettings: Sequence(CrossSubsetting) = ownedSubsetting->selectByKind(CrossSubsetting) - /// in if crossSubsettings->isEmpty() then null else crossSubsettings->first() endifisEnd - /// implies multiplicities().allSuperTypes()->flatten()-> - /// selectByKind(MultiplicityRange)->exists(hasBounds(1,1))crossFeature <> null implies - /// crossFeature.type->asSet() = type->asSet()ownedSubsetting->selectByKind(CrossSubsetting)->size() <= - /// 1crossFeature = if ownedCrossSubsetting = null then null else let chainingFeatures: - /// Sequence(Feature) = ownedCrossSubsetting.crossedFeature.chainingFeature in if - /// chainingFeatures->size() < 2 then null else chainingFeatures->at(2) - /// endifisOwnedCrossFeature() implies owner.oclAsType(Feature).type->forAll(t | - /// self.specializes(t))isOwnedCrossFeature() implies ownedSubsetting.subsettedFeature->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature - /// <> null).crossFeature)crossFeature <> null implies - /// ownedRedefinition.redefinedFeature.crossFeature-> forAll(f | f <> null implies - /// crossFeature.specializes(f))ownedCrossFeature() <> null implies crossFeature = - /// ownedCrossFeature()isOwnedCrossFeature() implies let otherEnds : OrderedSet(Feature) = - /// owner.oclAsType(Feature).owningType.endFeature->excluding(self) in if (otherEnds->size() = 1) - /// then featuringType = otherEnds->first().type else featuringType->size() = 1 and - /// featuringType->first().isCartesianProduct() and - /// featuringType->first().asCartesianProduct() = otherEnds.type and - /// featuringType->first().allSupertypes()->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature() <> - /// null).crossFeature().featuringType) endifisPortion implies not isVariableisEnd implied - /// direction = nullowningFeatureMembership <> null implies featuringTypes->exists(t | - /// isFeaturingType(t))isConstant implies isVariableisVariable implies owningType <> null and - /// owningType.specializes('Occurrences::Occurrence')isEnd implies not (isDerived or isAbstract or - /// isComposite or isPortion)isEnd and isVariable implies isConstant - /// - public partial class Feature : IFeature - { - /// - /// Initializes a new instance of the class. - /// - public Feature() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FeatureTyping.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FeatureTyping.cs deleted file mode 100644 index ed2ec0948..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FeatureTyping.cs +++ /dev/null @@ -1,297 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// FeatureTyping is Specialization in which the specific Type is a Feature. This means the set of - /// instances of the (specific) typedFeature is a subset of the set of instances of the (general) type. - /// In the simplest case, the type is a Classifier, whereupon the typedFeature has values that are - /// instances of the Classifier. - /// - public partial class FeatureTyping : IFeatureTyping - { - /// - /// Initializes a new instance of the class. - /// - public FeatureTyping() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryOwningFeature() - { - throw new NotImplementedException("Derived property OwningFeature not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type Specific { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// The Type that is being applied by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type Type { get; set; } - - /// - /// The Feature that has a type determined by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature TypedFeature { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Flow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Flow.cs deleted file mode 100644 index b3b30bd25..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Flow.cs +++ /dev/null @@ -1,889 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Flow is a Step that represents the transfer of values from one Feature to another. Flows can take - /// non-zero time to complete.specializesFromLibrary('Transfers::transfers')payloadType = if - /// payloadFeature = null then Sequence{} else payloadFeature.type endifsourceOutputFeature = - /// if connectorEnd->isEmpty() or connectorEnd.ownedFeature->isEmpty() then null else - /// connectorEnd.ownedFeature->first() endiftargetInputFeature = if connectorEnd->size() < 2 or - /// connectorEnd->at(2).ownedFeature->isEmpty() then null else - /// connectorEnd->at(2).ownedFeature->first() endifflowEnd = - /// connectorEnd->selectByKind(FlowEnd)payloadFeature = let payloadFeatures : - /// Sequence(PayloadFeature) = ownedFeature->selectByKind(PayloadFeature) in if - /// payloadFeatures->isEmpty() then null else payloadFeatures->first() - /// endifownedFeature->selectByKind(PayloadFeature)->size() <= 1ownedEndFeatures->notEmpty() implies - /// specializesFromLibrary('Transfers::flowTransfers') - /// - public partial class Flow : IFlow - { - /// - /// Initializes a new instance of the class. - /// - public Flow() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property Association - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAssociation() - { - throw new NotImplementedException("Derived property Association not yet supported"); - } - - /// - /// Queries the derived property Behavior - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryBehavior() - { - throw new NotImplementedException("Derived property Behavior not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property ConnectorEnd - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryConnectorEnd() - { - throw new NotImplementedException("Derived property ConnectorEnd not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DefaultFeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryDefaultFeaturingType() - { - throw new NotImplementedException("Derived property DefaultFeaturingType not yet supported"); - } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property FlowEnd - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: 2, isMany: false, isRequired: false, isContainment: false)] - public List QueryFlowEnd() - { - throw new NotImplementedException("Derived property FlowEnd not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property Interaction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInteraction() - { - throw new NotImplementedException("Derived property Interaction not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property Parameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryParameter() - { - throw new NotImplementedException("Derived property Parameter not yet supported"); - } - - /// - /// Queries the derived property PayloadFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public PayloadFeature QueryPayloadFeature() - { - throw new NotImplementedException("Derived property PayloadFeature not yet supported"); - } - - /// - /// Queries the derived property PayloadType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryPayloadType() - { - throw new NotImplementedException("Derived property PayloadType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property RelatedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedFeature() - { - throw new NotImplementedException("Derived property RelatedFeature not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// Queries the derived property SourceFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QuerySourceFeature() - { - throw new NotImplementedException("Derived property SourceFeature not yet supported"); - } - - /// - /// Queries the derived property SourceOutputFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QuerySourceOutputFeature() - { - throw new NotImplementedException("Derived property SourceOutputFeature not yet supported"); - } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TargetFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTargetFeature() - { - throw new NotImplementedException("Derived property TargetFeature not yet supported"); - } - - /// - /// Queries the derived property TargetInputFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryTargetInputFeature() - { - throw new NotImplementedException("Derived property TargetInputFeature not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FramedConcernMembership.cs deleted file mode 100644 index 188459ad9..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/FramedConcernMembership.cs +++ /dev/null @@ -1,393 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A FramedConcernMembership is a RequirementConstraintMembership for a framed ConcernUsage of a - /// RequirementDefinition or RequirementUsage.kind = RequirementConstraintKind::requirement - /// - public partial class FramedConcernMembership : IFramedConcernMembership - { - /// - /// Initializes a new instance of the class. - /// - public FramedConcernMembership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Whether the RequirementConstraintMembership is for an assumed or required ConstraintUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public RequirementConstraintKind Kind { get; set; } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement MemberElement { get; set; } - - /// - /// Queries the derived property MemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryMemberElementId() - { - throw new NotImplementedException("Derived property MemberElementId not yet supported"); - } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// Queries the derived property MembershipOwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryMembershipOwningNamespace() - { - throw new NotImplementedException("Derived property MembershipOwningNamespace not yet supported"); - } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ConcernUsage QueryOwnedConcern() - { - throw new NotImplementedException("Derived property OwnedConcern not yet supported"); - } - - /// - /// Queries the derived property OwnedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ConstraintUsage QueryOwnedConstraint() - { - throw new NotImplementedException("Derived property OwnedConstraint not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwnedMemberElement() - { - throw new NotImplementedException("Derived property OwnedMemberElement not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberElementId() - { - throw new NotImplementedException("Derived property OwnedMemberElementId not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryOwnedMemberFeature() - { - throw new NotImplementedException("Derived property OwnedMemberFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberName() - { - throw new NotImplementedException("Derived property OwnedMemberName not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberShortName() - { - throw new NotImplementedException("Derived property OwnedMemberShortName not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ReferencedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ConcernUsage QueryReferencedConcern() - { - throw new NotImplementedException("Derived property ReferencedConcern not yet supported"); - } - - /// - /// Queries the derived property ReferencedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ConstraintUsage QueryReferencedConstraint() - { - throw new NotImplementedException("Derived property ReferencedConstraint not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAnnotatingElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAnnotatingElement.cs deleted file mode 100644 index 7049cbad4..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAnnotatingElement.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An AnnotatingElement is an Element that provides additional description of or metadata on some other - /// Element. An AnnotatingElement is either attached to its annotatedElements by Annotation - /// Relationships, or it implicitly annotates its owningNamespace.annotatedElement = if - /// annotation->notEmpty() then annotation.annotatedElement else Sequence{owningNamespace} - /// endifownedAnnotatingRelationship = ownedRelationship-> selectByKind(Annotation)-> select(a | - /// a.annotatedElement <> self)annotation = if owningAnnotatingRelationship = null then - /// ownedAnnotatingRelationship else - /// owningAnnotatingRelationship->prepend(owningAnnotatingRelationship) endif - /// - public partial interface IAnnotatingElement : IElement - { - /// - /// Queries the derived property AnnotatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryAnnotatedElement(); - - /// - /// Queries the derived property Annotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryAnnotation(); - - /// - /// Queries the derived property OwnedAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedAnnotatingRelationship(); - - /// - /// Queries the derived property OwningAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Annotation QueryOwningAnnotatingRelationship(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAssociation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAssociation.cs deleted file mode 100644 index f9bd2c91a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IAssociation.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Association is a Relationship and a Classifier to enable classification of links between things - /// (in the universe). The co-domains (types) of the associationEnd Features are the relatedTypes, as - /// co-domain and participants (linked things) of an Association identify each other.relatedType = - /// associationEnd.typespecializesFromLibrary('Links::Link')oclIsKindOf(Structure) = - /// oclIsKindOf(AssociationStructure)associationEnd->size() = 2 implies - /// specializesFromLibrary('Links::BinaryLink')not isAbstract implies relatedType->size() >= - /// 2associationEnds->size() > 2 implies not specializesFromLibrary('Links::BinaryLink')sourceType = - /// if relatedType->isEmpty() then null else relatedType->first() endiftargetType = if - /// relatedType->size() < 2 then OrderedSet{} else relatedType-> subSequence(2, - /// relatedType->size())-> asOrderedSet() endifownedEndFeature->forAll(type->size() = 1) - /// - public partial interface IAssociation : IClassifier, IRelationship - { - /// - /// Queries the derived property AssociationEnd - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryAssociationEnd(); - - /// - /// Queries the derived property RelatedType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryRelatedType(); - - /// - /// Queries the derived property SourceType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Type QuerySourceType(); - - /// - /// Queries the derived property TargetType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryTargetType(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IDependency.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IDependency.cs deleted file mode 100644 index 7f029535f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IDependency.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Dependency is a Relationship that indicates that one or more client Elements require one more - /// supplier Elements for their complete specification. In general, this means that a change to one of - /// the supplier Elements may necessitate a change to, or re-specification of, the client Elements.Note - /// that a Dependency is entirely a model-level Relationship, without instance-level semantics. - /// - public partial interface IDependency : IRelationship - { - /// - /// The Element or Elements dependent on the supplier Elements. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Client { get; set; } - - /// - /// The Element or Elements on which the client Elements depend in some respect. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Supplier { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IElement.cs deleted file mode 100644 index 3237ba8aa..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IElement.cs +++ /dev/null @@ -1,173 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Element is a constituent of a model that is uniquely identified relative to all other Elements. - /// It can have Relationships with other Elements. Some of these Relationships might imply ownership of - /// other Elements, which means that if an Element is deleted from a model, then so are all the Elements - /// that it owns.ownedElement = ownedRelationship.ownedRelatedElementowner = - /// owningRelationship.owningRelatedElementqualifiedName = if owningNamespace = null then null - /// else if name <> null and owningNamespace.ownedMember-> select(m | m.name = - /// name).indexOf(self) <> 1 then null else if owningNamespace.owner = null then escapedName() - /// else if owningNamespace.qualifiedName = null or escapedName() = null then null else - /// owningNamespace.qualifiedName + '::' + escapedName() endif endif endif endifdocumentation = - /// ownedElement->selectByKind(Documentation)ownedAnnotation = ownedRelationship-> - /// selectByKind(Annotation)-> select(a | a.annotatedElement = self)name = - /// effectiveName()ownedRelationship->exists(isImplied) implies isImpliedIncludedisLibraryElement = - /// libraryNamespace() <> nullshortName = effectiveShortName()owningNamespace = if owningMembership = - /// null then null else owningMembership.membershipOwningNamespace endiftextualRepresentation = - /// ownedElement->selectByKind(TextualRepresentation) - /// - public partial interface IElement - { - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryDocumentation(); - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool QueryIsLibraryElement(); - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryName(); - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedAnnotation(); - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedElement(); - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IElement QueryOwner(); - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - OwningMembership QueryOwningMembership(); - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Namespace QueryOwningNamespace(); - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryQualifiedName(); - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryShortName(); - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryTextualRepresentation(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IEnumerationDefinition.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IEnumerationDefinition.cs deleted file mode 100644 index f455f4571..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IEnumerationDefinition.cs +++ /dev/null @@ -1,51 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An EnumerationDefinition is an AttributeDefinition all of whose instances are given by an explicit - /// list of enumeratedValues. This is realized by requiring that the EnumerationDefinition have - /// isVariation = true, with the enumeratedValues being its variants. isVariation - /// - public partial interface IEnumerationDefinition : IAttributeDefinition - { - /// - /// Queries the derived property EnumeratedValue - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryEnumeratedValue(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeature.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeature.cs deleted file mode 100644 index a0278457d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeature.cs +++ /dev/null @@ -1,319 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Feature is a Type that classifies relations between multiple things (in the universe). The domain - /// of the relation is the intersection of the featuringTypes of the Feature. (The domain of a Feature - /// with no featuringTyps is implicitly the most general Type Base::Anything from the Kernel Semantic - /// Library.) The co-domain of the relation is the intersection of the types of the Feature.In the - /// simplest cases, the featuringTypes and types are Classifiers and the Feature relates two things, one - /// from the domain and one from the range. Examples include cars paired with wheels, people paired with - /// other people, and cars paired with numbers representing the car length.Since Features are Types, - /// their featuringTypes and types can be Features. In this case, the Feature effectively classifies - /// relations between relations, which can be interpreted as the sequence of things related by the - /// domain Feature concatenated with the sequence of things related by the co-domain Feature.The values - /// of a Feature for a given instance of its domain are all the instances of its co-domain that are - /// related to that domain instance by the Feature. The values of a Feature with chainingFeatures are - /// the same as values of the last Feature in the chain, which can be found by starting with values of - /// the first Feature, then using those values as domain instances to obtain valus of the second - /// Feature, and so on, to values of the last Feature.ownedRedefinition = - /// ownedSubsetting->selectByKind(Redefinition)ownedTypeFeaturing = - /// ownedRelationship->selectByKind(TypeFeaturing)-> select(tf | tf.featureOfType = - /// self)ownedSubsetting = ownedSpecialization->selectByKind(Subsetting)ownedTyping = - /// ownedGeneralization->selectByKind(FeatureTyping)type = let types : OrderedSet(Types) = - /// OrderedSet{self}-> -- Note: The closure operation automatically handles circular - /// relationships. closure(typingFeatures()).typing.type->asOrderedSet() in types->reject(t1 | - /// types->exist(t2 | t2 <> t1 and t2.specializes(t1)))multiplicity <> null implies - /// multiplicity.featuringType = featuringType - /// specializesFromLibrary('Base::things')chainingFeature->excludes(self)ownedFeatureChaining = - /// ownedRelationship->selectByKind(FeatureChaining)chainingFeature = - /// ownedFeatureChaining.chainingFeaturechainingFeature->size() <> 1isEnd and owningType <> null implies - /// let i : Integer = owningType.ownedEndFeature->indexOf(self) in - /// owningType.ownedSpecialization.general-> forAll(supertype | - /// supertype.endFeature->size() >= i implies - /// redefines(supertype.endFeature->at(i))direction = null andownedSpecializations->forAll(isImplied) - /// implies ownedMembership-> selectByKind(FeatureValue)-> forAll(fv | - /// specializes(fv.value.result))isEnd and owningType <> null and(owningType.oclIsKindOf(Association) or - /// owningType.oclIsKindOf(Connector)) implies - /// specializesFromLibrary('Links::Link::participant')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Structure)) andowningType <> null - /// and(owningType.oclIsKindOf(Structure) or owningType.type->includes(oclIsKindOf(Structure))) implies - /// - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(Class)) - /// implies specializesFromLibrary('Occurrences::occurrences')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(DataType)) - /// implies specializesFromLibrary('Base::dataValues')owningType <> null - /// andowningType.oclIsKindOf(FlowEnd) andowningType.ownedFeature->at(1) = self implies let flowType - /// : Type = owningType.owningType in flowType <> null implies let i : Integer = - /// flowType.ownedFeature.indexOf(owningType) in (i = 1 implies - /// redefinesFromLibrary('Transfers::Transfer::source::sourceOutput')) and (i = 2 implies - /// redefinesFromLibrary('Transfers::Transfer::source::targetInput')) owningType <> - /// null andnot owningFeatureMembership. oclIsKindOf(ReturnParameterMembership) - /// and(owningType.oclIsKindOf(Behavior) or owningType.oclIsKindOf(Step) and - /// (owningType.oclIsKindOf(InvocationExpression) implies not ownedRedefinition->exists(not - /// isImplied)) implies let i : Integer = owningType.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership))-> - /// indexOf(self) in owningType.ownedSpecialization.general-> forAll(supertype | - /// let ownedParameters : Sequence(Feature) = - /// supertype.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership)) in - /// ownedParameters->size() >= i implies - /// redefines(ownedParameters->at(i))ownedTyping.type->exists(selectByKind(Structure)) implies - /// specializesFromLibary('Objects::objects')owningType <> null and(owningType.oclIsKindOf(Function) and - /// self = owningType.oclAsType(Function).result or owningType.oclIsKindOf(Expression) and self = - /// owningType.oclAsType(Expression).result) implies owningType.ownedSpecialization.general-> - /// select(oclIsKindOf(Function) or oclIsKindOf(Expression))-> forAll(supertype | - /// redefines( if superType.oclIsKindOf(Function) then - /// superType.oclAsType(Function).result else - /// superType.oclAsType(Expression).result endif)ownedFeatureInverting = - /// ownedRelationship->selectByKind(FeatureInverting)-> select(fi | fi.featureInverted = - /// self)featuringType = let featuringTypes : OrderedSet(Type) = - /// featuring.type->asOrderedSet() in if chainingFeature->isEmpty() then featuringTypes else - /// featuringTypes-> union(chainingFeature->first().featuringType)-> - /// asOrderedSet() endifownedReferenceSubsetting = let referenceSubsettings : - /// OrderedSet(ReferenceSubsetting) = ownedSubsetting->selectByKind(ReferenceSubsetting) in if - /// referenceSubsettings->isEmpty() then null else referenceSubsettings->first() - /// endifownedSubsetting->selectByKind(ReferenceSubsetting)->size() <= - /// 1Sequence{2..chainingFeature->size()}->forAll(i | - /// chainingFeature->at(i).isFeaturedWithin(chainingFeature->at(i-1)))isPortion - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::portions')featureTarget = if - /// chainingFeature->isEmpty() then self else chainingFeature->last() endifownedCrossSubsetting = let - /// crossSubsettings: Sequence(CrossSubsetting) = ownedSubsetting->selectByKind(CrossSubsetting) - /// in if crossSubsettings->isEmpty() then null else crossSubsettings->first() endifisEnd - /// implies multiplicities().allSuperTypes()->flatten()-> - /// selectByKind(MultiplicityRange)->exists(hasBounds(1,1))crossFeature <> null implies - /// crossFeature.type->asSet() = type->asSet()ownedSubsetting->selectByKind(CrossSubsetting)->size() <= - /// 1crossFeature = if ownedCrossSubsetting = null then null else let chainingFeatures: - /// Sequence(Feature) = ownedCrossSubsetting.crossedFeature.chainingFeature in if - /// chainingFeatures->size() < 2 then null else chainingFeatures->at(2) - /// endifisOwnedCrossFeature() implies owner.oclAsType(Feature).type->forAll(t | - /// self.specializes(t))isOwnedCrossFeature() implies ownedSubsetting.subsettedFeature->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature - /// <> null).crossFeature)crossFeature <> null implies - /// ownedRedefinition.redefinedFeature.crossFeature-> forAll(f | f <> null implies - /// crossFeature.specializes(f))ownedCrossFeature() <> null implies crossFeature = - /// ownedCrossFeature()isOwnedCrossFeature() implies let otherEnds : OrderedSet(Feature) = - /// owner.oclAsType(Feature).owningType.endFeature->excluding(self) in if (otherEnds->size() = 1) - /// then featuringType = otherEnds->first().type else featuringType->size() = 1 and - /// featuringType->first().isCartesianProduct() and - /// featuringType->first().asCartesianProduct() = otherEnds.type and - /// featuringType->first().allSupertypes()->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature() <> - /// null).crossFeature().featuringType) endifisPortion implies not isVariableisEnd implied - /// direction = nullowningFeatureMembership <> null implies featuringTypes->exists(t | - /// isFeaturingType(t))isConstant implies isVariableisVariable implies owningType <> null and - /// owningType.specializes('Occurrences::Occurrence')isEnd implies not (isDerived or isAbstract or - /// isComposite or isPortion)isEnd and isVariable implies isConstant - /// - public partial interface IFeature : IType - { - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryChainingFeature(); - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QueryCrossFeature(); - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Type QueryEndOwningType(); - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QueryFeatureTarget(); - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryFeaturingType(); - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsEnd { get; set; } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool QueryIsNonunique(); - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsPortion { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsVariable { get; set; } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - CrossSubsetting QueryOwnedCrossSubsetting(); - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedFeatureChaining(); - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedFeatureInverting(); - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedRedefinition(); - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - ReferenceSubsetting QueryOwnedReferenceSubsetting(); - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedSubsetting(); - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedTypeFeaturing(); - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryOwnedTyping(); - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - FeatureMembership QueryOwningFeatureMembership(); - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Type QueryOwningType(); - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryType(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeatureTyping.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeatureTyping.cs deleted file mode 100644 index 3307312b5..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFeatureTyping.cs +++ /dev/null @@ -1,64 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// FeatureTyping is Specialization in which the specific Type is a Feature. This means the set of - /// instances of the (specific) typedFeature is a subset of the set of instances of the (general) type. - /// In the simplest case, the type is a Classifier, whereupon the typedFeature has values that are - /// instances of the Classifier. - /// - public partial interface IFeatureTyping : ISpecialization - { - /// - /// Queries the derived property OwningFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QueryOwningFeature(); - - /// - /// The Type that is being applied by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Type Type { get; set; } - - /// - /// The Feature that has a type determined by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature TypedFeature { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFlow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFlow.cs deleted file mode 100644 index 02691d853..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFlow.cs +++ /dev/null @@ -1,90 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Flow is a Step that represents the transfer of values from one Feature to another. Flows can take - /// non-zero time to complete.specializesFromLibrary('Transfers::transfers')payloadType = if - /// payloadFeature = null then Sequence{} else payloadFeature.type endifsourceOutputFeature = - /// if connectorEnd->isEmpty() or connectorEnd.ownedFeature->isEmpty() then null else - /// connectorEnd.ownedFeature->first() endiftargetInputFeature = if connectorEnd->size() < 2 or - /// connectorEnd->at(2).ownedFeature->isEmpty() then null else - /// connectorEnd->at(2).ownedFeature->first() endifflowEnd = - /// connectorEnd->selectByKind(FlowEnd)payloadFeature = let payloadFeatures : - /// Sequence(PayloadFeature) = ownedFeature->selectByKind(PayloadFeature) in if - /// payloadFeatures->isEmpty() then null else payloadFeatures->first() - /// endifownedFeature->selectByKind(PayloadFeature)->size() <= 1ownedEndFeatures->notEmpty() implies - /// specializesFromLibrary('Transfers::flowTransfers') - /// - public partial interface IFlow : IConnector, IStep - { - /// - /// Queries the derived property FlowEnd - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: 2, isMany: false, isRequired: false, isContainment: false)] - List QueryFlowEnd(); - - /// - /// Queries the derived property Interaction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryInteraction(); - - /// - /// Queries the derived property PayloadFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - PayloadFeature QueryPayloadFeature(); - - /// - /// Queries the derived property PayloadType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryPayloadType(); - - /// - /// Queries the derived property SourceOutputFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QuerySourceOutputFeature(); - - /// - /// Queries the derived property TargetInputFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QueryTargetInputFeature(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFramedConcernMembership.cs deleted file mode 100644 index 26b1a4b8d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IFramedConcernMembership.cs +++ /dev/null @@ -1,56 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A FramedConcernMembership is a RequirementConstraintMembership for a framed ConcernUsage of a - /// RequirementDefinition or RequirementUsage.kind = RequirementConstraintKind::requirement - /// - public partial interface IFramedConcernMembership : IRequirementConstraintMembership - { - /// - /// Queries the derived property OwnedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - ConcernUsage QueryOwnedConcern(); - - /// - /// Queries the derived property ReferencedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - ConcernUsage QueryReferencedConcern(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralInteger.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralInteger.cs deleted file mode 100644 index 996556098..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralInteger.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralInteger is a LiteralExpression that provides an Integer value as a result. Its result - /// parameter must have the type - /// Integer.specializesFromLibrary('Performances::literalIntegerEvaluations') - /// - public partial interface ILiteralInteger : ILiteralExpression - { - /// - /// The Integer value that is the result of evaluating this LiteralInteger.The Integer value that is the - /// result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - int Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralRational.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralRational.cs deleted file mode 100644 index 72143a695..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ILiteralRational.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralRational is a LiteralExpression that provides a Rational value as a result. Its result - /// parameter must have the type - /// Rational.specializesFromLibrary('Performances::literalRationalEvaluations') - /// - public partial interface ILiteralRational : ILiteralExpression - { - /// - /// The value whose rational approximation is the result of evaluating this LiteralRational.The Real - /// value that is the result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - double Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMembership.cs deleted file mode 100644 index 57a4d2d49..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMembership.cs +++ /dev/null @@ -1,87 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Membership is a Relationship between a Namespace and an Element that indicates the Element is a - /// member of (i.e., is contained in) the Namespace. Any memberNames specify how the memberElement is - /// identified in the Namespace and the visibility specifies whether or not the memberElement is - /// publicly visible from outside the Namespace.If a Membership is an OwningMembership, then it owns its - /// memberElement, which becomes an ownedMember of the membershipOwningNamespace. Otherwise, the - /// memberNames of a Membership are effectively aliases within the membershipOwningNamespace for an - /// Element with a separate OwningMembership in the same or a different Namespace. memberElementId - /// = memberElement.elementId - /// - public partial interface IMembership : IRelationship - { - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IElement MemberElement { get; set; } - - /// - /// Queries the derived property MemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryMemberElementId(); - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string MemberName { get; set; } - - /// - /// Queries the derived property MembershipOwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Namespace QueryMembershipOwningNamespace(); - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string MemberShortName { get; set; } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMultiplicityRange.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMultiplicityRange.cs deleted file mode 100644 index 21dfb954c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IMultiplicityRange.cs +++ /dev/null @@ -1,78 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A MultiplicityRange is a Multiplicity whose value is defined to be the (inclusive) range of natural - /// numbers given by the result of a lowerBound Expression and the result of an upperBound Expression. - /// The result of these Expressions shall be of type Natural. If the result of the upperBound Expression - /// is the unbounded value *, then the specified range includes all natural numbers greater than or - /// equal to the lowerBound value. If no lowerBound Expression, then the default is that the lower bound - /// has the same value as the upper bound, except if the upperBound evaluates to *, in which case the - /// default for the lower bound is 0.bound->forAll(b | b.featuringType = - /// self.featuringType)bound->forAll(b | b.result.specializesFromLibrary('ScalarValues::Integer') and - /// let value : UnlimitedNatural = valueOf(b) in value <> null implies value >= 0)lowerBound = - /// let ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->size() < 2 then null else ownedExpressions->first() endifupperBound = let - /// ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->isEmpty() then null else if ownedExpressions->size() = 1 then - /// ownedExpressions->at(1) else ownedExpressions->at(2) endif endif bound = if upperBound = - /// null then Sequence{} else if lowerBound = null then Sequence{upperBound} else - /// Sequence{lowerBound, upperBound} endif endifif lowerBound = null then ownedMember->notEmpty() - /// and ownedMember->at(1) = upperBoundelse ownedMember->size() > 1 and ownedMember->at(1) = - /// lowerBound and ownedMember->at(2) = upperBoundendif - /// - public partial interface IMultiplicityRange : IMultiplicity - { - /// - /// Queries the derived property Bound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 2, isMany: false, isRequired: false, isContainment: false)] - List QueryBound(); - - /// - /// Queries the derived property LowerBound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Expression QueryLowerBound(); - - /// - /// Queries the derived property UpperBound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Expression QueryUpperBound(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IOwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IOwningMembership.cs deleted file mode 100644 index 40b4258a0..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IOwningMembership.cs +++ /dev/null @@ -1,69 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The - /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace.ownedMemberName = - /// ownedMemberElement.nameownedMemberShortName = ownedMemberElement.shortName - /// - public partial interface IOwningMembership : IMembership - { - /// - /// Queries the derived property OwnedMemberElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IElement QueryOwnedMemberElement(); - - /// - /// Queries the derived property OwnedMemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryOwnedMemberElementId(); - - /// - /// Queries the derived property OwnedMemberName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryOwnedMemberName(); - - /// - /// Queries the derived property OwnedMemberShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string QueryOwnedMemberShortName(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IReferenceSubsetting.cs deleted file mode 100644 index 91bfb2cf0..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IReferenceSubsetting.cs +++ /dev/null @@ -1,60 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// ReferenceSubsetting is a kind of Subsetting in which the referencedFeature is syntactically - /// distinguished from other Features subsetted by the referencingFeature. ReferenceSubsetting has the - /// same semantics as Subsetting, but the referencedFeature may have a special purpose relative to the - /// referencingFeature. For instance, ReferenceSubsetting is used to identify the relatedFeatures of a - /// Connector.ReferenceSubsetting is always an ownedRelationship of its referencingFeature. A Feature - /// can have at most one ownedReferenceSubsetting. - /// - public partial interface IReferenceSubsetting : ISubsetting - { - /// - /// The Feature that is referenced by the referencingFeature of this ReferenceSubsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature ReferencedFeature { get; set; } - - /// - /// Queries the derived property ReferencingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Feature QueryReferencingFeature(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRelationship.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRelationship.cs deleted file mode 100644 index f0d908bd9..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRelationship.cs +++ /dev/null @@ -1,91 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Relationship is an Element that relates other Element. Some of its relatedElements may be owned, - /// in which case those ownedRelatedElements will be deleted from a model if their owningRelationship - /// is. A Relationship may also be owned by another Element, in which case the ownedRelatedElements of - /// the Relationship are also considered to be transitively owned by the owningRelatedElement of the - /// Relationship.The relatedElements of a Relationship are divided into source and target Elements. The - /// Relationship is considered to be directed from the source to the target Elements. An undirected - /// Relationship may have either all source or all target Elements.A "relationship Element" in - /// the abstract syntax is generically any Element that is an instance of either Relationship or a - /// direct or indirect specialization of Relationship. Any other kind of Element is a - /// "non-relationship Element". It is a convention of that non-relationship Elements are only - /// related via reified relationship Elements. Any meta-associations directly between non-relationship - /// Elements must be derived from underlying reified Relationship.relatedElement = source->union(target) - /// - public partial interface IRelationship : IElement - { - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsImplied { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - List OwnedRelatedElement { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IElement OwningRelatedElement { get; set; } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryRelatedElement(); - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRequirementUsage.cs deleted file mode 100644 index 1a081efdc..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IRequirementUsage.cs +++ /dev/null @@ -1,121 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A RequirementUsage is a Usage of a RequirementDefinition.actorParameter = featureMembership-> - /// selectByKind(ActorMembership). ownedActorParameterassumedConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::assumption). ownedConstraintframedConcern = featureMembership-> - /// selectByKind(FramedConcernMembership). ownedConcernrequiredConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::requirement). ownedConstraintstakeholderParameter = - /// featureMembership-> selectByKind(AStakholderMembership). - /// ownedStakeholderParametersubjectParameter = let subjects : OrderedSet(SubjectMembership) = - /// featureMembership->selectByKind(SubjectMembership) in if subjects->isEmpty() then null else - /// subjects->first().ownedSubjectParameter endiftext = documentation.bodyfeatureMembership-> - /// selectByKind(SubjectMembership)-> size() <= 1input->notEmpty() and input->first() = - /// subjectParameterspecializesFromLibrary('Requirements::requirementChecks')isComposite and owningType - /// <> null and (owningType.oclIsKindOf(RequirementDefinition) or - /// owningType.oclIsKindOf(RequirementUsage)) implies - /// specializesFromLibrary('Requirements::RequirementCheck::subrequirements')owningfeatureMembership <> - /// null andowningfeatureMembership.oclIsKindOf(ObjectiveMembership) implies - /// owningType.ownedSpecialization.general->forAll(gen | (gen.oclIsKindOf(CaseDefinition) implies - /// redefines(gen.oclAsType(CaseDefinition).objectiveRequirement)) and - /// (gen.oclIsKindOf(CaseUsage) implies - /// redefines(gen.oclAsType(CaseUsage).objectiveRequirement))owningFeatureMembership <> null - /// andowningFeatureMembership.oclIsKindOf(RequirementVerificationMembership) implies - /// specializesFromLibrary('VerificationCases::VerificationCase::obj::requirementVerifications') - /// - public partial interface IRequirementUsage : IConstraintUsage - { - /// - /// Queries the derived property ActorParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryActorParameter(); - - /// - /// Queries the derived property AssumedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryAssumedConstraint(); - - /// - /// Queries the derived property FramedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryFramedConcern(); - - /// - /// An optional modeler-specified identifier for this RequirementUsage (used, e.g., to link it to an - /// original requirement text in some source document), which is the declaredShortName for the - /// RequirementUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string ReqId { get; set; } - - /// - /// Queries the derived property RequiredConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryRequiredConstraint(); - - /// - /// Queries the derived property RequirementDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - RequirementDefinition QueryRequirementDefinition(); - - /// - /// Queries the derived property StakeholderParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryStakeholderParameter(); - - /// - /// Queries the derived property SubjectParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Usage QuerySubjectParameter(); - - /// - /// Queries the derived property Text - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryText(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISelectExpression.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISelectExpression.cs deleted file mode 100644 index dd945a686..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISelectExpression.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A SelectExpression is an OperatorExpression whose operator is "select", which resolves to the - /// Function ControlFunctions::select from the Kernel Functions Library.operator = - /// 'select'arguments->notEmpty() implies result.specializes(arguments->first().result) - /// - public partial interface ISelectExpression : IOperatorExpression - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISubclassification.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISubclassification.cs deleted file mode 100644 index 41790871c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ISubclassification.cs +++ /dev/null @@ -1,62 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// Subclassification is Specialization in which both the specific and general Types are Classifier. - /// This means all instances of the specific Classifier are also instances of the general Classifier. - /// - public partial interface ISubclassification : ISpecialization - { - /// - /// Queries the derived property OwningClassifier - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Classifier QueryOwningClassifier(); - - /// - /// The more specific Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Classifier Subclassifier { get; set; } - - /// - /// The more general Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Classifier Superclassifier { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ITextualRepresentation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ITextualRepresentation.cs deleted file mode 100644 index 437d2bb8d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ITextualRepresentation.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A TextualRepresentation is an AnnotatingElement whose body represents the representedElement in a - /// given language. The representedElement must be the owner of the TextualRepresentation. The named - /// language can be a natural language, in which case the body is an informal representation, or an - /// artificial language, in which case the body is expected to be a formal, machine-parsable - /// representation.If the named language of a TextualRepresentation is machine-parsable, then the body - /// text should be legal input text as defined for that language. The interpretation of the named - /// language string shall be case insensitive. The following language names are defined to correspond to - /// the given standard languages:
kerml Kernel Modeling Language
ocl Object Constraint - /// Language
alf Action Language for fUML
Other specifications may - /// define specific language strings, other than those shown above, to be used to indicate the use of - /// languages from those specifications in KerML TextualRepresentation.If the language of a - /// TextualRepresentation is "kerml", then the body text shall be a legal representation of - /// the representedElement in the KerML textual concrete syntax. A conforming tool can use such a - /// TextualRepresentation Annotation to record the original KerML concrete syntax text from which an - /// Element was parsed. In this case, it is a tool responsibility to ensure that the body of the - /// TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element - /// changes other than by re-parsing the body text.An Element with a TextualRepresentation in a language - /// other than KerML is essentially a semantically "opaque" Element specified in the other - /// language. However, a conforming KerML tool may interpret such an element consistently with the - /// specification of the named language. - ///
- public partial interface ITextualRepresentation : IAnnotatingElement - { - /// - /// The textual representation of the representedElement in the given language. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string Body { get; set; } - - /// - /// The natural or artifical language in which the body text is written. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string Language { get; set; } - - /// - /// Queries the derived property RepresentedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - IElement QueryRepresentedElement(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IUsage.cs deleted file mode 100644 index a38c3dab6..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/IUsage.cs +++ /dev/null @@ -1,312 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Usage is a usage of a Definition.A Usage may have nestedUsages that model features that apply in - /// the context of the owningUsage. A Usage may also have Definitions nested in it, but this has no - /// semantic significance, other than the nested scoping resulting from the Usage being considered as a - /// Namespace for any nested Definitions.However, if a Usage has isVariation = true, then it represents - /// a variation point Usage. In this case, all of its members must be variant Usages, related to the - /// Usage by VariantMembership Relationships. Rather than being features of the Usage, variant Usages - /// model different concrete alternatives that can be chosen to fill in for the variation point - /// Usage.variant = variantMembership.ownedVariantUsagevariantMembership = - /// ownedMembership->selectByKind(VariantMembership)isVariation implies - /// ownedFeatureMembership->isEmpty()isReference = not isCompositeowningVariationUsage <> null implies - /// specializes(owningVariationUsage)isVariation implies not ownedSpecialization.specific->exists( - /// oclIsKindOf(Definition) and oclAsType(Definition).isVariation or - /// oclIsKindOf(Usage) and oclAsType(Usage).isVariation)owningVariationDefinition <> null implies - /// specializes(owningVariationDefinition)directedUsage = - /// directedFeature->selectByKind(Usage)nestedAction = - /// nestedUsage->selectByKind(ActionUsage)nestedAllocation = - /// nestedUsage->selectByKind(AllocationUsage)nestedAnalysisCase = - /// nestedUsage->selectByKind(AnalysisCaseUsage)nestedAttribute = - /// nestedUsage->selectByKind(AttributeUsage)nestedCalculation = - /// nestedUsage->selectByKind(CalculationUsage)nestedCase = - /// nestedUsage->selectByKind(CaseUsage)nestedConcern = - /// nestedUsage->selectByKind(ConcernUsage)nestedConnection = - /// nestedUsage->selectByKind(ConnectorAsUsage)nestedConstraint = - /// nestedUsage->selectByKind(ConstraintUsage)ownedNested = - /// nestedUsage->selectByKind(EnumerationUsage)nestedFlow = - /// nestedUsage->selectByKind(FlowConnectionUsage)nestedInterface = - /// nestedUsage->selectByKind(ReferenceUsage)nestedItem = - /// nestedUsage->selectByKind(ItemUsage)nestedMetadata = - /// nestedUsage->selectByKind(MetadataUsage)nestedOccurrence = - /// nestedUsage->selectByKind(OccurrenceUsage)nestedPart = - /// nestedUsage->selectByKind(PartUsage)nestedPort = nestedUsage->selectByKind(PortUsage)nestedReference - /// = nestedUsage->selectByKind(ReferenceUsage)nestedRendering = - /// nestedUsage->selectByKind(RenderingUsage)nestedRequirement = - /// nestedUsage->selectByKind(RequirementUsage)nestedState = - /// nestedUsage->selectByKind(StateUsage)nestedTransition = - /// nestedUsage->selectByKind(TransitionUsage)nestedUsage = - /// ownedFeature->selectByKind(Usage)nestedUseCase = - /// nestedUsage->selectByKind(UseCaseUsage)nestedVerificationCase = - /// nestedUsage->selectByKind(VerificationCaseUsage)nestedView = - /// nestedUsage->selectByKind(ViewUsage)nestedViewpoint = nestedUsage->selectByKind(ViewpointUsage)usage - /// = feature->selectByKind(Usage)direction <> null or isEnd or featuringType->isEmpty() implies - /// isReferenceisVariation implies isAbstractmayTimeVary = owningType <> null and - /// owningType.specializesFromLibrary('Occurrences::Occurrence') and not ( isPortion or - /// specializesFromLibrary('Links::SelfLink') or - /// specializesFromLibrary('Occurrences::HappensLink') or isComposite and - /// specializesFromLibrary('Actions::Action') )owningVariationUsage <> null implies - /// featuringType->asSet() = owningVariationUsage.featuringType->asSet() - /// - public partial interface IUsage : IFeature - { - /// - /// Queries the derived property Definition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryDefinition(); - - /// - /// Queries the derived property DirectedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryDirectedUsage(); - - /// - /// Queries the derived property IsReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool QueryIsReference(); - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsVariation { get; set; } - - /// - /// Queries the derived property MayTimeVary - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool QueryMayTimeVary(); - - /// - /// Queries the derived property NestedAction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedAction(); - - /// - /// Queries the derived property NestedAllocation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedAllocation(); - - /// - /// Queries the derived property NestedAnalysisCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedAnalysisCase(); - - /// - /// Queries the derived property NestedAttribute - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedAttribute(); - - /// - /// Queries the derived property NestedCalculation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedCalculation(); - - /// - /// Queries the derived property NestedCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedCase(); - - /// - /// Queries the derived property NestedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedConcern(); - - /// - /// Queries the derived property NestedConnection - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedConnection(); - - /// - /// Queries the derived property NestedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedConstraint(); - - /// - /// Queries the derived property NestedEnumeration - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedEnumeration(); - - /// - /// Queries the derived property NestedFlow - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedFlow(); - - /// - /// Queries the derived property NestedInterface - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedInterface(); - - /// - /// Queries the derived property NestedItem - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedItem(); - - /// - /// Queries the derived property NestedMetadata - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedMetadata(); - - /// - /// Queries the derived property NestedOccurrence - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedOccurrence(); - - /// - /// Queries the derived property NestedPart - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedPart(); - - /// - /// Queries the derived property NestedPort - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedPort(); - - /// - /// Queries the derived property NestedReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedReference(); - - /// - /// Queries the derived property NestedRendering - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedRendering(); - - /// - /// Queries the derived property NestedRequirement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedRequirement(); - - /// - /// Queries the derived property NestedState - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedState(); - - /// - /// Queries the derived property NestedTransition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedTransition(); - - /// - /// Queries the derived property NestedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedUsage(); - - /// - /// Queries the derived property NestedUseCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedUseCase(); - - /// - /// Queries the derived property NestedVerificationCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedVerificationCase(); - - /// - /// Queries the derived property NestedView - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedView(); - - /// - /// Queries the derived property NestedViewpoint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryNestedViewpoint(); - - /// - /// Queries the derived property OwningDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Definition QueryOwningDefinition(); - - /// - /// Queries the derived property OwningUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Usage QueryOwningUsage(); - - /// - /// Queries the derived property Usage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryUsage(); - - /// - /// Queries the derived property Variant - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryVariant(); - - /// - /// Queries the derived property VariantMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List QueryVariantMembership(); - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralInteger.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralInteger.cs deleted file mode 100644 index d734f61ae..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralInteger.cs +++ /dev/null @@ -1,762 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralInteger is a LiteralExpression that provides an Integer value as a result. Its result - /// parameter must have the type - /// Integer.specializesFromLibrary('Performances::literalIntegerEvaluations') - /// - public partial class LiteralInteger : ILiteralInteger - { - /// - /// Initializes a new instance of the class. - /// - public LiteralInteger() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property Behavior - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryBehavior() - { - throw new NotImplementedException("Derived property Behavior not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property Function - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Function QueryFunction() - { - throw new NotImplementedException("Derived property Function not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsModelLevelEvaluable - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsModelLevelEvaluable() - { - throw new NotImplementedException("Derived property IsModelLevelEvaluable not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property Parameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryParameter() - { - throw new NotImplementedException("Derived property Parameter not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property Result - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryResult() - { - throw new NotImplementedException("Derived property Result not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// The Integer value that is the result of evaluating this LiteralInteger.The Integer value that is the - /// result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public int Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralRational.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralRational.cs deleted file mode 100644 index c709418a3..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/LiteralRational.cs +++ /dev/null @@ -1,762 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralRational is a LiteralExpression that provides a Rational value as a result. Its result - /// parameter must have the type - /// Rational.specializesFromLibrary('Performances::literalRationalEvaluations') - /// - public partial class LiteralRational : ILiteralRational - { - /// - /// Initializes a new instance of the class. - /// - public LiteralRational() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property Behavior - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryBehavior() - { - throw new NotImplementedException("Derived property Behavior not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property Function - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Function QueryFunction() - { - throw new NotImplementedException("Derived property Function not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsModelLevelEvaluable - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsModelLevelEvaluable() - { - throw new NotImplementedException("Derived property IsModelLevelEvaluable not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property Parameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryParameter() - { - throw new NotImplementedException("Derived property Parameter not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property Result - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryResult() - { - throw new NotImplementedException("Derived property Result not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// The value whose rational approximation is the result of evaluating this LiteralRational.The Real - /// value that is the result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public double Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Membership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Membership.cs deleted file mode 100644 index bdfcc3c29..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Membership.cs +++ /dev/null @@ -1,303 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Membership is a Relationship between a Namespace and an Element that indicates the Element is a - /// member of (i.e., is contained in) the Namespace. Any memberNames specify how the memberElement is - /// identified in the Namespace and the visibility specifies whether or not the memberElement is - /// publicly visible from outside the Namespace.If a Membership is an OwningMembership, then it owns its - /// memberElement, which becomes an ownedMember of the membershipOwningNamespace. Otherwise, the - /// memberNames of a Membership are effectively aliases within the membershipOwningNamespace for an - /// Element with a separate OwningMembership in the same or a different Namespace. memberElementId - /// = memberElement.elementId - /// - public partial class Membership : IMembership - { - /// - /// Initializes a new instance of the class. - /// - public Membership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement MemberElement { get; set; } - - /// - /// Queries the derived property MemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryMemberElementId() - { - throw new NotImplementedException("Derived property MemberElementId not yet supported"); - } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// Queries the derived property MembershipOwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryMembershipOwningNamespace() - { - throw new NotImplementedException("Derived property MembershipOwningNamespace not yet supported"); - } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/MultiplicityRange.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/MultiplicityRange.cs deleted file mode 100644 index c0824b612..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/MultiplicityRange.cs +++ /dev/null @@ -1,752 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A MultiplicityRange is a Multiplicity whose value is defined to be the (inclusive) range of natural - /// numbers given by the result of a lowerBound Expression and the result of an upperBound Expression. - /// The result of these Expressions shall be of type Natural. If the result of the upperBound Expression - /// is the unbounded value *, then the specified range includes all natural numbers greater than or - /// equal to the lowerBound value. If no lowerBound Expression, then the default is that the lower bound - /// has the same value as the upper bound, except if the upperBound evaluates to *, in which case the - /// default for the lower bound is 0.bound->forAll(b | b.featuringType = - /// self.featuringType)bound->forAll(b | b.result.specializesFromLibrary('ScalarValues::Integer') and - /// let value : UnlimitedNatural = valueOf(b) in value <> null implies value >= 0)lowerBound = - /// let ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->size() < 2 then null else ownedExpressions->first() endifupperBound = let - /// ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->isEmpty() then null else if ownedExpressions->size() = 1 then - /// ownedExpressions->at(1) else ownedExpressions->at(2) endif endif bound = if upperBound = - /// null then Sequence{} else if lowerBound = null then Sequence{upperBound} else - /// Sequence{lowerBound, upperBound} endif endifif lowerBound = null then ownedMember->notEmpty() - /// and ownedMember->at(1) = upperBoundelse ownedMember->size() > 1 and ownedMember->at(1) = - /// lowerBound and ownedMember->at(2) = upperBoundendif - /// - public partial class MultiplicityRange : IMultiplicityRange - { - /// - /// Initializes a new instance of the class. - /// - public MultiplicityRange() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property Bound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 2, isMany: false, isRequired: false, isContainment: false)] - public List QueryBound() - { - throw new NotImplementedException("Derived property Bound not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property LowerBound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Expression QueryLowerBound() - { - throw new NotImplementedException("Derived property LowerBound not yet supported"); - } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// Queries the derived property UpperBound - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Expression QueryUpperBound() - { - throw new NotImplementedException("Derived property UpperBound not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/OwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/OwningMembership.cs deleted file mode 100644 index 4a0bb7b3a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/OwningMembership.cs +++ /dev/null @@ -1,334 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The - /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace.ownedMemberName = - /// ownedMemberElement.nameownedMemberShortName = ownedMemberElement.shortName - /// - public partial class OwningMembership : IOwningMembership - { - /// - /// Initializes a new instance of the class. - /// - public OwningMembership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement MemberElement { get; set; } - - /// - /// Queries the derived property MemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryMemberElementId() - { - throw new NotImplementedException("Derived property MemberElementId not yet supported"); - } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// Queries the derived property MembershipOwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryMembershipOwningNamespace() - { - throw new NotImplementedException("Derived property MembershipOwningNamespace not yet supported"); - } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwnedMemberElement() - { - throw new NotImplementedException("Derived property OwnedMemberElement not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberElementId - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberElementId() - { - throw new NotImplementedException("Derived property OwnedMemberElementId not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberName() - { - throw new NotImplementedException("Derived property OwnedMemberName not yet supported"); - } - - /// - /// Queries the derived property OwnedMemberShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryOwnedMemberShortName() - { - throw new NotImplementedException("Derived property OwnedMemberShortName not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ReferenceSubsetting.cs deleted file mode 100644 index 934b9245e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/ReferenceSubsetting.cs +++ /dev/null @@ -1,314 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// ReferenceSubsetting is a kind of Subsetting in which the referencedFeature is syntactically - /// distinguished from other Features subsetted by the referencingFeature. ReferenceSubsetting has the - /// same semantics as Subsetting, but the referencedFeature may have a special purpose relative to the - /// referencingFeature. For instance, ReferenceSubsetting is used to identify the relatedFeatures of a - /// Connector.ReferenceSubsetting is always an ownedRelationship of its referencingFeature. A Feature - /// can have at most one ownedReferenceSubsetting. - /// - public partial class ReferenceSubsetting : IReferenceSubsetting - { - /// - /// Initializes a new instance of the class. - /// - public ReferenceSubsetting() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryOwningFeature() - { - throw new NotImplementedException("Derived property OwningFeature not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// The Feature that is referenced by the referencingFeature of this ReferenceSubsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature ReferencedFeature { get; set; } - - /// - /// Queries the derived property ReferencingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryReferencingFeature() - { - throw new NotImplementedException("Derived property ReferencingFeature not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type Specific { get; set; } - - /// - /// The Feature that is subsetted by the subsettingFeature of this Subsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature SubsettedFeature { get; set; } - - /// - /// The Feature that is a subset of the subsettedFeature of this Subsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature SubsettingFeature { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RenderingUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RenderingUsage.cs deleted file mode 100644 index c5582ab92..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RenderingUsage.cs +++ /dev/null @@ -1,1105 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A RenderingUsage is the usage of a RenderingDefinition to specify the rendering of a specific model - /// view to produce a physical view artifact.specializesFromLibrary('Views::renderings')owningType <> - /// null and(owningType.oclIsKindOf(RenderingDefinition) or owningType.oclIsKindOf(RenderingUsage)) - /// implies specializesFromLibrary('Views::Rendering::subrenderings')owningFeatureMembership <> null - /// andowningFeatureMembership.oclIsKindOf(ViewRenderingMembership) implies - /// redefinesFromLibrary('Views::View::viewRendering') - /// - public partial class RenderingUsage : IRenderingUsage - { - /// - /// Initializes a new instance of the class. - /// - public RenderingUsage() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsIndividual = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Definition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDefinition() - { - throw new NotImplementedException("Derived property Definition not yet supported"); - } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Queries the derived property DirectedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedUsage() - { - throw new NotImplementedException("Derived property DirectedUsage not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property IndividualDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OccurrenceDefinition QueryIndividualDefinition() - { - throw new NotImplementedException("Derived property IndividualDefinition not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether this OccurrenceUsage represents the usage of the specific individual represented by its - /// individualDefinition. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsIndividual { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Queries the derived property IsReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsReference() - { - throw new NotImplementedException("Derived property IsReference not yet supported"); - } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// Queries the derived property ItemDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryItemDefinition() - { - throw new NotImplementedException("Derived property ItemDefinition not yet supported"); - } - - /// - /// Queries the derived property MayTimeVary - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryMayTimeVary() - { - throw new NotImplementedException("Derived property MayTimeVary not yet supported"); - } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property NestedAction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAction() - { - throw new NotImplementedException("Derived property NestedAction not yet supported"); - } - - /// - /// Queries the derived property NestedAllocation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAllocation() - { - throw new NotImplementedException("Derived property NestedAllocation not yet supported"); - } - - /// - /// Queries the derived property NestedAnalysisCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAnalysisCase() - { - throw new NotImplementedException("Derived property NestedAnalysisCase not yet supported"); - } - - /// - /// Queries the derived property NestedAttribute - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAttribute() - { - throw new NotImplementedException("Derived property NestedAttribute not yet supported"); - } - - /// - /// Queries the derived property NestedCalculation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCalculation() - { - throw new NotImplementedException("Derived property NestedCalculation not yet supported"); - } - - /// - /// Queries the derived property NestedCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCase() - { - throw new NotImplementedException("Derived property NestedCase not yet supported"); - } - - /// - /// Queries the derived property NestedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConcern() - { - throw new NotImplementedException("Derived property NestedConcern not yet supported"); - } - - /// - /// Queries the derived property NestedConnection - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConnection() - { - throw new NotImplementedException("Derived property NestedConnection not yet supported"); - } - - /// - /// Queries the derived property NestedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConstraint() - { - throw new NotImplementedException("Derived property NestedConstraint not yet supported"); - } - - /// - /// Queries the derived property NestedEnumeration - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedEnumeration() - { - throw new NotImplementedException("Derived property NestedEnumeration not yet supported"); - } - - /// - /// Queries the derived property NestedFlow - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedFlow() - { - throw new NotImplementedException("Derived property NestedFlow not yet supported"); - } - - /// - /// Queries the derived property NestedInterface - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedInterface() - { - throw new NotImplementedException("Derived property NestedInterface not yet supported"); - } - - /// - /// Queries the derived property NestedItem - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedItem() - { - throw new NotImplementedException("Derived property NestedItem not yet supported"); - } - - /// - /// Queries the derived property NestedMetadata - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedMetadata() - { - throw new NotImplementedException("Derived property NestedMetadata not yet supported"); - } - - /// - /// Queries the derived property NestedOccurrence - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedOccurrence() - { - throw new NotImplementedException("Derived property NestedOccurrence not yet supported"); - } - - /// - /// Queries the derived property NestedPart - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPart() - { - throw new NotImplementedException("Derived property NestedPart not yet supported"); - } - - /// - /// Queries the derived property NestedPort - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPort() - { - throw new NotImplementedException("Derived property NestedPort not yet supported"); - } - - /// - /// Queries the derived property NestedReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedReference() - { - throw new NotImplementedException("Derived property NestedReference not yet supported"); - } - - /// - /// Queries the derived property NestedRendering - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRendering() - { - throw new NotImplementedException("Derived property NestedRendering not yet supported"); - } - - /// - /// Queries the derived property NestedRequirement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRequirement() - { - throw new NotImplementedException("Derived property NestedRequirement not yet supported"); - } - - /// - /// Queries the derived property NestedState - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedState() - { - throw new NotImplementedException("Derived property NestedState not yet supported"); - } - - /// - /// Queries the derived property NestedTransition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedTransition() - { - throw new NotImplementedException("Derived property NestedTransition not yet supported"); - } - - /// - /// Queries the derived property NestedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUsage() - { - throw new NotImplementedException("Derived property NestedUsage not yet supported"); - } - - /// - /// Queries the derived property NestedUseCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUseCase() - { - throw new NotImplementedException("Derived property NestedUseCase not yet supported"); - } - - /// - /// Queries the derived property NestedVerificationCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedVerificationCase() - { - throw new NotImplementedException("Derived property NestedVerificationCase not yet supported"); - } - - /// - /// Queries the derived property NestedView - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedView() - { - throw new NotImplementedException("Derived property NestedView not yet supported"); - } - - /// - /// Queries the derived property NestedViewpoint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedViewpoint() - { - throw new NotImplementedException("Derived property NestedViewpoint not yet supported"); - } - - /// - /// Queries the derived property OccurrenceDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOccurrenceDefinition() - { - throw new NotImplementedException("Derived property OccurrenceDefinition not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Definition QueryOwningDefinition() - { - throw new NotImplementedException("Derived property OwningDefinition not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property OwningUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Usage QueryOwningUsage() - { - throw new NotImplementedException("Derived property OwningUsage not yet supported"); - } - - /// - /// Queries the derived property PartDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryPartDefinition() - { - throw new NotImplementedException("Derived property PartDefinition not yet supported"); - } - - /// - /// The kind of temporal portion (time slice or snapshot) is represented by this OccurrenceUsage. If - /// portionKind is not null, then the owningType of the OccurrenceUsage must be non-null, and the - /// OccurrenceUsage represents portions of the featuring instance of the owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public PortionKind? PortionKind { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RenderingDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public RenderingDefinition QueryRenderingDefinition() - { - throw new NotImplementedException("Derived property RenderingDefinition not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// Queries the derived property Usage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUsage() - { - throw new NotImplementedException("Derived property Usage not yet supported"); - } - - /// - /// Queries the derived property Variant - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariant() - { - throw new NotImplementedException("Derived property Variant not yet supported"); - } - - /// - /// Queries the derived property VariantMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariantMembership() - { - throw new NotImplementedException("Derived property VariantMembership not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RequirementUsage.cs deleted file mode 100644 index fd3a3ff93..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/RequirementUsage.cs +++ /dev/null @@ -1,1238 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A RequirementUsage is a Usage of a RequirementDefinition.actorParameter = featureMembership-> - /// selectByKind(ActorMembership). ownedActorParameterassumedConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::assumption). ownedConstraintframedConcern = featureMembership-> - /// selectByKind(FramedConcernMembership). ownedConcernrequiredConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::requirement). ownedConstraintstakeholderParameter = - /// featureMembership-> selectByKind(AStakholderMembership). - /// ownedStakeholderParametersubjectParameter = let subjects : OrderedSet(SubjectMembership) = - /// featureMembership->selectByKind(SubjectMembership) in if subjects->isEmpty() then null else - /// subjects->first().ownedSubjectParameter endiftext = documentation.bodyfeatureMembership-> - /// selectByKind(SubjectMembership)-> size() <= 1input->notEmpty() and input->first() = - /// subjectParameterspecializesFromLibrary('Requirements::requirementChecks')isComposite and owningType - /// <> null and (owningType.oclIsKindOf(RequirementDefinition) or - /// owningType.oclIsKindOf(RequirementUsage)) implies - /// specializesFromLibrary('Requirements::RequirementCheck::subrequirements')owningfeatureMembership <> - /// null andowningfeatureMembership.oclIsKindOf(ObjectiveMembership) implies - /// owningType.ownedSpecialization.general->forAll(gen | (gen.oclIsKindOf(CaseDefinition) implies - /// redefines(gen.oclAsType(CaseDefinition).objectiveRequirement)) and - /// (gen.oclIsKindOf(CaseUsage) implies - /// redefines(gen.oclAsType(CaseUsage).objectiveRequirement))owningFeatureMembership <> null - /// andowningFeatureMembership.oclIsKindOf(RequirementVerificationMembership) implies - /// specializesFromLibrary('VerificationCases::VerificationCase::obj::requirementVerifications') - /// - public partial class RequirementUsage : IRequirementUsage - { - /// - /// Initializes a new instance of the class. - /// - public RequirementUsage() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsIndividual = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Queries the derived property ActorParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryActorParameter() - { - throw new NotImplementedException("Derived property ActorParameter not yet supported"); - } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property AssumedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAssumedConstraint() - { - throw new NotImplementedException("Derived property AssumedConstraint not yet supported"); - } - - /// - /// Queries the derived property Behavior - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryBehavior() - { - throw new NotImplementedException("Derived property Behavior not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property ConstraintDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Predicate QueryConstraintDefinition() - { - throw new NotImplementedException("Derived property ConstraintDefinition not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Definition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDefinition() - { - throw new NotImplementedException("Derived property Definition not yet supported"); - } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Queries the derived property DirectedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedUsage() - { - throw new NotImplementedException("Derived property DirectedUsage not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property FramedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFramedConcern() - { - throw new NotImplementedException("Derived property FramedConcern not yet supported"); - } - - /// - /// Queries the derived property Function - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Function QueryFunction() - { - throw new NotImplementedException("Derived property Function not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property IndividualDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OccurrenceDefinition QueryIndividualDefinition() - { - throw new NotImplementedException("Derived property IndividualDefinition not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether this OccurrenceUsage represents the usage of the specific individual represented by its - /// individualDefinition. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsIndividual { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsModelLevelEvaluable - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsModelLevelEvaluable() - { - throw new NotImplementedException("Derived property IsModelLevelEvaluable not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Queries the derived property IsReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsReference() - { - throw new NotImplementedException("Derived property IsReference not yet supported"); - } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// Queries the derived property MayTimeVary - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryMayTimeVary() - { - throw new NotImplementedException("Derived property MayTimeVary not yet supported"); - } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property NestedAction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAction() - { - throw new NotImplementedException("Derived property NestedAction not yet supported"); - } - - /// - /// Queries the derived property NestedAllocation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAllocation() - { - throw new NotImplementedException("Derived property NestedAllocation not yet supported"); - } - - /// - /// Queries the derived property NestedAnalysisCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAnalysisCase() - { - throw new NotImplementedException("Derived property NestedAnalysisCase not yet supported"); - } - - /// - /// Queries the derived property NestedAttribute - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAttribute() - { - throw new NotImplementedException("Derived property NestedAttribute not yet supported"); - } - - /// - /// Queries the derived property NestedCalculation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCalculation() - { - throw new NotImplementedException("Derived property NestedCalculation not yet supported"); - } - - /// - /// Queries the derived property NestedCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCase() - { - throw new NotImplementedException("Derived property NestedCase not yet supported"); - } - - /// - /// Queries the derived property NestedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConcern() - { - throw new NotImplementedException("Derived property NestedConcern not yet supported"); - } - - /// - /// Queries the derived property NestedConnection - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConnection() - { - throw new NotImplementedException("Derived property NestedConnection not yet supported"); - } - - /// - /// Queries the derived property NestedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConstraint() - { - throw new NotImplementedException("Derived property NestedConstraint not yet supported"); - } - - /// - /// Queries the derived property NestedEnumeration - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedEnumeration() - { - throw new NotImplementedException("Derived property NestedEnumeration not yet supported"); - } - - /// - /// Queries the derived property NestedFlow - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedFlow() - { - throw new NotImplementedException("Derived property NestedFlow not yet supported"); - } - - /// - /// Queries the derived property NestedInterface - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedInterface() - { - throw new NotImplementedException("Derived property NestedInterface not yet supported"); - } - - /// - /// Queries the derived property NestedItem - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedItem() - { - throw new NotImplementedException("Derived property NestedItem not yet supported"); - } - - /// - /// Queries the derived property NestedMetadata - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedMetadata() - { - throw new NotImplementedException("Derived property NestedMetadata not yet supported"); - } - - /// - /// Queries the derived property NestedOccurrence - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedOccurrence() - { - throw new NotImplementedException("Derived property NestedOccurrence not yet supported"); - } - - /// - /// Queries the derived property NestedPart - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPart() - { - throw new NotImplementedException("Derived property NestedPart not yet supported"); - } - - /// - /// Queries the derived property NestedPort - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPort() - { - throw new NotImplementedException("Derived property NestedPort not yet supported"); - } - - /// - /// Queries the derived property NestedReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedReference() - { - throw new NotImplementedException("Derived property NestedReference not yet supported"); - } - - /// - /// Queries the derived property NestedRendering - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRendering() - { - throw new NotImplementedException("Derived property NestedRendering not yet supported"); - } - - /// - /// Queries the derived property NestedRequirement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRequirement() - { - throw new NotImplementedException("Derived property NestedRequirement not yet supported"); - } - - /// - /// Queries the derived property NestedState - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedState() - { - throw new NotImplementedException("Derived property NestedState not yet supported"); - } - - /// - /// Queries the derived property NestedTransition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedTransition() - { - throw new NotImplementedException("Derived property NestedTransition not yet supported"); - } - - /// - /// Queries the derived property NestedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUsage() - { - throw new NotImplementedException("Derived property NestedUsage not yet supported"); - } - - /// - /// Queries the derived property NestedUseCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUseCase() - { - throw new NotImplementedException("Derived property NestedUseCase not yet supported"); - } - - /// - /// Queries the derived property NestedVerificationCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedVerificationCase() - { - throw new NotImplementedException("Derived property NestedVerificationCase not yet supported"); - } - - /// - /// Queries the derived property NestedView - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedView() - { - throw new NotImplementedException("Derived property NestedView not yet supported"); - } - - /// - /// Queries the derived property NestedViewpoint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedViewpoint() - { - throw new NotImplementedException("Derived property NestedViewpoint not yet supported"); - } - - /// - /// Queries the derived property OccurrenceDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOccurrenceDefinition() - { - throw new NotImplementedException("Derived property OccurrenceDefinition not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Definition QueryOwningDefinition() - { - throw new NotImplementedException("Derived property OwningDefinition not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property OwningUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Usage QueryOwningUsage() - { - throw new NotImplementedException("Derived property OwningUsage not yet supported"); - } - - /// - /// Queries the derived property Parameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryParameter() - { - throw new NotImplementedException("Derived property Parameter not yet supported"); - } - - /// - /// The kind of temporal portion (time slice or snapshot) is represented by this OccurrenceUsage. If - /// portionKind is not null, then the owningType of the OccurrenceUsage must be non-null, and the - /// OccurrenceUsage represents portions of the featuring instance of the owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public PortionKind? PortionKind { get; set; } - - /// - /// Queries the derived property Predicate - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Predicate QueryPredicate() - { - throw new NotImplementedException("Derived property Predicate not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// An optional modeler-specified identifier for this RequirementUsage (used, e.g., to link it to an - /// original requirement text in some source document), which is the declaredShortName for the - /// RequirementUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ReqId { get; set; } - - /// - /// Queries the derived property RequiredConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRequiredConstraint() - { - throw new NotImplementedException("Derived property RequiredConstraint not yet supported"); - } - - /// - /// Queries the derived property RequirementDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public RequirementDefinition QueryRequirementDefinition() - { - throw new NotImplementedException("Derived property RequirementDefinition not yet supported"); - } - - /// - /// Queries the derived property Result - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryResult() - { - throw new NotImplementedException("Derived property Result not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property StakeholderParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryStakeholderParameter() - { - throw new NotImplementedException("Derived property StakeholderParameter not yet supported"); - } - - /// - /// Queries the derived property SubjectParameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Usage QuerySubjectParameter() - { - throw new NotImplementedException("Derived property SubjectParameter not yet supported"); - } - - /// - /// Queries the derived property Text - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryText() - { - throw new NotImplementedException("Derived property Text not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// Queries the derived property Usage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUsage() - { - throw new NotImplementedException("Derived property Usage not yet supported"); - } - - /// - /// Queries the derived property Variant - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariant() - { - throw new NotImplementedException("Derived property Variant not yet supported"); - } - - /// - /// Queries the derived property VariantMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariantMembership() - { - throw new NotImplementedException("Derived property VariantMembership not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/SelectExpression.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/SelectExpression.cs deleted file mode 100644 index 13d63f9ff..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/SelectExpression.cs +++ /dev/null @@ -1,789 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A SelectExpression is an OperatorExpression whose operator is "select", which resolves to the - /// Function ControlFunctions::select from the Kernel Functions Library.operator = - /// 'select'arguments->notEmpty() implies result.specializes(arguments->first().result) - /// - public partial class SelectExpression : ISelectExpression - { - /// - /// Initializes a new instance of the class. - /// - public SelectExpression() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property Argument - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryArgument() - { - throw new NotImplementedException("Derived property Argument not yet supported"); - } - - /// - /// Queries the derived property Behavior - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryBehavior() - { - throw new NotImplementedException("Derived property Behavior not yet supported"); - } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property Function - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Function QueryFunction() - { - throw new NotImplementedException("Derived property Function not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property InstantiatedType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryInstantiatedType() - { - throw new NotImplementedException("Derived property InstantiatedType not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsModelLevelEvaluable - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsModelLevelEvaluable() - { - throw new NotImplementedException("Derived property IsModelLevelEvaluable not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property Operand - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List QueryOperand() - { - throw new NotImplementedException("Derived property Operand not yet supported"); - } - - /// - /// An operator symbol that names a corresponding Function from one of the standard packages from the - /// Kernel Function Library . - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Operator { get; set; } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property Parameter - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryParameter() - { - throw new NotImplementedException("Derived property Parameter not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property Result - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryResult() - { - throw new NotImplementedException("Derived property Result not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Subclassification.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Subclassification.cs deleted file mode 100644 index 8cece05ac..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Subclassification.cs +++ /dev/null @@ -1,295 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// Subclassification is Specialization in which both the specific and general Types are Classifier. - /// This means all instances of the specific Classifier are also instances of the general Classifier. - /// - public partial class Subclassification : ISubclassification - { - /// - /// Initializes a new instance of the class. - /// - public Subclassification() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningClassifier - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Classifier QueryOwningClassifier() - { - throw new NotImplementedException("Derived property OwningClassifier not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RelatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryRelatedElement() - { - throw new NotImplementedException("Derived property RelatedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type Specific { get; set; } - - /// - /// The more specific Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Classifier Subclassifier { get; set; } - - /// - /// The more general Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Classifier Superclassifier { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/TextualRepresentation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/TextualRepresentation.cs deleted file mode 100644 index d186c287e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/TextualRepresentation.cs +++ /dev/null @@ -1,288 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A TextualRepresentation is an AnnotatingElement whose body represents the representedElement in a - /// given language. The representedElement must be the owner of the TextualRepresentation. The named - /// language can be a natural language, in which case the body is an informal representation, or an - /// artificial language, in which case the body is expected to be a formal, machine-parsable - /// representation.If the named language of a TextualRepresentation is machine-parsable, then the body - /// text should be legal input text as defined for that language. The interpretation of the named - /// language string shall be case insensitive. The following language names are defined to correspond to - /// the given standard languages:
kerml Kernel Modeling Language
ocl Object Constraint - /// Language
alf Action Language for fUML
Other specifications may - /// define specific language strings, other than those shown above, to be used to indicate the use of - /// languages from those specifications in KerML TextualRepresentation.If the language of a - /// TextualRepresentation is "kerml", then the body text shall be a legal representation of - /// the representedElement in the KerML textual concrete syntax. A conforming tool can use such a - /// TextualRepresentation Annotation to record the original KerML concrete syntax text from which an - /// Element was parsed. In this case, it is a tool responsibility to ensure that the body of the - /// TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element - /// changes other than by re-parsing the body text.An Element with a TextualRepresentation in a language - /// other than KerML is essentially a semantically "opaque" Element specified in the other - /// language. However, a conforming KerML tool may interpret such an element consistently with the - /// specification of the named language. - ///
- public partial class TextualRepresentation : ITextualRepresentation - { - /// - /// Initializes a new instance of the class. - /// - public TextualRepresentation() - { - this.AliasIds = new List(); - this.IsImpliedIncluded = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property AnnotatedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAnnotatedElement() - { - throw new NotImplementedException("Derived property AnnotatedElement not yet supported"); - } - - /// - /// Queries the derived property Annotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryAnnotation() - { - throw new NotImplementedException("Derived property Annotation not yet supported"); - } - - /// - /// The textual representation of the representedElement in the given language. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Body { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// The natural or artifical language in which the body text is written. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Language { get; set; } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotatingRelationship() - { - throw new NotImplementedException("Derived property OwnedAnnotatingRelationship not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningAnnotatingRelationship - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Annotation QueryOwningAnnotatingRelationship() - { - throw new NotImplementedException("Derived property OwningAnnotatingRelationship not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property RepresentedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryRepresentedElement() - { - throw new NotImplementedException("Derived property RepresentedElement not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Usage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Usage.cs deleted file mode 100644 index 532499218..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutGenPoco/Usage.cs +++ /dev/null @@ -1,1085 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.POCO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Usage is a usage of a Definition.A Usage may have nestedUsages that model features that apply in - /// the context of the owningUsage. A Usage may also have Definitions nested in it, but this has no - /// semantic significance, other than the nested scoping resulting from the Usage being considered as a - /// Namespace for any nested Definitions.However, if a Usage has isVariation = true, then it represents - /// a variation point Usage. In this case, all of its members must be variant Usages, related to the - /// Usage by VariantMembership Relationships. Rather than being features of the Usage, variant Usages - /// model different concrete alternatives that can be chosen to fill in for the variation point - /// Usage.variant = variantMembership.ownedVariantUsagevariantMembership = - /// ownedMembership->selectByKind(VariantMembership)isVariation implies - /// ownedFeatureMembership->isEmpty()isReference = not isCompositeowningVariationUsage <> null implies - /// specializes(owningVariationUsage)isVariation implies not ownedSpecialization.specific->exists( - /// oclIsKindOf(Definition) and oclAsType(Definition).isVariation or - /// oclIsKindOf(Usage) and oclAsType(Usage).isVariation)owningVariationDefinition <> null implies - /// specializes(owningVariationDefinition)directedUsage = - /// directedFeature->selectByKind(Usage)nestedAction = - /// nestedUsage->selectByKind(ActionUsage)nestedAllocation = - /// nestedUsage->selectByKind(AllocationUsage)nestedAnalysisCase = - /// nestedUsage->selectByKind(AnalysisCaseUsage)nestedAttribute = - /// nestedUsage->selectByKind(AttributeUsage)nestedCalculation = - /// nestedUsage->selectByKind(CalculationUsage)nestedCase = - /// nestedUsage->selectByKind(CaseUsage)nestedConcern = - /// nestedUsage->selectByKind(ConcernUsage)nestedConnection = - /// nestedUsage->selectByKind(ConnectorAsUsage)nestedConstraint = - /// nestedUsage->selectByKind(ConstraintUsage)ownedNested = - /// nestedUsage->selectByKind(EnumerationUsage)nestedFlow = - /// nestedUsage->selectByKind(FlowConnectionUsage)nestedInterface = - /// nestedUsage->selectByKind(ReferenceUsage)nestedItem = - /// nestedUsage->selectByKind(ItemUsage)nestedMetadata = - /// nestedUsage->selectByKind(MetadataUsage)nestedOccurrence = - /// nestedUsage->selectByKind(OccurrenceUsage)nestedPart = - /// nestedUsage->selectByKind(PartUsage)nestedPort = nestedUsage->selectByKind(PortUsage)nestedReference - /// = nestedUsage->selectByKind(ReferenceUsage)nestedRendering = - /// nestedUsage->selectByKind(RenderingUsage)nestedRequirement = - /// nestedUsage->selectByKind(RequirementUsage)nestedState = - /// nestedUsage->selectByKind(StateUsage)nestedTransition = - /// nestedUsage->selectByKind(TransitionUsage)nestedUsage = - /// ownedFeature->selectByKind(Usage)nestedUseCase = - /// nestedUsage->selectByKind(UseCaseUsage)nestedVerificationCase = - /// nestedUsage->selectByKind(VerificationCaseUsage)nestedView = - /// nestedUsage->selectByKind(ViewUsage)nestedViewpoint = nestedUsage->selectByKind(ViewpointUsage)usage - /// = feature->selectByKind(Usage)direction <> null or isEnd or featuringType->isEmpty() implies - /// isReferenceisVariation implies isAbstractmayTimeVary = owningType <> null and - /// owningType.specializesFromLibrary('Occurrences::Occurrence') and not ( isPortion or - /// specializesFromLibrary('Links::SelfLink') or - /// specializesFromLibrary('Occurrences::HappensLink') or isComposite and - /// specializesFromLibrary('Actions::Action') )owningVariationUsage <> null implies - /// featuringType->asSet() = owningVariationUsage.featuringType->asSet() - /// - public partial class Usage : IUsage - { - /// - /// Initializes a new instance of the class. - /// - public Usage() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// Queries the derived property ChainingFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: false, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryChainingFeature() - { - throw new NotImplementedException("Derived property ChainingFeature not yet supported"); - } - - /// - /// Queries the derived property CrossFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryCrossFeature() - { - throw new NotImplementedException("Derived property CrossFeature not yet supported"); - } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Queries the derived property Definition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDefinition() - { - throw new NotImplementedException("Derived property Definition not yet supported"); - } - - /// - /// Queries the derived property DifferencingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDifferencingType() - { - throw new NotImplementedException("Derived property DifferencingType not yet supported"); - } - - /// - /// Queries the derived property DirectedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedFeature() - { - throw new NotImplementedException("Derived property DirectedFeature not yet supported"); - } - - /// - /// Queries the derived property DirectedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDirectedUsage() - { - throw new NotImplementedException("Derived property DirectedUsage not yet supported"); - } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// Queries the derived property Documentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryDocumentation() - { - throw new NotImplementedException("Derived property Documentation not yet supported"); - } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Queries the derived property EndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryEndFeature() - { - throw new NotImplementedException("Derived property EndFeature not yet supported"); - } - - /// - /// Queries the derived property EndOwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryEndOwningType() - { - throw new NotImplementedException("Derived property EndOwningType not yet supported"); - } - - /// - /// Queries the derived property Feature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeature() - { - throw new NotImplementedException("Derived property Feature not yet supported"); - } - - /// - /// Queries the derived property FeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeatureMembership() - { - throw new NotImplementedException("Derived property FeatureMembership not yet supported"); - } - - /// - /// Queries the derived property FeatureTarget - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Feature QueryFeatureTarget() - { - throw new NotImplementedException("Derived property FeatureTarget not yet supported"); - } - - /// - /// Queries the derived property FeaturingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryFeaturingType() - { - throw new NotImplementedException("Derived property FeaturingType not yet supported"); - } - - /// - /// Queries the derived property ImportedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryImportedMembership() - { - throw new NotImplementedException("Derived property ImportedMembership not yet supported"); - } - - /// - /// Queries the derived property InheritedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedFeature() - { - throw new NotImplementedException("Derived property InheritedFeature not yet supported"); - } - - /// - /// Queries the derived property InheritedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInheritedMembership() - { - throw new NotImplementedException("Derived property InheritedMembership not yet supported"); - } - - /// - /// Queries the derived property Input - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryInput() - { - throw new NotImplementedException("Derived property Input not yet supported"); - } - - /// - /// Queries the derived property IntersectingType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryIntersectingType() - { - throw new NotImplementedException("Derived property IntersectingType not yet supported"); - } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// Queries the derived property IsConjugated - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsConjugated() - { - throw new NotImplementedException("Derived property IsConjugated not yet supported"); - } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Queries the derived property IsLibraryElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsLibraryElement() - { - throw new NotImplementedException("Derived property IsLibraryElement not yet supported"); - } - - /// - /// Queries the derived property IsNonunique - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsNonunique() - { - throw new NotImplementedException("Derived property IsNonunique not yet supported"); - } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Queries the derived property IsReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryIsReference() - { - throw new NotImplementedException("Derived property IsReference not yet supported"); - } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// Queries the derived property MayTimeVary - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool QueryMayTimeVary() - { - throw new NotImplementedException("Derived property MayTimeVary not yet supported"); - } - - /// - /// Queries the derived property Member - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMember() - { - throw new NotImplementedException("Derived property Member not yet supported"); - } - - /// - /// Queries the derived property Membership - /// - [EFeature(isChangeable: false, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryMembership() - { - throw new NotImplementedException("Derived property Membership not yet supported"); - } - - /// - /// Queries the derived property Multiplicity - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Multiplicity QueryMultiplicity() - { - throw new NotImplementedException("Derived property Multiplicity not yet supported"); - } - - /// - /// Queries the derived property Name - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryName() - { - throw new NotImplementedException("Derived property Name not yet supported"); - } - - /// - /// Queries the derived property NestedAction - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAction() - { - throw new NotImplementedException("Derived property NestedAction not yet supported"); - } - - /// - /// Queries the derived property NestedAllocation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAllocation() - { - throw new NotImplementedException("Derived property NestedAllocation not yet supported"); - } - - /// - /// Queries the derived property NestedAnalysisCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAnalysisCase() - { - throw new NotImplementedException("Derived property NestedAnalysisCase not yet supported"); - } - - /// - /// Queries the derived property NestedAttribute - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedAttribute() - { - throw new NotImplementedException("Derived property NestedAttribute not yet supported"); - } - - /// - /// Queries the derived property NestedCalculation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCalculation() - { - throw new NotImplementedException("Derived property NestedCalculation not yet supported"); - } - - /// - /// Queries the derived property NestedCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedCase() - { - throw new NotImplementedException("Derived property NestedCase not yet supported"); - } - - /// - /// Queries the derived property NestedConcern - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConcern() - { - throw new NotImplementedException("Derived property NestedConcern not yet supported"); - } - - /// - /// Queries the derived property NestedConnection - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConnection() - { - throw new NotImplementedException("Derived property NestedConnection not yet supported"); - } - - /// - /// Queries the derived property NestedConstraint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedConstraint() - { - throw new NotImplementedException("Derived property NestedConstraint not yet supported"); - } - - /// - /// Queries the derived property NestedEnumeration - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedEnumeration() - { - throw new NotImplementedException("Derived property NestedEnumeration not yet supported"); - } - - /// - /// Queries the derived property NestedFlow - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedFlow() - { - throw new NotImplementedException("Derived property NestedFlow not yet supported"); - } - - /// - /// Queries the derived property NestedInterface - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedInterface() - { - throw new NotImplementedException("Derived property NestedInterface not yet supported"); - } - - /// - /// Queries the derived property NestedItem - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedItem() - { - throw new NotImplementedException("Derived property NestedItem not yet supported"); - } - - /// - /// Queries the derived property NestedMetadata - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedMetadata() - { - throw new NotImplementedException("Derived property NestedMetadata not yet supported"); - } - - /// - /// Queries the derived property NestedOccurrence - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedOccurrence() - { - throw new NotImplementedException("Derived property NestedOccurrence not yet supported"); - } - - /// - /// Queries the derived property NestedPart - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPart() - { - throw new NotImplementedException("Derived property NestedPart not yet supported"); - } - - /// - /// Queries the derived property NestedPort - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedPort() - { - throw new NotImplementedException("Derived property NestedPort not yet supported"); - } - - /// - /// Queries the derived property NestedReference - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedReference() - { - throw new NotImplementedException("Derived property NestedReference not yet supported"); - } - - /// - /// Queries the derived property NestedRendering - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRendering() - { - throw new NotImplementedException("Derived property NestedRendering not yet supported"); - } - - /// - /// Queries the derived property NestedRequirement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedRequirement() - { - throw new NotImplementedException("Derived property NestedRequirement not yet supported"); - } - - /// - /// Queries the derived property NestedState - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedState() - { - throw new NotImplementedException("Derived property NestedState not yet supported"); - } - - /// - /// Queries the derived property NestedTransition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedTransition() - { - throw new NotImplementedException("Derived property NestedTransition not yet supported"); - } - - /// - /// Queries the derived property NestedUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUsage() - { - throw new NotImplementedException("Derived property NestedUsage not yet supported"); - } - - /// - /// Queries the derived property NestedUseCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedUseCase() - { - throw new NotImplementedException("Derived property NestedUseCase not yet supported"); - } - - /// - /// Queries the derived property NestedVerificationCase - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedVerificationCase() - { - throw new NotImplementedException("Derived property NestedVerificationCase not yet supported"); - } - - /// - /// Queries the derived property NestedView - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedView() - { - throw new NotImplementedException("Derived property NestedView not yet supported"); - } - - /// - /// Queries the derived property NestedViewpoint - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryNestedViewpoint() - { - throw new NotImplementedException("Derived property NestedViewpoint not yet supported"); - } - - /// - /// Queries the derived property Output - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOutput() - { - throw new NotImplementedException("Derived property Output not yet supported"); - } - - /// - /// Queries the derived property OwnedAnnotation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedAnnotation() - { - throw new NotImplementedException("Derived property OwnedAnnotation not yet supported"); - } - - /// - /// Queries the derived property OwnedConjugator - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Conjugation QueryOwnedConjugator() - { - throw new NotImplementedException("Derived property OwnedConjugator not yet supported"); - } - - /// - /// Queries the derived property OwnedCrossSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public CrossSubsetting QueryOwnedCrossSubsetting() - { - throw new NotImplementedException("Derived property OwnedCrossSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedDifferencing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDifferencing() - { - throw new NotImplementedException("Derived property OwnedDifferencing not yet supported"); - } - - /// - /// Queries the derived property OwnedDisjoining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedDisjoining() - { - throw new NotImplementedException("Derived property OwnedDisjoining not yet supported"); - } - - /// - /// Queries the derived property OwnedElement - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedElement() - { - throw new NotImplementedException("Derived property OwnedElement not yet supported"); - } - - /// - /// Queries the derived property OwnedEndFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedEndFeature() - { - throw new NotImplementedException("Derived property OwnedEndFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeature - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeature() - { - throw new NotImplementedException("Derived property OwnedFeature not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureChaining - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureChaining() - { - throw new NotImplementedException("Derived property OwnedFeatureChaining not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureInverting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureInverting() - { - throw new NotImplementedException("Derived property OwnedFeatureInverting not yet supported"); - } - - /// - /// Queries the derived property OwnedFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedFeatureMembership() - { - throw new NotImplementedException("Derived property OwnedFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedImport - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedImport() - { - throw new NotImplementedException("Derived property OwnedImport not yet supported"); - } - - /// - /// Queries the derived property OwnedIntersecting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedIntersecting() - { - throw new NotImplementedException("Derived property OwnedIntersecting not yet supported"); - } - - /// - /// Queries the derived property OwnedMember - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMember() - { - throw new NotImplementedException("Derived property OwnedMember not yet supported"); - } - - /// - /// Queries the derived property OwnedMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedMembership() - { - throw new NotImplementedException("Derived property OwnedMembership not yet supported"); - } - - /// - /// Queries the derived property OwnedRedefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedRedefinition() - { - throw new NotImplementedException("Derived property OwnedRedefinition not yet supported"); - } - - /// - /// Queries the derived property OwnedReferenceSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public ReferenceSubsetting QueryOwnedReferenceSubsetting() - { - throw new NotImplementedException("Derived property OwnedReferenceSubsetting not yet supported"); - } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// Queries the derived property OwnedSpecialization - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSpecialization() - { - throw new NotImplementedException("Derived property OwnedSpecialization not yet supported"); - } - - /// - /// Queries the derived property OwnedSubsetting - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedSubsetting() - { - throw new NotImplementedException("Derived property OwnedSubsetting not yet supported"); - } - - /// - /// Queries the derived property OwnedTypeFeaturing - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTypeFeaturing() - { - throw new NotImplementedException("Derived property OwnedTypeFeaturing not yet supported"); - } - - /// - /// Queries the derived property OwnedTyping - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedTyping() - { - throw new NotImplementedException("Derived property OwnedTyping not yet supported"); - } - - /// - /// Queries the derived property OwnedUnioning - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryOwnedUnioning() - { - throw new NotImplementedException("Derived property OwnedUnioning not yet supported"); - } - - /// - /// Queries the derived property Owner - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IElement QueryOwner() - { - throw new NotImplementedException("Derived property Owner not yet supported"); - } - - /// - /// Queries the derived property OwningDefinition - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Definition QueryOwningDefinition() - { - throw new NotImplementedException("Derived property OwningDefinition not yet supported"); - } - - /// - /// Queries the derived property OwningFeatureMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureMembership QueryOwningFeatureMembership() - { - throw new NotImplementedException("Derived property OwningFeatureMembership not yet supported"); - } - - /// - /// Queries the derived property OwningMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public OwningMembership QueryOwningMembership() - { - throw new NotImplementedException("Derived property OwningMembership not yet supported"); - } - - /// - /// Queries the derived property OwningNamespace - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Namespace QueryOwningNamespace() - { - throw new NotImplementedException("Derived property OwningNamespace not yet supported"); - } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public IRelationship OwningRelationship { get; set; } - - /// - /// Queries the derived property OwningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Type QueryOwningType() - { - throw new NotImplementedException("Derived property OwningType not yet supported"); - } - - /// - /// Queries the derived property OwningUsage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Usage QueryOwningUsage() - { - throw new NotImplementedException("Derived property OwningUsage not yet supported"); - } - - /// - /// Queries the derived property QualifiedName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryQualifiedName() - { - throw new NotImplementedException("Derived property QualifiedName not yet supported"); - } - - /// - /// Queries the derived property ShortName - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string QueryShortName() - { - throw new NotImplementedException("Derived property ShortName not yet supported"); - } - - /// - /// Queries the derived property TextualRepresentation - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryTextualRepresentation() - { - throw new NotImplementedException("Derived property TextualRepresentation not yet supported"); - } - - /// - /// Queries the derived property Type - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryType() - { - throw new NotImplementedException("Derived property Type not yet supported"); - } - - /// - /// Queries the derived property UnioningType - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUnioningType() - { - throw new NotImplementedException("Derived property UnioningType not yet supported"); - } - - /// - /// Queries the derived property Usage - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryUsage() - { - throw new NotImplementedException("Derived property Usage not yet supported"); - } - - /// - /// Queries the derived property Variant - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariant() - { - throw new NotImplementedException("Derived property Variant not yet supported"); - } - - /// - /// Queries the derived property VariantMembership - /// - [EFeature(isChangeable: true, isVolatile: true, isTransient: true, isUnsettable: false, isDerived: true, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List QueryVariantMembership() - { - throw new NotImplementedException("Derived property VariantMembership not yet supported"); - } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs deleted file mode 100644 index 930797396..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs +++ /dev/null @@ -1,197 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AnnotatingElementDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IAnnotatingElement DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnnotatingElementDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the AnnotatingElementDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "AnnotatingElement") - { - throw new InvalidOperationException($"The AnnotatingElementDeSerializer can only be used to deserialize objects of type IAnnotatingElement, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.AnnotatingElement(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the AnnotatingElement cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the AnnotatingElement: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AssociationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AssociationDeSerializer.cs deleted file mode 100644 index f8643d6e3..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/AssociationDeSerializer.cs +++ /dev/null @@ -1,313 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AssociationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IAssociation DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssociationDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the AssociationDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Association") - { - throw new InvalidOperationException($"The AssociationDeSerializer can only be used to deserialize objects of type IAssociation, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Association(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Association cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the Association: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the Association: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/DependencyDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/DependencyDeSerializer.cs deleted file mode 100644 index 2f5e71e14..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/DependencyDeSerializer.cs +++ /dev/null @@ -1,327 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DependencyDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IDependency DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DependencyDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the DependencyDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Dependency") - { - throw new InvalidOperationException($"The DependencyDeSerializer can only be used to deserialize objects of type IDependency, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Dependency(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Dependency cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("client"u8, out JsonElement clientProperty)) - { - foreach (var arrayItem in clientProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement clientIdProperty)) - { - var propertyValue = clientIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Client.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the client Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("supplier"u8, out JsonElement supplierProperty)) - { - foreach (var arrayItem in supplierProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement supplierIdProperty)) - { - var propertyValue = supplierIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Supplier.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the supplier Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the Dependency: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs deleted file mode 100644 index b7b61d9b5..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs +++ /dev/null @@ -1,233 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class EnumerationDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IEnumerationDefinition DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EnumerationDefinitionDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the EnumerationDefinitionDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "EnumerationDefinition") - { - throw new InvalidOperationException($"The EnumerationDefinitionDeSerializer can only be used to deserialize objects of type IEnumerationDefinition, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.EnumerationDefinition(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the EnumerationDefinition cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariation"u8, out JsonElement isVariationProperty)) - { - if (isVariationProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariation = isVariationProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariation Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the EnumerationDefinition: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDeSerializer.cs deleted file mode 100644 index 379818518..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDeSerializer.cs +++ /dev/null @@ -1,326 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IFeature DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the FeatureDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Feature") - { - throw new InvalidOperationException($"The FeatureDeSerializer can only be used to deserialize objects of type IFeature, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Feature(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Feature cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Feature: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Feature: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDirectionKindDeserializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDirectionKindDeserializer.cs deleted file mode 100644 index 1725abac2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureDirectionKindDeserializer.cs +++ /dev/null @@ -1,98 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - - using SysML2.NET.Core; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the Enum - /// - internal static class FeatureDirectionKindDeSerializer - { - /// - /// Deserializes a string value to a - /// - /// - /// The string representation of the - /// - /// - /// The value of the - /// - internal static FeatureDirectionKind Deserialize(string value) - { - value = value.ToUpper(); - - switch (value) - { - case "IN": - return FeatureDirectionKind.In; - case "INOUT": - return FeatureDirectionKind.Inout; - case "OUT": - return FeatureDirectionKind.Out; - default: - throw new ArgumentException($"{value} is not a valid FeatureDirectionKind", nameof(value)); - } - } - - /// - /// Deserializes a string value to a nullable - /// - /// - /// The string representation of the - /// - /// - /// The value of the nullable - /// - internal static FeatureDirectionKind? DeserializeNullable(string value) - { - if (value == null) - { - return null; - } - - value = value.ToUpper(); - - switch (value) - { - case "IN": - return FeatureDirectionKind.In; - case "INOUT": - return FeatureDirectionKind.Inout; - case "OUT": - return FeatureDirectionKind.Out; - default: - throw new ArgumentException($"{value} is not a valid FeatureDirectionKind", nameof(value)); - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs deleted file mode 100644 index 041ca2f42..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs +++ /dev/null @@ -1,385 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureTypingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IFeatureTyping DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureTypingDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the FeatureTypingDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "FeatureTyping") - { - throw new InvalidOperationException($"The FeatureTypingDeSerializer can only be used to deserialize objects of type IFeatureTyping, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.FeatureTyping(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the FeatureTyping cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("general"u8, out JsonElement generalProperty)) - { - if (generalProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.General = Guid.Empty; - logger.LogDebug($"the FeatureTyping.General property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (generalProperty.TryGetProperty("@id"u8, out JsonElement generalIdProperty)) - { - var propertyValue = generalIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.General = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the general Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("specific"u8, out JsonElement specificProperty)) - { - if (specificProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Specific = Guid.Empty; - logger.LogDebug($"the FeatureTyping.Specific property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (specificProperty.TryGetProperty("@id"u8, out JsonElement specificIdProperty)) - { - var propertyValue = specificIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Specific = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the specific Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("type"u8, out JsonElement typeProperty)) - { - if (typeProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Type = Guid.Empty; - logger.LogDebug($"the FeatureTyping.Type property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (typeProperty.TryGetProperty("@id"u8, out JsonElement typeIdProperty)) - { - var propertyValue = typeIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Type = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the type Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("typedFeature"u8, out JsonElement typedFeatureProperty)) - { - if (typedFeatureProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.TypedFeature = Guid.Empty; - logger.LogDebug($"the FeatureTyping.TypedFeature property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (typedFeatureProperty.TryGetProperty("@id"u8, out JsonElement typedFeatureIdProperty)) - { - var propertyValue = typedFeatureIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.TypedFeature = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the typedFeature Json property was not found in the FeatureTyping: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FlowDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FlowDeSerializer.cs deleted file mode 100644 index a1e406b00..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FlowDeSerializer.cs +++ /dev/null @@ -1,418 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FlowDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IFlow DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FlowDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the FlowDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Flow") - { - throw new InvalidOperationException($"The FlowDeSerializer can only be used to deserialize objects of type IFlow, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Flow(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Flow cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the Flow: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the Flow: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs deleted file mode 100644 index 61eca15ff..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs +++ /dev/null @@ -1,349 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FramedConcernMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IFramedConcernMembership DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FramedConcernMembershipDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the FramedConcernMembershipDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "FramedConcernMembership") - { - throw new InvalidOperationException($"The FramedConcernMembershipDeSerializer can only be used to deserialize objects of type IFramedConcernMembership, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.FramedConcernMembership(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the FramedConcernMembership cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("kind"u8, out JsonElement kindProperty)) - { - dtoInstance.Kind = RequirementConstraintKindDeSerializer.Deserialize(kindProperty.GetString()); - } - else - { - logger.LogDebug($"the kind Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberElement"u8, out JsonElement memberElementProperty)) - { - if (memberElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.MemberElement = Guid.Empty; - logger.LogDebug($"the FramedConcernMembership.MemberElement property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (memberElementProperty.TryGetProperty("@id"u8, out JsonElement memberElementIdProperty)) - { - var propertyValue = memberElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.MemberElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the memberElement Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberName"u8, out JsonElement memberNameProperty)) - { - dtoInstance.MemberName = memberNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberName Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberShortName"u8, out JsonElement memberShortNameProperty)) - { - dtoInstance.MemberShortName = memberShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberShortName Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("visibility"u8, out JsonElement visibilityProperty)) - { - dtoInstance.Visibility = VisibilityKindDeSerializer.Deserialize(visibilityProperty.GetString()); - } - else - { - logger.LogDebug($"the visibility Json property was not found in the FramedConcernMembership: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs deleted file mode 100644 index b803b8c73..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs +++ /dev/null @@ -1,335 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralIntegerDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static ILiteralInteger DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralIntegerDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the LiteralIntegerDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "LiteralInteger") - { - throw new InvalidOperationException($"The LiteralIntegerDeSerializer can only be used to deserialize objects of type ILiteralInteger, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.LiteralInteger(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the LiteralInteger cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("value"u8, out JsonElement valueProperty)) - { - dtoInstance.Value = valueProperty.GetInt32(); - } - else - { - logger.LogDebug($"the value Json property was not found in the LiteralInteger: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs deleted file mode 100644 index 0545549a2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs +++ /dev/null @@ -1,335 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralRationalDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static ILiteralRational DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralRationalDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the LiteralRationalDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "LiteralRational") - { - throw new InvalidOperationException($"The LiteralRationalDeSerializer can only be used to deserialize objects of type ILiteralRational, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.LiteralRational(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the LiteralRational cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("value"u8, out JsonElement valueProperty)) - { - dtoInstance.Value = valueProperty.GetDouble(); - } - else - { - logger.LogDebug($"the value Json property was not found in the LiteralRational: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MembershipDeSerializer.cs deleted file mode 100644 index 2ae7c565c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MembershipDeSerializer.cs +++ /dev/null @@ -1,340 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IMembership DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the MembershipDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Membership") - { - throw new InvalidOperationException($"The MembershipDeSerializer can only be used to deserialize objects of type IMembership, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Membership(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Membership cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberElement"u8, out JsonElement memberElementProperty)) - { - if (memberElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.MemberElement = Guid.Empty; - logger.LogDebug($"the Membership.MemberElement property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (memberElementProperty.TryGetProperty("@id"u8, out JsonElement memberElementIdProperty)) - { - var propertyValue = memberElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.MemberElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the memberElement Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberName"u8, out JsonElement memberNameProperty)) - { - dtoInstance.MemberName = memberNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberName Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberShortName"u8, out JsonElement memberShortNameProperty)) - { - dtoInstance.MemberShortName = memberShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberShortName Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the Membership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("visibility"u8, out JsonElement visibilityProperty)) - { - dtoInstance.Visibility = VisibilityKindDeSerializer.Deserialize(visibilityProperty.GetString()); - } - else - { - logger.LogDebug($"the visibility Json property was not found in the Membership: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs deleted file mode 100644 index 6811fcc67..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs +++ /dev/null @@ -1,326 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MultiplicityRangeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IMultiplicityRange DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MultiplicityRangeDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the MultiplicityRangeDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "MultiplicityRange") - { - throw new InvalidOperationException($"The MultiplicityRangeDeSerializer can only be used to deserialize objects of type IMultiplicityRange, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.MultiplicityRange(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the MultiplicityRange cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the MultiplicityRange: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs deleted file mode 100644 index 21680b5b4..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs +++ /dev/null @@ -1,340 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class OwningMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IOwningMembership DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OwningMembershipDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the OwningMembershipDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "OwningMembership") - { - throw new InvalidOperationException($"The OwningMembershipDeSerializer can only be used to deserialize objects of type IOwningMembership, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.OwningMembership(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the OwningMembership cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberElement"u8, out JsonElement memberElementProperty)) - { - if (memberElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.MemberElement = Guid.Empty; - logger.LogDebug($"the OwningMembership.MemberElement property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (memberElementProperty.TryGetProperty("@id"u8, out JsonElement memberElementIdProperty)) - { - var propertyValue = memberElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.MemberElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the memberElement Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberName"u8, out JsonElement memberNameProperty)) - { - dtoInstance.MemberName = memberNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberName Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("memberShortName"u8, out JsonElement memberShortNameProperty)) - { - dtoInstance.MemberShortName = memberShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the memberShortName Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("visibility"u8, out JsonElement visibilityProperty)) - { - dtoInstance.Visibility = VisibilityKindDeSerializer.Deserialize(visibilityProperty.GetString()); - } - else - { - logger.LogDebug($"the visibility Json property was not found in the OwningMembership: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs deleted file mode 100644 index 1417c0435..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ReferenceSubsettingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IReferenceSubsetting DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReferenceSubsettingDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the ReferenceSubsettingDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "ReferenceSubsetting") - { - throw new InvalidOperationException($"The ReferenceSubsettingDeSerializer can only be used to deserialize objects of type IReferenceSubsetting, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.ReferenceSubsetting(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the ReferenceSubsetting cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("general"u8, out JsonElement generalProperty)) - { - if (generalProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.General = Guid.Empty; - logger.LogDebug($"the ReferenceSubsetting.General property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (generalProperty.TryGetProperty("@id"u8, out JsonElement generalIdProperty)) - { - var propertyValue = generalIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.General = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the general Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("referencedFeature"u8, out JsonElement referencedFeatureProperty)) - { - if (referencedFeatureProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.ReferencedFeature = Guid.Empty; - logger.LogDebug($"the ReferenceSubsetting.ReferencedFeature property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (referencedFeatureProperty.TryGetProperty("@id"u8, out JsonElement referencedFeatureIdProperty)) - { - var propertyValue = referencedFeatureIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ReferencedFeature = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the referencedFeature Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("specific"u8, out JsonElement specificProperty)) - { - if (specificProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Specific = Guid.Empty; - logger.LogDebug($"the ReferenceSubsetting.Specific property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (specificProperty.TryGetProperty("@id"u8, out JsonElement specificIdProperty)) - { - var propertyValue = specificIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Specific = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the specific Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("subsettedFeature"u8, out JsonElement subsettedFeatureProperty)) - { - if (subsettedFeatureProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.SubsettedFeature = Guid.Empty; - logger.LogDebug($"the ReferenceSubsetting.SubsettedFeature property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (subsettedFeatureProperty.TryGetProperty("@id"u8, out JsonElement subsettedFeatureIdProperty)) - { - var propertyValue = subsettedFeatureIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.SubsettedFeature = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the subsettedFeature Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("subsettingFeature"u8, out JsonElement subsettingFeatureProperty)) - { - if (subsettingFeatureProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.SubsettingFeature = Guid.Empty; - logger.LogDebug($"the ReferenceSubsetting.SubsettingFeature property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (subsettingFeatureProperty.TryGetProperty("@id"u8, out JsonElement subsettingFeatureIdProperty)) - { - var propertyValue = subsettingFeatureIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.SubsettingFeature = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the subsettingFeature Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the ReferenceSubsetting: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs deleted file mode 100644 index 1414c3491..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs +++ /dev/null @@ -1,368 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RequirementUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IRequirementUsage DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementUsageDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the RequirementUsageDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "RequirementUsage") - { - throw new InvalidOperationException($"The RequirementUsageDeSerializer can only be used to deserialize objects of type IRequirementUsage, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.RequirementUsage(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the RequirementUsage cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isIndividual"u8, out JsonElement isIndividualProperty)) - { - if (isIndividualProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsIndividual = isIndividualProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isIndividual Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariation"u8, out JsonElement isVariationProperty)) - { - if (isVariationProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariation = isVariationProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariation Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("portionKind"u8, out JsonElement portionKindProperty)) - { - dtoInstance.PortionKind = PortionKindDeSerializer.DeserializeNullable(portionKindProperty.GetString()); - } - else - { - logger.LogDebug($"the portionKind Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("reqId"u8, out JsonElement reqIdProperty)) - { - dtoInstance.ReqId = reqIdProperty.GetString(); - } - else - { - logger.LogDebug($"the reqId Json property was not found in the RequirementUsage: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs deleted file mode 100644 index 94edd3787..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs +++ /dev/null @@ -1,339 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SelectExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static ISelectExpression DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SelectExpressionDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the SelectExpressionDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "SelectExpression") - { - throw new InvalidOperationException($"The SelectExpressionDeSerializer can only be used to deserialize objects of type ISelectExpression, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.SelectExpression(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the SelectExpression cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("operator"u8, out JsonElement operatorProperty)) - { - var propertyValue = operatorProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Operator = propertyValue; - } - } - else - { - logger.LogDebug($"the operator Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the SelectExpression: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs deleted file mode 100644 index 6e855c870..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs +++ /dev/null @@ -1,385 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SubclassificationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static ISubclassification DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubclassificationDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the SubclassificationDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Subclassification") - { - throw new InvalidOperationException($"The SubclassificationDeSerializer can only be used to deserialize objects of type ISubclassification, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Subclassification(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Subclassification cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("general"u8, out JsonElement generalProperty)) - { - if (generalProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.General = Guid.Empty; - logger.LogDebug($"the Subclassification.General property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (generalProperty.TryGetProperty("@id"u8, out JsonElement generalIdProperty)) - { - var propertyValue = generalIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.General = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the general Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImplied"u8, out JsonElement isImpliedProperty)) - { - if (isImpliedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImplied = isImpliedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImplied Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelatedElement"u8, out JsonElement ownedRelatedElementProperty)) - { - foreach (var arrayItem in ownedRelatedElementProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelatedElementIdProperty)) - { - var propertyValue = ownedRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelatedElement.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelatedElement Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelatedElement"u8, out JsonElement owningRelatedElementProperty)) - { - if (owningRelatedElementProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelatedElement = null; - } - else - { - if (owningRelatedElementProperty.TryGetProperty("@id"u8, out JsonElement owningRelatedElementIdProperty)) - { - var propertyValue = owningRelatedElementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelatedElement = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelatedElement Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("source"u8, out JsonElement sourceProperty)) - { - foreach (var arrayItem in sourceProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement sourceIdProperty)) - { - var propertyValue = sourceIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Source.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the source Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("specific"u8, out JsonElement specificProperty)) - { - if (specificProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Specific = Guid.Empty; - logger.LogDebug($"the Subclassification.Specific property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (specificProperty.TryGetProperty("@id"u8, out JsonElement specificIdProperty)) - { - var propertyValue = specificIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Specific = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the specific Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("subclassifier"u8, out JsonElement subclassifierProperty)) - { - if (subclassifierProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Subclassifier = Guid.Empty; - logger.LogDebug($"the Subclassification.Subclassifier property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (subclassifierProperty.TryGetProperty("@id"u8, out JsonElement subclassifierIdProperty)) - { - var propertyValue = subclassifierIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Subclassifier = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the subclassifier Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("superclassifier"u8, out JsonElement superclassifierProperty)) - { - if (superclassifierProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.Superclassifier = Guid.Empty; - logger.LogDebug($"the Subclassification.Superclassifier property was not found in the Json. The value is set to Guid.Empty"); - } - else - { - if (superclassifierProperty.TryGetProperty("@id"u8, out JsonElement superclassifierIdProperty)) - { - var propertyValue = superclassifierIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Superclassifier = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the superclassifier Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("target"u8, out JsonElement targetProperty)) - { - foreach (var arrayItem in targetProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement targetIdProperty)) - { - var propertyValue = targetIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Target.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the target Json property was not found in the Subclassification: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs deleted file mode 100644 index de99ecc71..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs +++ /dev/null @@ -1,223 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TextualRepresentationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static ITextualRepresentation DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TextualRepresentationDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the TextualRepresentationDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "TextualRepresentation") - { - throw new InvalidOperationException($"The TextualRepresentationDeSerializer can only be used to deserialize objects of type ITextualRepresentation, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.TextualRepresentation(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the TextualRepresentation cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("body"u8, out JsonElement bodyProperty)) - { - var propertyValue = bodyProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Body = propertyValue; - } - } - else - { - logger.LogDebug($"the body Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("language"u8, out JsonElement languageProperty)) - { - var propertyValue = languageProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.Language = propertyValue; - } - } - else - { - logger.LogDebug($"the language Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the TextualRepresentation: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/UsageDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/UsageDeSerializer.cs deleted file mode 100644 index 993905f5d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDeSerializer/UsageDeSerializer.cs +++ /dev/null @@ -1,338 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using Microsoft.Extensions.Logging; - using Microsoft.Extensions.Logging.Abstractions; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class UsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The that contains the json object - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - internal static IUsage DeSerialize(JsonElement jsonElement, SerializationModeKind serializationModeKind, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UsageDeSerializer"); - - if (!jsonElement.TryGetProperty("@type"u8, out JsonElement @type)) - { - throw new InvalidOperationException("The @type property is not available, the UsageDeSerializer cannot be used to deserialize this JsonElement"); - } - - if (@type.GetString() != "Usage") - { - throw new InvalidOperationException($"The UsageDeSerializer can only be used to deserialize objects of type IUsage, a {@type.GetString()} was provided"); - } - - var dtoInstance = new SysML2.NET.Core.DTO.Usage(); - - if (jsonElement.TryGetProperty("@id"u8, out JsonElement idProperty)) - { - var propertyValue = idProperty.GetString(); - if (propertyValue == null) - { - throw new JsonException("The @id property is not present, the Usage cannot be deserialized"); - } - else - { - dtoInstance.Id = Guid.Parse(propertyValue); - } - } - - if (jsonElement.TryGetProperty("aliasIds"u8, out JsonElement aliasIdsProperty)) - { - foreach (var arrayItem in aliasIdsProperty.EnumerateArray()) - { - var propertyValue = arrayItem.GetString(); - if (propertyValue != null) - { - dtoInstance.AliasIds.Add(propertyValue); - } - } - } - else - { - logger.LogDebug($"the aliasIds Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredName"u8, out JsonElement declaredNameProperty)) - { - dtoInstance.DeclaredName = declaredNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredName Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("declaredShortName"u8, out JsonElement declaredShortNameProperty)) - { - dtoInstance.DeclaredShortName = declaredShortNameProperty.GetString(); - } - else - { - logger.LogDebug($"the declaredShortName Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("direction"u8, out JsonElement directionProperty)) - { - dtoInstance.Direction = FeatureDirectionKindDeSerializer.DeserializeNullable(directionProperty.GetString()); - } - else - { - logger.LogDebug($"the direction Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("elementId"u8, out JsonElement elementIdProperty)) - { - var propertyValue = elementIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.ElementId = propertyValue; - } - } - else - { - logger.LogDebug($"the elementId Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isAbstract"u8, out JsonElement isAbstractProperty)) - { - if (isAbstractProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsAbstract = isAbstractProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isAbstract Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isComposite"u8, out JsonElement isCompositeProperty)) - { - if (isCompositeProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsComposite = isCompositeProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isComposite Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isConstant"u8, out JsonElement isConstantProperty)) - { - if (isConstantProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsConstant = isConstantProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isConstant Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isDerived"u8, out JsonElement isDerivedProperty)) - { - if (isDerivedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsDerived = isDerivedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isDerived Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isEnd"u8, out JsonElement isEndProperty)) - { - if (isEndProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsEnd = isEndProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isEnd Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isImpliedIncluded"u8, out JsonElement isImpliedIncludedProperty)) - { - if (isImpliedIncludedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsImpliedIncluded = isImpliedIncludedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isImpliedIncluded Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isOrdered"u8, out JsonElement isOrderedProperty)) - { - if (isOrderedProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsOrdered = isOrderedProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isOrdered Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isPortion"u8, out JsonElement isPortionProperty)) - { - if (isPortionProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsPortion = isPortionProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isPortion Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isSufficient"u8, out JsonElement isSufficientProperty)) - { - if (isSufficientProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsSufficient = isSufficientProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isSufficient Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isUnique"u8, out JsonElement isUniqueProperty)) - { - if (isUniqueProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsUnique = isUniqueProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isUnique Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariable"u8, out JsonElement isVariableProperty)) - { - if (isVariableProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariable = isVariableProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariable Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("isVariation"u8, out JsonElement isVariationProperty)) - { - if (isVariationProperty.ValueKind != JsonValueKind.Null) - { - dtoInstance.IsVariation = isVariationProperty.GetBoolean(); - } - } - else - { - logger.LogDebug($"the isVariation Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("ownedRelationship"u8, out JsonElement ownedRelationshipProperty)) - { - foreach (var arrayItem in ownedRelationshipProperty.EnumerateArray()) - { - if (arrayItem.TryGetProperty("@id"u8, out JsonElement ownedRelationshipIdProperty)) - { - var propertyValue = ownedRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwnedRelationship.Add(Guid.Parse(propertyValue)); - } - } - } - } - else - { - logger.LogDebug($"the ownedRelationship Json property was not found in the Usage: {dtoInstance.Id}"); - } - - if (jsonElement.TryGetProperty("owningRelationship"u8, out JsonElement owningRelationshipProperty)) - { - if (owningRelationshipProperty.ValueKind == JsonValueKind.Null) - { - dtoInstance.OwningRelationship = null; - } - else - { - if (owningRelationshipProperty.TryGetProperty("@id"u8, out JsonElement owningRelationshipIdProperty)) - { - var propertyValue = owningRelationshipIdProperty.GetString(); - if (propertyValue != null) - { - dtoInstance.OwningRelationship = Guid.Parse(propertyValue); - } - } - } - } - else - { - logger.LogDebug($"the owningRelationship Json property was not found in the Usage: {dtoInstance.Id}"); - } - - - return dtoInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AnnotatingElementDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AnnotatingElementDictionaryReader.cs deleted file mode 100644 index f90265d45..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AnnotatingElementDictionaryReader.cs +++ /dev/null @@ -1,283 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class AnnotatingElementDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IAnnotatingElement ReadSimplified(Dictionary dictionary) - { - var annotatingElementInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - annotatingElementInstance.AliasIds = aliasIdsFeature ?? new List(); - annotatingElementInstance.DeclaredName = declaredNameFeature; - annotatingElementInstance.DeclaredShortName = declaredShortNameFeature; - annotatingElementInstance.ElementId = elementIdFeature; - annotatingElementInstance.IsImpliedIncluded = isImpliedIncludedFeature; - annotatingElementInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - annotatingElementInstance.OwningRelationship = owningRelationshipFeature; - - return annotatingElementInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IAnnotatingElement ReadComplex(Dictionary dictionary) - { - var annotatingElementInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - annotatingElementInstance.AliasIds = aliasIdsFeature ?? new List(); - annotatingElementInstance.DeclaredName = declaredNameFeature; - annotatingElementInstance.DeclaredShortName = declaredShortNameFeature; - annotatingElementInstance.ElementId = elementIdFeature; - annotatingElementInstance.IsImpliedIncluded = isImpliedIncludedFeature; - annotatingElementInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - annotatingElementInstance.OwningRelationship = owningRelationshipFeature; - - return annotatingElementInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IAnnotatingElement DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - - var type = Convert.ToString(typeObject); - - if (type != "AnnotatingElement") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a AnnotatingElement"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a AnnotatingElement"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var annotatingElementInstance = new SysML2.NET.Core.DTO.AnnotatingElement - { - Id = id - }; - - return annotatingElementInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AssociationDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AssociationDictionaryReader.cs deleted file mode 100644 index 8faeca1c8..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/AssociationDictionaryReader.cs +++ /dev/null @@ -1,381 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class AssociationDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IAssociation ReadSimplified(Dictionary dictionary) - { - var associationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - - associationInstance.AliasIds = aliasIdsFeature ?? new List(); - associationInstance.DeclaredName = declaredNameFeature; - associationInstance.DeclaredShortName = declaredShortNameFeature; - associationInstance.ElementId = elementIdFeature; - associationInstance.IsAbstract = isAbstractFeature; - associationInstance.IsImplied = isImpliedFeature; - associationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - associationInstance.IsSufficient = isSufficientFeature; - associationInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - associationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - associationInstance.OwningRelatedElement = owningRelatedElementFeature; - associationInstance.OwningRelationship = owningRelationshipFeature; - associationInstance.Source = sourceFeature ?? new List(); - associationInstance.Target = targetFeature ?? new List(); - - return associationInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IAssociation ReadComplex(Dictionary dictionary) - { - var associationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - List targetFeature = (targetObject as List); - - - associationInstance.AliasIds = aliasIdsFeature ?? new List(); - associationInstance.DeclaredName = declaredNameFeature; - associationInstance.DeclaredShortName = declaredShortNameFeature; - associationInstance.ElementId = elementIdFeature; - associationInstance.IsAbstract = isAbstractFeature; - associationInstance.IsImplied = isImpliedFeature; - associationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - associationInstance.IsSufficient = isSufficientFeature; - associationInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - associationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - associationInstance.OwningRelatedElement = owningRelatedElementFeature; - associationInstance.OwningRelationship = owningRelationshipFeature; - associationInstance.Source = sourceFeature ?? new List(); - associationInstance.Target = targetFeature ?? new List(); - - return associationInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IAssociation DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Association") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Association"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Association"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var associationInstance = new SysML2.NET.Core.DTO.Association - { - Id = id - }; - - return associationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/DependencyDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/DependencyDictionaryReader.cs deleted file mode 100644 index 26d79506a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/DependencyDictionaryReader.cs +++ /dev/null @@ -1,381 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class DependencyDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IDependency ReadSimplified(Dictionary dictionary) - { - var dependencyInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("client", out object clientObject)) - { - throw new ArgumentException("The client property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List clientFeature = (clientObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("supplier", out object supplierObject)) - { - throw new ArgumentException("The supplier property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List supplierFeature = (supplierObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - - dependencyInstance.AliasIds = aliasIdsFeature ?? new List(); - dependencyInstance.Client = clientFeature ?? new List(); - dependencyInstance.DeclaredName = declaredNameFeature; - dependencyInstance.DeclaredShortName = declaredShortNameFeature; - dependencyInstance.ElementId = elementIdFeature; - dependencyInstance.IsImplied = isImpliedFeature; - dependencyInstance.IsImpliedIncluded = isImpliedIncludedFeature; - dependencyInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - dependencyInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - dependencyInstance.OwningRelatedElement = owningRelatedElementFeature; - dependencyInstance.OwningRelationship = owningRelationshipFeature; - dependencyInstance.Source = sourceFeature ?? new List(); - dependencyInstance.Supplier = supplierFeature ?? new List(); - dependencyInstance.Target = targetFeature ?? new List(); - - return dependencyInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IDependency ReadComplex(Dictionary dictionary) - { - var dependencyInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("client", out object clientObject)) - { - throw new ArgumentException("The client property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List clientFeature = (clientObject as List); - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("supplier", out object supplierObject)) - { - throw new ArgumentException("The supplier property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List supplierFeature = (supplierObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - List targetFeature = (targetObject as List); - - - dependencyInstance.AliasIds = aliasIdsFeature ?? new List(); - dependencyInstance.Client = clientFeature ?? new List(); - dependencyInstance.DeclaredName = declaredNameFeature; - dependencyInstance.DeclaredShortName = declaredShortNameFeature; - dependencyInstance.ElementId = elementIdFeature; - dependencyInstance.IsImplied = isImpliedFeature; - dependencyInstance.IsImpliedIncluded = isImpliedIncludedFeature; - dependencyInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - dependencyInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - dependencyInstance.OwningRelatedElement = owningRelatedElementFeature; - dependencyInstance.OwningRelationship = owningRelationshipFeature; - dependencyInstance.Source = sourceFeature ?? new List(); - dependencyInstance.Supplier = supplierFeature ?? new List(); - dependencyInstance.Target = targetFeature ?? new List(); - - return dependencyInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IDependency DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Dependency") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Dependency"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Dependency"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var dependencyInstance = new SysML2.NET.Core.DTO.Dependency - { - Id = id - }; - - return dependencyInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/EnumerationDefinitionDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/EnumerationDefinitionDictionaryReader.cs deleted file mode 100644 index 2aaef069e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/EnumerationDefinitionDictionaryReader.cs +++ /dev/null @@ -1,325 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class EnumerationDefinitionDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IEnumerationDefinition ReadSimplified(Dictionary dictionary) - { - var enumerationDefinitionInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - enumerationDefinitionInstance.AliasIds = aliasIdsFeature ?? new List(); - enumerationDefinitionInstance.DeclaredName = declaredNameFeature; - enumerationDefinitionInstance.DeclaredShortName = declaredShortNameFeature; - enumerationDefinitionInstance.ElementId = elementIdFeature; - enumerationDefinitionInstance.IsAbstract = isAbstractFeature; - enumerationDefinitionInstance.IsImpliedIncluded = isImpliedIncludedFeature; - enumerationDefinitionInstance.IsSufficient = isSufficientFeature; - enumerationDefinitionInstance.IsVariation = isVariationFeature; - enumerationDefinitionInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - enumerationDefinitionInstance.OwningRelationship = owningRelationshipFeature; - - return enumerationDefinitionInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IEnumerationDefinition ReadComplex(Dictionary dictionary) - { - var enumerationDefinitionInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - enumerationDefinitionInstance.AliasIds = aliasIdsFeature ?? new List(); - enumerationDefinitionInstance.DeclaredName = declaredNameFeature; - enumerationDefinitionInstance.DeclaredShortName = declaredShortNameFeature; - enumerationDefinitionInstance.ElementId = elementIdFeature; - enumerationDefinitionInstance.IsAbstract = isAbstractFeature; - enumerationDefinitionInstance.IsImpliedIncluded = isImpliedIncludedFeature; - enumerationDefinitionInstance.IsSufficient = isSufficientFeature; - enumerationDefinitionInstance.IsVariation = isVariationFeature; - enumerationDefinitionInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - enumerationDefinitionInstance.OwningRelationship = owningRelationshipFeature; - - return enumerationDefinitionInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IEnumerationDefinition DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - - var type = Convert.ToString(typeObject); - - if (type != "EnumerationDefinition") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a EnumerationDefinition"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a EnumerationDefinition"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var enumerationDefinitionInstance = new SysML2.NET.Core.DTO.EnumerationDefinition - { - Id = id - }; - - return enumerationDefinitionInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureDictionaryReader.cs deleted file mode 100644 index b0e72a34f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureDictionaryReader.cs +++ /dev/null @@ -1,437 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class FeatureDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IFeature ReadSimplified(Dictionary dictionary) - { - var featureInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - featureInstance.AliasIds = aliasIdsFeature ?? new List(); - featureInstance.DeclaredName = declaredNameFeature; - featureInstance.DeclaredShortName = declaredShortNameFeature; - featureInstance.Direction = directionFeature; - featureInstance.ElementId = elementIdFeature; - featureInstance.IsAbstract = isAbstractFeature; - featureInstance.IsComposite = isCompositeFeature; - featureInstance.IsConstant = isConstantFeature; - featureInstance.IsDerived = isDerivedFeature; - featureInstance.IsEnd = isEndFeature; - featureInstance.IsImpliedIncluded = isImpliedIncludedFeature; - featureInstance.IsOrdered = isOrderedFeature; - featureInstance.IsPortion = isPortionFeature; - featureInstance.IsSufficient = isSufficientFeature; - featureInstance.IsUnique = isUniqueFeature; - featureInstance.IsVariable = isVariableFeature; - featureInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - featureInstance.OwningRelationship = owningRelationshipFeature; - - return featureInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IFeature ReadComplex(Dictionary dictionary) - { - var featureInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - featureInstance.AliasIds = aliasIdsFeature ?? new List(); - featureInstance.DeclaredName = declaredNameFeature; - featureInstance.DeclaredShortName = declaredShortNameFeature; - featureInstance.Direction = directionFeature; - featureInstance.ElementId = elementIdFeature; - featureInstance.IsAbstract = isAbstractFeature; - featureInstance.IsComposite = isCompositeFeature; - featureInstance.IsConstant = isConstantFeature; - featureInstance.IsDerived = isDerivedFeature; - featureInstance.IsEnd = isEndFeature; - featureInstance.IsImpliedIncluded = isImpliedIncludedFeature; - featureInstance.IsOrdered = isOrderedFeature; - featureInstance.IsPortion = isPortionFeature; - featureInstance.IsSufficient = isSufficientFeature; - featureInstance.IsUnique = isUniqueFeature; - featureInstance.IsVariable = isVariableFeature; - featureInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - featureInstance.OwningRelationship = owningRelationshipFeature; - - return featureInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFeature DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Feature") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Feature"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Feature"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var featureInstance = new SysML2.NET.Core.DTO.Feature - { - Id = id - }; - - return featureInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureTypingDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureTypingDictionaryReader.cs deleted file mode 100644 index c84e397c4..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FeatureTypingDictionaryReader.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class FeatureTypingDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IFeatureTyping ReadSimplified(Dictionary dictionary) - { - var featureTypingInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid typeFeature = Guid.Parse(Convert.ToString(typeObject)); - - if (!dictionary.TryGetValue("typedFeature", out object typedFeatureObject)) - { - throw new ArgumentException("The typedFeature property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid typedFeatureFeature = Guid.Parse(Convert.ToString(typedFeatureObject)); - - - featureTypingInstance.AliasIds = aliasIdsFeature ?? new List(); - featureTypingInstance.DeclaredName = declaredNameFeature; - featureTypingInstance.DeclaredShortName = declaredShortNameFeature; - featureTypingInstance.ElementId = elementIdFeature; - featureTypingInstance.General = generalFeature; - featureTypingInstance.IsImplied = isImpliedFeature; - featureTypingInstance.IsImpliedIncluded = isImpliedIncludedFeature; - featureTypingInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - featureTypingInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - featureTypingInstance.OwningRelatedElement = owningRelatedElementFeature; - featureTypingInstance.OwningRelationship = owningRelationshipFeature; - featureTypingInstance.Source = sourceFeature ?? new List(); - featureTypingInstance.Specific = specificFeature; - featureTypingInstance.Target = targetFeature ?? new List(); - featureTypingInstance.Type = typeFeature; - featureTypingInstance.TypedFeature = typedFeatureFeature; - - return featureTypingInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IFeatureTyping ReadComplex(Dictionary dictionary) - { - var featureTypingInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - List targetFeature = (targetObject as List); - - if (!dictionary.TryGetValue("type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid typeFeature = Guid.Parse(Convert.ToString(typeObject)); - - if (!dictionary.TryGetValue("typedFeature", out object typedFeatureObject)) - { - throw new ArgumentException("The typedFeature property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - Guid typedFeatureFeature = Guid.Parse(Convert.ToString(typedFeatureObject)); - - - featureTypingInstance.AliasIds = aliasIdsFeature ?? new List(); - featureTypingInstance.DeclaredName = declaredNameFeature; - featureTypingInstance.DeclaredShortName = declaredShortNameFeature; - featureTypingInstance.ElementId = elementIdFeature; - featureTypingInstance.General = generalFeature; - featureTypingInstance.IsImplied = isImpliedFeature; - featureTypingInstance.IsImpliedIncluded = isImpliedIncludedFeature; - featureTypingInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - featureTypingInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - featureTypingInstance.OwningRelatedElement = owningRelatedElementFeature; - featureTypingInstance.OwningRelationship = owningRelationshipFeature; - featureTypingInstance.Source = sourceFeature ?? new List(); - featureTypingInstance.Specific = specificFeature; - featureTypingInstance.Target = targetFeature ?? new List(); - featureTypingInstance.Type = typeFeature; - featureTypingInstance.TypedFeature = typedFeatureFeature; - - return featureTypingInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFeatureTyping DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - - var type = Convert.ToString(typeObject); - - if (type != "FeatureTyping") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a FeatureTyping"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a FeatureTyping"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var featureTypingInstance = new SysML2.NET.Core.DTO.FeatureTyping - { - Id = id - }; - - return featureTypingInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FlowDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FlowDictionaryReader.cs deleted file mode 100644 index 80173f80c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FlowDictionaryReader.cs +++ /dev/null @@ -1,507 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class FlowDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IFlow ReadSimplified(Dictionary dictionary) - { - var flowInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - - flowInstance.AliasIds = aliasIdsFeature ?? new List(); - flowInstance.DeclaredName = declaredNameFeature; - flowInstance.DeclaredShortName = declaredShortNameFeature; - flowInstance.Direction = directionFeature; - flowInstance.ElementId = elementIdFeature; - flowInstance.IsAbstract = isAbstractFeature; - flowInstance.IsComposite = isCompositeFeature; - flowInstance.IsConstant = isConstantFeature; - flowInstance.IsDerived = isDerivedFeature; - flowInstance.IsEnd = isEndFeature; - flowInstance.IsImplied = isImpliedFeature; - flowInstance.IsImpliedIncluded = isImpliedIncludedFeature; - flowInstance.IsOrdered = isOrderedFeature; - flowInstance.IsPortion = isPortionFeature; - flowInstance.IsSufficient = isSufficientFeature; - flowInstance.IsUnique = isUniqueFeature; - flowInstance.IsVariable = isVariableFeature; - flowInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - flowInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - flowInstance.OwningRelatedElement = owningRelatedElementFeature; - flowInstance.OwningRelationship = owningRelationshipFeature; - flowInstance.Source = sourceFeature ?? new List(); - flowInstance.Target = targetFeature ?? new List(); - - return flowInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IFlow ReadComplex(Dictionary dictionary) - { - var flowInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - List targetFeature = (targetObject as List); - - - flowInstance.AliasIds = aliasIdsFeature ?? new List(); - flowInstance.DeclaredName = declaredNameFeature; - flowInstance.DeclaredShortName = declaredShortNameFeature; - flowInstance.Direction = directionFeature; - flowInstance.ElementId = elementIdFeature; - flowInstance.IsAbstract = isAbstractFeature; - flowInstance.IsComposite = isCompositeFeature; - flowInstance.IsConstant = isConstantFeature; - flowInstance.IsDerived = isDerivedFeature; - flowInstance.IsEnd = isEndFeature; - flowInstance.IsImplied = isImpliedFeature; - flowInstance.IsImpliedIncluded = isImpliedIncludedFeature; - flowInstance.IsOrdered = isOrderedFeature; - flowInstance.IsPortion = isPortionFeature; - flowInstance.IsSufficient = isSufficientFeature; - flowInstance.IsUnique = isUniqueFeature; - flowInstance.IsVariable = isVariableFeature; - flowInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - flowInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - flowInstance.OwningRelatedElement = owningRelatedElementFeature; - flowInstance.OwningRelationship = owningRelationshipFeature; - flowInstance.Source = sourceFeature ?? new List(); - flowInstance.Target = targetFeature ?? new List(); - - return flowInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFlow DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Flow") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Flow"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Flow"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var flowInstance = new SysML2.NET.Core.DTO.Flow - { - Id = id - }; - - return flowInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FramedConcernMembershipDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FramedConcernMembershipDictionaryReader.cs deleted file mode 100644 index bc30e4521..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/FramedConcernMembershipDictionaryReader.cs +++ /dev/null @@ -1,423 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class FramedConcernMembershipDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IFramedConcernMembership ReadSimplified(Dictionary dictionary) - { - var framedConcernMembershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("kind", out object kindObject)) - { - throw new ArgumentException("The kind property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - RequirementConstraintKind kindFeature = (RequirementConstraintKind)Enum.Parse(typeof(RequirementConstraintKind), Convert.ToString(kindObject), true); - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)Enum.Parse(typeof(VisibilityKind), Convert.ToString(visibilityObject), true); - - - framedConcernMembershipInstance.AliasIds = aliasIdsFeature ?? new List(); - framedConcernMembershipInstance.DeclaredName = declaredNameFeature; - framedConcernMembershipInstance.DeclaredShortName = declaredShortNameFeature; - framedConcernMembershipInstance.ElementId = elementIdFeature; - framedConcernMembershipInstance.IsImplied = isImpliedFeature; - framedConcernMembershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - framedConcernMembershipInstance.Kind = kindFeature; - framedConcernMembershipInstance.MemberElement = memberElementFeature; - framedConcernMembershipInstance.MemberName = memberNameFeature; - framedConcernMembershipInstance.MemberShortName = memberShortNameFeature; - framedConcernMembershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - framedConcernMembershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - framedConcernMembershipInstance.OwningRelatedElement = owningRelatedElementFeature; - framedConcernMembershipInstance.OwningRelationship = owningRelationshipFeature; - framedConcernMembershipInstance.Source = sourceFeature ?? new List(); - framedConcernMembershipInstance.Target = targetFeature ?? new List(); - framedConcernMembershipInstance.Visibility = visibilityFeature; - - return framedConcernMembershipInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IFramedConcernMembership ReadComplex(Dictionary dictionary) - { - var framedConcernMembershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("kind", out object kindObject)) - { - throw new ArgumentException("The kind property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - RequirementConstraintKind kindFeature = (RequirementConstraintKind)kindObject; - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - List targetFeature = (targetObject as List); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)visibilityObject; - - - framedConcernMembershipInstance.AliasIds = aliasIdsFeature ?? new List(); - framedConcernMembershipInstance.DeclaredName = declaredNameFeature; - framedConcernMembershipInstance.DeclaredShortName = declaredShortNameFeature; - framedConcernMembershipInstance.ElementId = elementIdFeature; - framedConcernMembershipInstance.IsImplied = isImpliedFeature; - framedConcernMembershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - framedConcernMembershipInstance.Kind = kindFeature; - framedConcernMembershipInstance.MemberElement = memberElementFeature; - framedConcernMembershipInstance.MemberName = memberNameFeature; - framedConcernMembershipInstance.MemberShortName = memberShortNameFeature; - framedConcernMembershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - framedConcernMembershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - framedConcernMembershipInstance.OwningRelatedElement = owningRelatedElementFeature; - framedConcernMembershipInstance.OwningRelationship = owningRelationshipFeature; - framedConcernMembershipInstance.Source = sourceFeature ?? new List(); - framedConcernMembershipInstance.Target = targetFeature ?? new List(); - framedConcernMembershipInstance.Visibility = visibilityFeature; - - return framedConcernMembershipInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFramedConcernMembership DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - - var type = Convert.ToString(typeObject); - - if (type != "FramedConcernMembership") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a FramedConcernMembership"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a FramedConcernMembership"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var framedConcernMembershipInstance = new SysML2.NET.Core.DTO.FramedConcernMembership - { - Id = id - }; - - return framedConcernMembershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralIntegerDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralIntegerDictionaryReader.cs deleted file mode 100644 index 4bb780fec..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralIntegerDictionaryReader.cs +++ /dev/null @@ -1,451 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class LiteralIntegerDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static ILiteralInteger ReadSimplified(Dictionary dictionary) - { - var literalIntegerInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("value", out object valueObject)) - { - throw new ArgumentException("The value property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - int valueFeature = Convert.ToInt32(valueObject); - - - literalIntegerInstance.AliasIds = aliasIdsFeature ?? new List(); - literalIntegerInstance.DeclaredName = declaredNameFeature; - literalIntegerInstance.DeclaredShortName = declaredShortNameFeature; - literalIntegerInstance.Direction = directionFeature; - literalIntegerInstance.ElementId = elementIdFeature; - literalIntegerInstance.IsAbstract = isAbstractFeature; - literalIntegerInstance.IsComposite = isCompositeFeature; - literalIntegerInstance.IsConstant = isConstantFeature; - literalIntegerInstance.IsDerived = isDerivedFeature; - literalIntegerInstance.IsEnd = isEndFeature; - literalIntegerInstance.IsImpliedIncluded = isImpliedIncludedFeature; - literalIntegerInstance.IsOrdered = isOrderedFeature; - literalIntegerInstance.IsPortion = isPortionFeature; - literalIntegerInstance.IsSufficient = isSufficientFeature; - literalIntegerInstance.IsUnique = isUniqueFeature; - literalIntegerInstance.IsVariable = isVariableFeature; - literalIntegerInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - literalIntegerInstance.OwningRelationship = owningRelationshipFeature; - literalIntegerInstance.Value = valueFeature; - - return literalIntegerInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static ILiteralInteger ReadComplex(Dictionary dictionary) - { - var literalIntegerInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("value", out object valueObject)) - { - throw new ArgumentException("The value property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - int valueFeature = Convert.ToInt32(valueObject); - - - literalIntegerInstance.AliasIds = aliasIdsFeature ?? new List(); - literalIntegerInstance.DeclaredName = declaredNameFeature; - literalIntegerInstance.DeclaredShortName = declaredShortNameFeature; - literalIntegerInstance.Direction = directionFeature; - literalIntegerInstance.ElementId = elementIdFeature; - literalIntegerInstance.IsAbstract = isAbstractFeature; - literalIntegerInstance.IsComposite = isCompositeFeature; - literalIntegerInstance.IsConstant = isConstantFeature; - literalIntegerInstance.IsDerived = isDerivedFeature; - literalIntegerInstance.IsEnd = isEndFeature; - literalIntegerInstance.IsImpliedIncluded = isImpliedIncludedFeature; - literalIntegerInstance.IsOrdered = isOrderedFeature; - literalIntegerInstance.IsPortion = isPortionFeature; - literalIntegerInstance.IsSufficient = isSufficientFeature; - literalIntegerInstance.IsUnique = isUniqueFeature; - literalIntegerInstance.IsVariable = isVariableFeature; - literalIntegerInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - literalIntegerInstance.OwningRelationship = owningRelationshipFeature; - literalIntegerInstance.Value = valueFeature; - - return literalIntegerInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ILiteralInteger DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - - var type = Convert.ToString(typeObject); - - if (type != "LiteralInteger") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a LiteralInteger"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a LiteralInteger"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var literalIntegerInstance = new SysML2.NET.Core.DTO.LiteralInteger - { - Id = id - }; - - return literalIntegerInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralRationalDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralRationalDictionaryReader.cs deleted file mode 100644 index f1ad6dca3..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/LiteralRationalDictionaryReader.cs +++ /dev/null @@ -1,451 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class LiteralRationalDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static ILiteralRational ReadSimplified(Dictionary dictionary) - { - var literalRationalInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("value", out object valueObject)) - { - throw new ArgumentException("The value property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - double valueFeature = Convert.ToDouble(valueObject); - - - literalRationalInstance.AliasIds = aliasIdsFeature ?? new List(); - literalRationalInstance.DeclaredName = declaredNameFeature; - literalRationalInstance.DeclaredShortName = declaredShortNameFeature; - literalRationalInstance.Direction = directionFeature; - literalRationalInstance.ElementId = elementIdFeature; - literalRationalInstance.IsAbstract = isAbstractFeature; - literalRationalInstance.IsComposite = isCompositeFeature; - literalRationalInstance.IsConstant = isConstantFeature; - literalRationalInstance.IsDerived = isDerivedFeature; - literalRationalInstance.IsEnd = isEndFeature; - literalRationalInstance.IsImpliedIncluded = isImpliedIncludedFeature; - literalRationalInstance.IsOrdered = isOrderedFeature; - literalRationalInstance.IsPortion = isPortionFeature; - literalRationalInstance.IsSufficient = isSufficientFeature; - literalRationalInstance.IsUnique = isUniqueFeature; - literalRationalInstance.IsVariable = isVariableFeature; - literalRationalInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - literalRationalInstance.OwningRelationship = owningRelationshipFeature; - literalRationalInstance.Value = valueFeature; - - return literalRationalInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static ILiteralRational ReadComplex(Dictionary dictionary) - { - var literalRationalInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("value", out object valueObject)) - { - throw new ArgumentException("The value property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - double valueFeature = Convert.ToDouble(valueObject); - - - literalRationalInstance.AliasIds = aliasIdsFeature ?? new List(); - literalRationalInstance.DeclaredName = declaredNameFeature; - literalRationalInstance.DeclaredShortName = declaredShortNameFeature; - literalRationalInstance.Direction = directionFeature; - literalRationalInstance.ElementId = elementIdFeature; - literalRationalInstance.IsAbstract = isAbstractFeature; - literalRationalInstance.IsComposite = isCompositeFeature; - literalRationalInstance.IsConstant = isConstantFeature; - literalRationalInstance.IsDerived = isDerivedFeature; - literalRationalInstance.IsEnd = isEndFeature; - literalRationalInstance.IsImpliedIncluded = isImpliedIncludedFeature; - literalRationalInstance.IsOrdered = isOrderedFeature; - literalRationalInstance.IsPortion = isPortionFeature; - literalRationalInstance.IsSufficient = isSufficientFeature; - literalRationalInstance.IsUnique = isUniqueFeature; - literalRationalInstance.IsVariable = isVariableFeature; - literalRationalInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - literalRationalInstance.OwningRelationship = owningRelationshipFeature; - literalRationalInstance.Value = valueFeature; - - return literalRationalInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ILiteralRational DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - - var type = Convert.ToString(typeObject); - - if (type != "LiteralRational") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a LiteralRational"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a LiteralRational"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var literalRationalInstance = new SysML2.NET.Core.DTO.LiteralRational - { - Id = id - }; - - return literalRationalInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MembershipDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MembershipDictionaryReader.cs deleted file mode 100644 index 79d99ff77..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MembershipDictionaryReader.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class MembershipDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IMembership ReadSimplified(Dictionary dictionary) - { - var membershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)Enum.Parse(typeof(VisibilityKind), Convert.ToString(visibilityObject), true); - - - membershipInstance.AliasIds = aliasIdsFeature ?? new List(); - membershipInstance.DeclaredName = declaredNameFeature; - membershipInstance.DeclaredShortName = declaredShortNameFeature; - membershipInstance.ElementId = elementIdFeature; - membershipInstance.IsImplied = isImpliedFeature; - membershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - membershipInstance.MemberElement = memberElementFeature; - membershipInstance.MemberName = memberNameFeature; - membershipInstance.MemberShortName = memberShortNameFeature; - membershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - membershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - membershipInstance.OwningRelatedElement = owningRelatedElementFeature; - membershipInstance.OwningRelationship = owningRelationshipFeature; - membershipInstance.Source = sourceFeature ?? new List(); - membershipInstance.Target = targetFeature ?? new List(); - membershipInstance.Visibility = visibilityFeature; - - return membershipInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IMembership ReadComplex(Dictionary dictionary) - { - var membershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - List targetFeature = (targetObject as List); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)visibilityObject; - - - membershipInstance.AliasIds = aliasIdsFeature ?? new List(); - membershipInstance.DeclaredName = declaredNameFeature; - membershipInstance.DeclaredShortName = declaredShortNameFeature; - membershipInstance.ElementId = elementIdFeature; - membershipInstance.IsImplied = isImpliedFeature; - membershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - membershipInstance.MemberElement = memberElementFeature; - membershipInstance.MemberName = memberNameFeature; - membershipInstance.MemberShortName = memberShortNameFeature; - membershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - membershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - membershipInstance.OwningRelatedElement = owningRelatedElementFeature; - membershipInstance.OwningRelationship = owningRelationshipFeature; - membershipInstance.Source = sourceFeature ?? new List(); - membershipInstance.Target = targetFeature ?? new List(); - membershipInstance.Visibility = visibilityFeature; - - return membershipInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IMembership DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Membership") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Membership"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Membership"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var membershipInstance = new SysML2.NET.Core.DTO.Membership - { - Id = id - }; - - return membershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MultiplicityRangeDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MultiplicityRangeDictionaryReader.cs deleted file mode 100644 index 98529e608..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/MultiplicityRangeDictionaryReader.cs +++ /dev/null @@ -1,437 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class MultiplicityRangeDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IMultiplicityRange ReadSimplified(Dictionary dictionary) - { - var multiplicityRangeInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - multiplicityRangeInstance.AliasIds = aliasIdsFeature ?? new List(); - multiplicityRangeInstance.DeclaredName = declaredNameFeature; - multiplicityRangeInstance.DeclaredShortName = declaredShortNameFeature; - multiplicityRangeInstance.Direction = directionFeature; - multiplicityRangeInstance.ElementId = elementIdFeature; - multiplicityRangeInstance.IsAbstract = isAbstractFeature; - multiplicityRangeInstance.IsComposite = isCompositeFeature; - multiplicityRangeInstance.IsConstant = isConstantFeature; - multiplicityRangeInstance.IsDerived = isDerivedFeature; - multiplicityRangeInstance.IsEnd = isEndFeature; - multiplicityRangeInstance.IsImpliedIncluded = isImpliedIncludedFeature; - multiplicityRangeInstance.IsOrdered = isOrderedFeature; - multiplicityRangeInstance.IsPortion = isPortionFeature; - multiplicityRangeInstance.IsSufficient = isSufficientFeature; - multiplicityRangeInstance.IsUnique = isUniqueFeature; - multiplicityRangeInstance.IsVariable = isVariableFeature; - multiplicityRangeInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - multiplicityRangeInstance.OwningRelationship = owningRelationshipFeature; - - return multiplicityRangeInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IMultiplicityRange ReadComplex(Dictionary dictionary) - { - var multiplicityRangeInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - multiplicityRangeInstance.AliasIds = aliasIdsFeature ?? new List(); - multiplicityRangeInstance.DeclaredName = declaredNameFeature; - multiplicityRangeInstance.DeclaredShortName = declaredShortNameFeature; - multiplicityRangeInstance.Direction = directionFeature; - multiplicityRangeInstance.ElementId = elementIdFeature; - multiplicityRangeInstance.IsAbstract = isAbstractFeature; - multiplicityRangeInstance.IsComposite = isCompositeFeature; - multiplicityRangeInstance.IsConstant = isConstantFeature; - multiplicityRangeInstance.IsDerived = isDerivedFeature; - multiplicityRangeInstance.IsEnd = isEndFeature; - multiplicityRangeInstance.IsImpliedIncluded = isImpliedIncludedFeature; - multiplicityRangeInstance.IsOrdered = isOrderedFeature; - multiplicityRangeInstance.IsPortion = isPortionFeature; - multiplicityRangeInstance.IsSufficient = isSufficientFeature; - multiplicityRangeInstance.IsUnique = isUniqueFeature; - multiplicityRangeInstance.IsVariable = isVariableFeature; - multiplicityRangeInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - multiplicityRangeInstance.OwningRelationship = owningRelationshipFeature; - - return multiplicityRangeInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IMultiplicityRange DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - - var type = Convert.ToString(typeObject); - - if (type != "MultiplicityRange") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a MultiplicityRange"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a MultiplicityRange"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var multiplicityRangeInstance = new SysML2.NET.Core.DTO.MultiplicityRange - { - Id = id - }; - - return multiplicityRangeInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/OwningMembershipDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/OwningMembershipDictionaryReader.cs deleted file mode 100644 index 2cf1f0ab7..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/OwningMembershipDictionaryReader.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class OwningMembershipDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IOwningMembership ReadSimplified(Dictionary dictionary) - { - var owningMembershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)Enum.Parse(typeof(VisibilityKind), Convert.ToString(visibilityObject), true); - - - owningMembershipInstance.AliasIds = aliasIdsFeature ?? new List(); - owningMembershipInstance.DeclaredName = declaredNameFeature; - owningMembershipInstance.DeclaredShortName = declaredShortNameFeature; - owningMembershipInstance.ElementId = elementIdFeature; - owningMembershipInstance.IsImplied = isImpliedFeature; - owningMembershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - owningMembershipInstance.MemberElement = memberElementFeature; - owningMembershipInstance.MemberName = memberNameFeature; - owningMembershipInstance.MemberShortName = memberShortNameFeature; - owningMembershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - owningMembershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - owningMembershipInstance.OwningRelatedElement = owningRelatedElementFeature; - owningMembershipInstance.OwningRelationship = owningRelationshipFeature; - owningMembershipInstance.Source = sourceFeature ?? new List(); - owningMembershipInstance.Target = targetFeature ?? new List(); - owningMembershipInstance.Visibility = visibilityFeature; - - return owningMembershipInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IOwningMembership ReadComplex(Dictionary dictionary) - { - var owningMembershipInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("memberElement", out object memberElementObject)) - { - throw new ArgumentException("The memberElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid memberElementFeature = Guid.Parse(Convert.ToString(memberElementObject)); - - if (!dictionary.TryGetValue("memberName", out object memberNameObject)) - { - throw new ArgumentException("The memberName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string memberNameFeature = memberNameObject == null ? null : Convert.ToString(memberNameObject); - - if (!dictionary.TryGetValue("memberShortName", out object memberShortNameObject)) - { - throw new ArgumentException("The memberShortName property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - string memberShortNameFeature = memberShortNameObject == null ? null : Convert.ToString(memberShortNameObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - List targetFeature = (targetObject as List); - - if (!dictionary.TryGetValue("visibility", out object visibilityObject)) - { - throw new ArgumentException("The visibility property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - VisibilityKind visibilityFeature = (VisibilityKind)visibilityObject; - - - owningMembershipInstance.AliasIds = aliasIdsFeature ?? new List(); - owningMembershipInstance.DeclaredName = declaredNameFeature; - owningMembershipInstance.DeclaredShortName = declaredShortNameFeature; - owningMembershipInstance.ElementId = elementIdFeature; - owningMembershipInstance.IsImplied = isImpliedFeature; - owningMembershipInstance.IsImpliedIncluded = isImpliedIncludedFeature; - owningMembershipInstance.MemberElement = memberElementFeature; - owningMembershipInstance.MemberName = memberNameFeature; - owningMembershipInstance.MemberShortName = memberShortNameFeature; - owningMembershipInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - owningMembershipInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - owningMembershipInstance.OwningRelatedElement = owningRelatedElementFeature; - owningMembershipInstance.OwningRelationship = owningRelationshipFeature; - owningMembershipInstance.Source = sourceFeature ?? new List(); - owningMembershipInstance.Target = targetFeature ?? new List(); - owningMembershipInstance.Visibility = visibilityFeature; - - return owningMembershipInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IOwningMembership DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - - var type = Convert.ToString(typeObject); - - if (type != "OwningMembership") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a OwningMembership"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a OwningMembership"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var owningMembershipInstance = new SysML2.NET.Core.DTO.OwningMembership - { - Id = id - }; - - return owningMembershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/ReferenceSubsettingDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/ReferenceSubsettingDictionaryReader.cs deleted file mode 100644 index c32b6d63a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/ReferenceSubsettingDictionaryReader.cs +++ /dev/null @@ -1,423 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class ReferenceSubsettingDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IReferenceSubsetting ReadSimplified(Dictionary dictionary) - { - var referenceSubsettingInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("referencedFeature", out object referencedFeatureObject)) - { - throw new ArgumentException("The referencedFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid referencedFeatureFeature = Guid.Parse(Convert.ToString(referencedFeatureObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("subsettedFeature", out object subsettedFeatureObject)) - { - throw new ArgumentException("The subsettedFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid subsettedFeatureFeature = Guid.Parse(Convert.ToString(subsettedFeatureObject)); - - if (!dictionary.TryGetValue("subsettingFeature", out object subsettingFeatureObject)) - { - throw new ArgumentException("The subsettingFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid subsettingFeatureFeature = Guid.Parse(Convert.ToString(subsettingFeatureObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - - referenceSubsettingInstance.AliasIds = aliasIdsFeature ?? new List(); - referenceSubsettingInstance.DeclaredName = declaredNameFeature; - referenceSubsettingInstance.DeclaredShortName = declaredShortNameFeature; - referenceSubsettingInstance.ElementId = elementIdFeature; - referenceSubsettingInstance.General = generalFeature; - referenceSubsettingInstance.IsImplied = isImpliedFeature; - referenceSubsettingInstance.IsImpliedIncluded = isImpliedIncludedFeature; - referenceSubsettingInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - referenceSubsettingInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - referenceSubsettingInstance.OwningRelatedElement = owningRelatedElementFeature; - referenceSubsettingInstance.OwningRelationship = owningRelationshipFeature; - referenceSubsettingInstance.ReferencedFeature = referencedFeatureFeature; - referenceSubsettingInstance.Source = sourceFeature ?? new List(); - referenceSubsettingInstance.Specific = specificFeature; - referenceSubsettingInstance.SubsettedFeature = subsettedFeatureFeature; - referenceSubsettingInstance.SubsettingFeature = subsettingFeatureFeature; - referenceSubsettingInstance.Target = targetFeature ?? new List(); - - return referenceSubsettingInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IReferenceSubsetting ReadComplex(Dictionary dictionary) - { - var referenceSubsettingInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("referencedFeature", out object referencedFeatureObject)) - { - throw new ArgumentException("The referencedFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid referencedFeatureFeature = Guid.Parse(Convert.ToString(referencedFeatureObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("subsettedFeature", out object subsettedFeatureObject)) - { - throw new ArgumentException("The subsettedFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid subsettedFeatureFeature = Guid.Parse(Convert.ToString(subsettedFeatureObject)); - - if (!dictionary.TryGetValue("subsettingFeature", out object subsettingFeatureObject)) - { - throw new ArgumentException("The subsettingFeature property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - Guid subsettingFeatureFeature = Guid.Parse(Convert.ToString(subsettingFeatureObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - List targetFeature = (targetObject as List); - - - referenceSubsettingInstance.AliasIds = aliasIdsFeature ?? new List(); - referenceSubsettingInstance.DeclaredName = declaredNameFeature; - referenceSubsettingInstance.DeclaredShortName = declaredShortNameFeature; - referenceSubsettingInstance.ElementId = elementIdFeature; - referenceSubsettingInstance.General = generalFeature; - referenceSubsettingInstance.IsImplied = isImpliedFeature; - referenceSubsettingInstance.IsImpliedIncluded = isImpliedIncludedFeature; - referenceSubsettingInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - referenceSubsettingInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - referenceSubsettingInstance.OwningRelatedElement = owningRelatedElementFeature; - referenceSubsettingInstance.OwningRelationship = owningRelationshipFeature; - referenceSubsettingInstance.ReferencedFeature = referencedFeatureFeature; - referenceSubsettingInstance.Source = sourceFeature ?? new List(); - referenceSubsettingInstance.Specific = specificFeature; - referenceSubsettingInstance.SubsettedFeature = subsettedFeatureFeature; - referenceSubsettingInstance.SubsettingFeature = subsettingFeatureFeature; - referenceSubsettingInstance.Target = targetFeature ?? new List(); - - return referenceSubsettingInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IReferenceSubsetting DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - - var type = Convert.ToString(typeObject); - - if (type != "ReferenceSubsetting") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a ReferenceSubsetting"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a ReferenceSubsetting"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var referenceSubsettingInstance = new SysML2.NET.Core.DTO.ReferenceSubsetting - { - Id = id - }; - - return referenceSubsettingInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/RequirementUsageDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/RequirementUsageDictionaryReader.cs deleted file mode 100644 index 8a6454afb..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/RequirementUsageDictionaryReader.cs +++ /dev/null @@ -1,493 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class RequirementUsageDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IRequirementUsage ReadSimplified(Dictionary dictionary) - { - var requirementUsageInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isIndividual", out object isIndividualObject)) - { - throw new ArgumentException("The isIndividual property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isIndividualFeature = Convert.ToBoolean(isIndividualObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("portionKind", out object portionKindObject)) - { - throw new ArgumentException("The portionKind property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - PortionKind? portionKindFeature = portionKindObject == null ? null : (PortionKind?)Enum.Parse(typeof(PortionKind), Convert.ToString(portionKindObject), true); - - if (!dictionary.TryGetValue("reqId", out object reqIdObject)) - { - throw new ArgumentException("The reqId property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string reqIdFeature = reqIdObject == null ? null : Convert.ToString(reqIdObject); - - - requirementUsageInstance.AliasIds = aliasIdsFeature ?? new List(); - requirementUsageInstance.DeclaredName = declaredNameFeature; - requirementUsageInstance.DeclaredShortName = declaredShortNameFeature; - requirementUsageInstance.Direction = directionFeature; - requirementUsageInstance.ElementId = elementIdFeature; - requirementUsageInstance.IsAbstract = isAbstractFeature; - requirementUsageInstance.IsComposite = isCompositeFeature; - requirementUsageInstance.IsConstant = isConstantFeature; - requirementUsageInstance.IsDerived = isDerivedFeature; - requirementUsageInstance.IsEnd = isEndFeature; - requirementUsageInstance.IsImpliedIncluded = isImpliedIncludedFeature; - requirementUsageInstance.IsIndividual = isIndividualFeature; - requirementUsageInstance.IsOrdered = isOrderedFeature; - requirementUsageInstance.IsPortion = isPortionFeature; - requirementUsageInstance.IsSufficient = isSufficientFeature; - requirementUsageInstance.IsUnique = isUniqueFeature; - requirementUsageInstance.IsVariable = isVariableFeature; - requirementUsageInstance.IsVariation = isVariationFeature; - requirementUsageInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - requirementUsageInstance.OwningRelationship = owningRelationshipFeature; - requirementUsageInstance.PortionKind = portionKindFeature; - requirementUsageInstance.ReqId = reqIdFeature; - - return requirementUsageInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IRequirementUsage ReadComplex(Dictionary dictionary) - { - var requirementUsageInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isIndividual", out object isIndividualObject)) - { - throw new ArgumentException("The isIndividual property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isIndividualFeature = Convert.ToBoolean(isIndividualObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("portionKind", out object portionKindObject)) - { - throw new ArgumentException("The portionKind property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - PortionKind? portionKindFeature = (PortionKind?)portionKindObject; - - if (!dictionary.TryGetValue("reqId", out object reqIdObject)) - { - throw new ArgumentException("The reqId property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - string reqIdFeature = reqIdObject == null ? null : Convert.ToString(reqIdObject); - - - requirementUsageInstance.AliasIds = aliasIdsFeature ?? new List(); - requirementUsageInstance.DeclaredName = declaredNameFeature; - requirementUsageInstance.DeclaredShortName = declaredShortNameFeature; - requirementUsageInstance.Direction = directionFeature; - requirementUsageInstance.ElementId = elementIdFeature; - requirementUsageInstance.IsAbstract = isAbstractFeature; - requirementUsageInstance.IsComposite = isCompositeFeature; - requirementUsageInstance.IsConstant = isConstantFeature; - requirementUsageInstance.IsDerived = isDerivedFeature; - requirementUsageInstance.IsEnd = isEndFeature; - requirementUsageInstance.IsImpliedIncluded = isImpliedIncludedFeature; - requirementUsageInstance.IsIndividual = isIndividualFeature; - requirementUsageInstance.IsOrdered = isOrderedFeature; - requirementUsageInstance.IsPortion = isPortionFeature; - requirementUsageInstance.IsSufficient = isSufficientFeature; - requirementUsageInstance.IsUnique = isUniqueFeature; - requirementUsageInstance.IsVariable = isVariableFeature; - requirementUsageInstance.IsVariation = isVariationFeature; - requirementUsageInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - requirementUsageInstance.OwningRelationship = owningRelationshipFeature; - requirementUsageInstance.PortionKind = portionKindFeature; - requirementUsageInstance.ReqId = reqIdFeature; - - return requirementUsageInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IRequirementUsage DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - - var type = Convert.ToString(typeObject); - - if (type != "RequirementUsage") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a RequirementUsage"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a RequirementUsage"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var requirementUsageInstance = new SysML2.NET.Core.DTO.RequirementUsage - { - Id = id - }; - - return requirementUsageInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SelectExpressionDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SelectExpressionDictionaryReader.cs deleted file mode 100644 index 434ddb2b1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SelectExpressionDictionaryReader.cs +++ /dev/null @@ -1,451 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class SelectExpressionDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static ISelectExpression ReadSimplified(Dictionary dictionary) - { - var selectExpressionInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("operator", out object operatorObject)) - { - throw new ArgumentException("The operator property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string operatorFeature = Convert.ToString(operatorObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - selectExpressionInstance.AliasIds = aliasIdsFeature ?? new List(); - selectExpressionInstance.DeclaredName = declaredNameFeature; - selectExpressionInstance.DeclaredShortName = declaredShortNameFeature; - selectExpressionInstance.Direction = directionFeature; - selectExpressionInstance.ElementId = elementIdFeature; - selectExpressionInstance.IsAbstract = isAbstractFeature; - selectExpressionInstance.IsComposite = isCompositeFeature; - selectExpressionInstance.IsConstant = isConstantFeature; - selectExpressionInstance.IsDerived = isDerivedFeature; - selectExpressionInstance.IsEnd = isEndFeature; - selectExpressionInstance.IsImpliedIncluded = isImpliedIncludedFeature; - selectExpressionInstance.IsOrdered = isOrderedFeature; - selectExpressionInstance.IsPortion = isPortionFeature; - selectExpressionInstance.IsSufficient = isSufficientFeature; - selectExpressionInstance.IsUnique = isUniqueFeature; - selectExpressionInstance.IsVariable = isVariableFeature; - selectExpressionInstance.Operator = operatorFeature; - selectExpressionInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - selectExpressionInstance.OwningRelationship = owningRelationshipFeature; - - return selectExpressionInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static ISelectExpression ReadComplex(Dictionary dictionary) - { - var selectExpressionInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("operator", out object operatorObject)) - { - throw new ArgumentException("The operator property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - string operatorFeature = Convert.ToString(operatorObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - selectExpressionInstance.AliasIds = aliasIdsFeature ?? new List(); - selectExpressionInstance.DeclaredName = declaredNameFeature; - selectExpressionInstance.DeclaredShortName = declaredShortNameFeature; - selectExpressionInstance.Direction = directionFeature; - selectExpressionInstance.ElementId = elementIdFeature; - selectExpressionInstance.IsAbstract = isAbstractFeature; - selectExpressionInstance.IsComposite = isCompositeFeature; - selectExpressionInstance.IsConstant = isConstantFeature; - selectExpressionInstance.IsDerived = isDerivedFeature; - selectExpressionInstance.IsEnd = isEndFeature; - selectExpressionInstance.IsImpliedIncluded = isImpliedIncludedFeature; - selectExpressionInstance.IsOrdered = isOrderedFeature; - selectExpressionInstance.IsPortion = isPortionFeature; - selectExpressionInstance.IsSufficient = isSufficientFeature; - selectExpressionInstance.IsUnique = isUniqueFeature; - selectExpressionInstance.IsVariable = isVariableFeature; - selectExpressionInstance.Operator = operatorFeature; - selectExpressionInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - selectExpressionInstance.OwningRelationship = owningRelationshipFeature; - - return selectExpressionInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ISelectExpression DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - - var type = Convert.ToString(typeObject); - - if (type != "SelectExpression") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a SelectExpression"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a SelectExpression"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var selectExpressionInstance = new SysML2.NET.Core.DTO.SelectExpression - { - Id = id - }; - - return selectExpressionInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SubclassificationDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SubclassificationDictionaryReader.cs deleted file mode 100644 index 8d8b22cfe..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/SubclassificationDictionaryReader.cs +++ /dev/null @@ -1,409 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class SubclassificationDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static ISubclassification ReadSimplified(Dictionary dictionary) - { - var subclassificationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid? owningRelatedElementFeature = owningRelatedElementObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelatedElementObject)); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List sourceFeature = (sourceObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("subclassifier", out object subclassifierObject)) - { - throw new ArgumentException("The subclassifier property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid subclassifierFeature = Guid.Parse(Convert.ToString(subclassifierObject)); - - if (!dictionary.TryGetValue("superclassifier", out object superclassifierObject)) - { - throw new ArgumentException("The superclassifier property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid superclassifierFeature = Guid.Parse(Convert.ToString(superclassifierObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List targetFeature = (targetObject as List)?.Select(Guid.Parse).ToList(); - - - subclassificationInstance.AliasIds = aliasIdsFeature ?? new List(); - subclassificationInstance.DeclaredName = declaredNameFeature; - subclassificationInstance.DeclaredShortName = declaredShortNameFeature; - subclassificationInstance.ElementId = elementIdFeature; - subclassificationInstance.General = generalFeature; - subclassificationInstance.IsImplied = isImpliedFeature; - subclassificationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - subclassificationInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - subclassificationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - subclassificationInstance.OwningRelatedElement = owningRelatedElementFeature; - subclassificationInstance.OwningRelationship = owningRelationshipFeature; - subclassificationInstance.Source = sourceFeature ?? new List(); - subclassificationInstance.Specific = specificFeature; - subclassificationInstance.Subclassifier = subclassifierFeature; - subclassificationInstance.Superclassifier = superclassifierFeature; - subclassificationInstance.Target = targetFeature ?? new List(); - - return subclassificationInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static ISubclassification ReadComplex(Dictionary dictionary) - { - var subclassificationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("general", out object generalObject)) - { - throw new ArgumentException("The general property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid generalFeature = Guid.Parse(Convert.ToString(generalObject)); - - if (!dictionary.TryGetValue("isImplied", out object isImpliedObject)) - { - throw new ArgumentException("The isImplied property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - bool isImpliedFeature = Convert.ToBoolean(isImpliedObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("ownedRelatedElement", out object ownedRelatedElementObject)) - { - throw new ArgumentException("The ownedRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List ownedRelatedElementFeature = (ownedRelatedElementObject as List); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelatedElement", out object owningRelatedElementObject)) - { - throw new ArgumentException("The owningRelatedElement property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid? owningRelatedElementFeature = (Guid?)owningRelatedElementObject; - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - if (!dictionary.TryGetValue("source", out object sourceObject)) - { - throw new ArgumentException("The source property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List sourceFeature = (sourceObject as List); - - if (!dictionary.TryGetValue("specific", out object specificObject)) - { - throw new ArgumentException("The specific property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid specificFeature = Guid.Parse(Convert.ToString(specificObject)); - - if (!dictionary.TryGetValue("subclassifier", out object subclassifierObject)) - { - throw new ArgumentException("The subclassifier property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid subclassifierFeature = Guid.Parse(Convert.ToString(subclassifierObject)); - - if (!dictionary.TryGetValue("superclassifier", out object superclassifierObject)) - { - throw new ArgumentException("The superclassifier property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - Guid superclassifierFeature = Guid.Parse(Convert.ToString(superclassifierObject)); - - if (!dictionary.TryGetValue("target", out object targetObject)) - { - throw new ArgumentException("The target property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - List targetFeature = (targetObject as List); - - - subclassificationInstance.AliasIds = aliasIdsFeature ?? new List(); - subclassificationInstance.DeclaredName = declaredNameFeature; - subclassificationInstance.DeclaredShortName = declaredShortNameFeature; - subclassificationInstance.ElementId = elementIdFeature; - subclassificationInstance.General = generalFeature; - subclassificationInstance.IsImplied = isImpliedFeature; - subclassificationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - subclassificationInstance.OwnedRelatedElement = ownedRelatedElementFeature ?? new List(); - subclassificationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - subclassificationInstance.OwningRelatedElement = owningRelatedElementFeature; - subclassificationInstance.OwningRelationship = owningRelationshipFeature; - subclassificationInstance.Source = sourceFeature ?? new List(); - subclassificationInstance.Specific = specificFeature; - subclassificationInstance.Subclassifier = subclassifierFeature; - subclassificationInstance.Superclassifier = superclassifierFeature; - subclassificationInstance.Target = targetFeature ?? new List(); - - return subclassificationInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ISubclassification DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Subclassification") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Subclassification"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Subclassification"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var subclassificationInstance = new SysML2.NET.Core.DTO.Subclassification - { - Id = id - }; - - return subclassificationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/TextualRepresentationDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/TextualRepresentationDictionaryReader.cs deleted file mode 100644 index a19f80f70..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/TextualRepresentationDictionaryReader.cs +++ /dev/null @@ -1,311 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class TextualRepresentationDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static ITextualRepresentation ReadSimplified(Dictionary dictionary) - { - var textualRepresentationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("body", out object bodyObject)) - { - throw new ArgumentException("The body property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string bodyFeature = Convert.ToString(bodyObject); - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("language", out object languageObject)) - { - throw new ArgumentException("The language property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string languageFeature = Convert.ToString(languageObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - textualRepresentationInstance.AliasIds = aliasIdsFeature ?? new List(); - textualRepresentationInstance.Body = bodyFeature; - textualRepresentationInstance.DeclaredName = declaredNameFeature; - textualRepresentationInstance.DeclaredShortName = declaredShortNameFeature; - textualRepresentationInstance.ElementId = elementIdFeature; - textualRepresentationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - textualRepresentationInstance.Language = languageFeature; - textualRepresentationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - textualRepresentationInstance.OwningRelationship = owningRelationshipFeature; - - return textualRepresentationInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static ITextualRepresentation ReadComplex(Dictionary dictionary) - { - var textualRepresentationInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("body", out object bodyObject)) - { - throw new ArgumentException("The body property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string bodyFeature = Convert.ToString(bodyObject); - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("language", out object languageObject)) - { - throw new ArgumentException("The language property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - string languageFeature = Convert.ToString(languageObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - textualRepresentationInstance.AliasIds = aliasIdsFeature ?? new List(); - textualRepresentationInstance.Body = bodyFeature; - textualRepresentationInstance.DeclaredName = declaredNameFeature; - textualRepresentationInstance.DeclaredShortName = declaredShortNameFeature; - textualRepresentationInstance.ElementId = elementIdFeature; - textualRepresentationInstance.IsImpliedIncluded = isImpliedIncludedFeature; - textualRepresentationInstance.Language = languageFeature; - textualRepresentationInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - textualRepresentationInstance.OwningRelationship = owningRelationshipFeature; - - return textualRepresentationInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ITextualRepresentation DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - - var type = Convert.ToString(typeObject); - - if (type != "TextualRepresentation") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a TextualRepresentation"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a TextualRepresentation"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var textualRepresentationInstance = new SysML2.NET.Core.DTO.TextualRepresentation - { - Id = id - }; - - return textualRepresentationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/UsageDictionaryReader.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/UsageDictionaryReader.cs deleted file mode 100644 index 838bc1a99..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryReader/UsageDictionaryReader.cs +++ /dev/null @@ -1,451 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using SysML2.NET.Common; - using SysML2.NET.Core; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to read (convert) - /// a from an - /// - public static class UsageDictionaryReader - { - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// The source that is to be read from - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static IData Read(Dictionary dictionary, DictionaryKind dictionaryKind) - { - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return ReadComplex(dictionary); - case DictionaryKind.Simplified: - return ReadSimplified(dictionary); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - /// - /// When the is then the values that are read from the - /// are read as is. When the is - /// then the following applies: - /// The values that are of the following types are read as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted from string, in case these are an then - /// the values are converted from an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static IUsage ReadSimplified(Dictionary dictionary) - { - var usageInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - FeatureDirectionKind? directionFeature = directionObject == null ? null : (FeatureDirectionKind?)Enum.Parse(typeof(FeatureDirectionKind), Convert.ToString(directionObject), true); - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List)?.Select(Guid.Parse).ToList(); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - Guid? owningRelationshipFeature = owningRelationshipObject == null ? (Guid?)null : Guid.Parse(Convert.ToString(owningRelationshipObject)); - - - usageInstance.AliasIds = aliasIdsFeature ?? new List(); - usageInstance.DeclaredName = declaredNameFeature; - usageInstance.DeclaredShortName = declaredShortNameFeature; - usageInstance.Direction = directionFeature; - usageInstance.ElementId = elementIdFeature; - usageInstance.IsAbstract = isAbstractFeature; - usageInstance.IsComposite = isCompositeFeature; - usageInstance.IsConstant = isConstantFeature; - usageInstance.IsDerived = isDerivedFeature; - usageInstance.IsEnd = isEndFeature; - usageInstance.IsImpliedIncluded = isImpliedIncludedFeature; - usageInstance.IsOrdered = isOrderedFeature; - usageInstance.IsPortion = isPortionFeature; - usageInstance.IsSufficient = isSufficientFeature; - usageInstance.IsUnique = isUniqueFeature; - usageInstance.IsVariable = isVariableFeature; - usageInstance.IsVariation = isVariationFeature; - usageInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - usageInstance.OwningRelationship = owningRelationshipFeature; - - return usageInstance; - } - - /// - /// Reads a from a that contains a key-value-pair - /// for each property. - /// - /// - /// The subject that is to be converted into a - /// - /// - /// An instance of - /// - private static IUsage ReadComplex(Dictionary dictionary) - { - var usageInstance = DictionaryNullAndTypeCheck(dictionary); - - if (!dictionary.TryGetValue("aliasIds", out object aliasIdsObject)) - { - throw new ArgumentException("The aliasIds property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - List aliasIdsFeature = aliasIdsObject as List; - - if (!dictionary.TryGetValue("declaredName", out object declaredNameObject)) - { - throw new ArgumentException("The declaredName property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string declaredNameFeature = declaredNameObject == null ? null : Convert.ToString(declaredNameObject); - - if (!dictionary.TryGetValue("declaredShortName", out object declaredShortNameObject)) - { - throw new ArgumentException("The declaredShortName property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string declaredShortNameFeature = declaredShortNameObject == null ? null : Convert.ToString(declaredShortNameObject); - - if (!dictionary.TryGetValue("direction", out object directionObject)) - { - throw new ArgumentException("The direction property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - FeatureDirectionKind? directionFeature = (FeatureDirectionKind?)directionObject; - - if (!dictionary.TryGetValue("elementId", out object elementIdObject)) - { - throw new ArgumentException("The elementId property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - string elementIdFeature = Convert.ToString(elementIdObject); - - if (!dictionary.TryGetValue("isAbstract", out object isAbstractObject)) - { - throw new ArgumentException("The isAbstract property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isAbstractFeature = Convert.ToBoolean(isAbstractObject); - - if (!dictionary.TryGetValue("isComposite", out object isCompositeObject)) - { - throw new ArgumentException("The isComposite property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isCompositeFeature = Convert.ToBoolean(isCompositeObject); - - if (!dictionary.TryGetValue("isConstant", out object isConstantObject)) - { - throw new ArgumentException("The isConstant property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isConstantFeature = Convert.ToBoolean(isConstantObject); - - if (!dictionary.TryGetValue("isDerived", out object isDerivedObject)) - { - throw new ArgumentException("The isDerived property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isDerivedFeature = Convert.ToBoolean(isDerivedObject); - - if (!dictionary.TryGetValue("isEnd", out object isEndObject)) - { - throw new ArgumentException("The isEnd property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isEndFeature = Convert.ToBoolean(isEndObject); - - if (!dictionary.TryGetValue("isImpliedIncluded", out object isImpliedIncludedObject)) - { - throw new ArgumentException("The isImpliedIncluded property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isImpliedIncludedFeature = Convert.ToBoolean(isImpliedIncludedObject); - - if (!dictionary.TryGetValue("isOrdered", out object isOrderedObject)) - { - throw new ArgumentException("The isOrdered property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isOrderedFeature = Convert.ToBoolean(isOrderedObject); - - if (!dictionary.TryGetValue("isPortion", out object isPortionObject)) - { - throw new ArgumentException("The isPortion property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isPortionFeature = Convert.ToBoolean(isPortionObject); - - if (!dictionary.TryGetValue("isSufficient", out object isSufficientObject)) - { - throw new ArgumentException("The isSufficient property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isSufficientFeature = Convert.ToBoolean(isSufficientObject); - - if (!dictionary.TryGetValue("isUnique", out object isUniqueObject)) - { - throw new ArgumentException("The isUnique property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isUniqueFeature = Convert.ToBoolean(isUniqueObject); - - if (!dictionary.TryGetValue("isVariable", out object isVariableObject)) - { - throw new ArgumentException("The isVariable property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isVariableFeature = Convert.ToBoolean(isVariableObject); - - if (!dictionary.TryGetValue("isVariation", out object isVariationObject)) - { - throw new ArgumentException("The isVariation property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - bool isVariationFeature = Convert.ToBoolean(isVariationObject); - - if (!dictionary.TryGetValue("ownedRelationship", out object ownedRelationshipObject)) - { - throw new ArgumentException("The ownedRelationship property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - List ownedRelationshipFeature = (ownedRelationshipObject as List); - - if (!dictionary.TryGetValue("owningRelationship", out object owningRelationshipObject)) - { - throw new ArgumentException("The owningRelationship property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - Guid? owningRelationshipFeature = (Guid?)owningRelationshipObject; - - - usageInstance.AliasIds = aliasIdsFeature ?? new List(); - usageInstance.DeclaredName = declaredNameFeature; - usageInstance.DeclaredShortName = declaredShortNameFeature; - usageInstance.Direction = directionFeature; - usageInstance.ElementId = elementIdFeature; - usageInstance.IsAbstract = isAbstractFeature; - usageInstance.IsComposite = isCompositeFeature; - usageInstance.IsConstant = isConstantFeature; - usageInstance.IsDerived = isDerivedFeature; - usageInstance.IsEnd = isEndFeature; - usageInstance.IsImpliedIncluded = isImpliedIncludedFeature; - usageInstance.IsOrdered = isOrderedFeature; - usageInstance.IsPortion = isPortionFeature; - usageInstance.IsSufficient = isSufficientFeature; - usageInstance.IsUnique = isUniqueFeature; - usageInstance.IsVariable = isVariableFeature; - usageInstance.IsVariation = isVariationFeature; - usageInstance.OwnedRelationship = ownedRelationshipFeature ?? new List(); - usageInstance.OwningRelationship = owningRelationshipFeature; - - return usageInstance; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject that contains the key-value pairs of - /// properties and values. - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IUsage DictionaryNullAndTypeCheck(Dictionary dictionary) - { - if (dictionary == null) - { - throw new ArgumentNullException("dictionary", "The dictionary may not be null"); - } - - if (!dictionary.TryGetValue("@type", out object typeObject)) - { - throw new ArgumentException("The type property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - - var type = Convert.ToString(typeObject); - - if (type != "Usage") - { - throw new ArgumentException($"The dictionary contains an Object is of type {type} and can therefore not be converted into a Usage"); - } - - if (!dictionary.TryGetValue("@id", out object idObject)) - { - throw new ArgumentException("The id property is missing from the dictionary, the dictionary cannot be converted into a Usage"); - } - var id = Guid.Parse(Convert.ToString(idObject)); - - var usageInstance = new SysML2.NET.Core.DTO.Usage - { - Id = id - }; - - return usageInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AnnotatingElementDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AnnotatingElementDictionaryWriter.cs deleted file mode 100644 index 834ad8b42..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AnnotatingElementDictionaryWriter.cs +++ /dev/null @@ -1,189 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class AnnotatingElementDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var annotatingElementInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(annotatingElementInstance); - case DictionaryKind.Simplified: - return WriteSimplified(annotatingElementInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IAnnotatingElement annotatingElementInstance) - { - var dictionary = new Dictionary - { - { "@type", "AnnotatingElement" }, - { "@id", annotatingElementInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", annotatingElementInstance.AliasIds); - dictionary.Add("declaredName", annotatingElementInstance.DeclaredName); - dictionary.Add("declaredShortName", annotatingElementInstance.DeclaredShortName); - dictionary.Add("elementId", annotatingElementInstance.ElementId); - dictionary.Add("isImpliedIncluded", annotatingElementInstance.IsImpliedIncluded); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", annotatingElementInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", annotatingElementInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IAnnotatingElement annotatingElementInstance) - { - var dictionary = new Dictionary - { - { "@type", "AnnotatingElement" }, - { "@id", annotatingElementInstance.Id } - }; - - dictionary.Add("aliasIds", annotatingElementInstance.AliasIds); - dictionary.Add("declaredName", annotatingElementInstance.DeclaredName); - dictionary.Add("declaredShortName", annotatingElementInstance.DeclaredShortName); - dictionary.Add("elementId", annotatingElementInstance.ElementId); - dictionary.Add("isImpliedIncluded", annotatingElementInstance.IsImpliedIncluded); - dictionary.Add("ownedRelationship", annotatingElementInstance.OwnedRelationship); - dictionary.Add("owningRelationship", annotatingElementInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IAnnotatingElement ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IAnnotatingElement annotatingElementInstance)) - { - throw new ArgumentException("The dataItem must be of Type IAnnotatingElement", "dataItem"); - } - - return annotatingElementInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AssociationDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AssociationDictionaryWriter.cs deleted file mode 100644 index b48bfa2da..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/AssociationDictionaryWriter.cs +++ /dev/null @@ -1,203 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class AssociationDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var associationInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(associationInstance); - case DictionaryKind.Simplified: - return WriteSimplified(associationInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IAssociation associationInstance) - { - var dictionary = new Dictionary - { - { "@type", "Association" }, - { "@id", associationInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", associationInstance.AliasIds); - dictionary.Add("declaredName", associationInstance.DeclaredName); - dictionary.Add("declaredShortName", associationInstance.DeclaredShortName); - dictionary.Add("elementId", associationInstance.ElementId); - dictionary.Add("isAbstract", associationInstance.IsAbstract); - dictionary.Add("isImplied", associationInstance.IsImplied); - dictionary.Add("isImpliedIncluded", associationInstance.IsImpliedIncluded); - dictionary.Add("isSufficient", associationInstance.IsSufficient); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", associationInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", associationInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", associationInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", associationInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", associationInstance.Source)} ]"); - dictionary.Add("target", $"[ {string.Join(",", associationInstance.Target)} ]"); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IAssociation associationInstance) - { - var dictionary = new Dictionary - { - { "@type", "Association" }, - { "@id", associationInstance.Id } - }; - - dictionary.Add("aliasIds", associationInstance.AliasIds); - dictionary.Add("declaredName", associationInstance.DeclaredName); - dictionary.Add("declaredShortName", associationInstance.DeclaredShortName); - dictionary.Add("elementId", associationInstance.ElementId); - dictionary.Add("isAbstract", associationInstance.IsAbstract); - dictionary.Add("isImplied", associationInstance.IsImplied); - dictionary.Add("isImpliedIncluded", associationInstance.IsImpliedIncluded); - dictionary.Add("isSufficient", associationInstance.IsSufficient); - dictionary.Add("ownedRelatedElement", associationInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", associationInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", associationInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", associationInstance.OwningRelationship); - dictionary.Add("source", associationInstance.Source); - dictionary.Add("target", associationInstance.Target); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IAssociation ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IAssociation associationInstance)) - { - throw new ArgumentException("The dataItem must be of Type IAssociation", "dataItem"); - } - - return associationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/DependencyDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/DependencyDictionaryWriter.cs deleted file mode 100644 index ad5067c71..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/DependencyDictionaryWriter.cs +++ /dev/null @@ -1,203 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class DependencyDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var dependencyInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(dependencyInstance); - case DictionaryKind.Simplified: - return WriteSimplified(dependencyInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IDependency dependencyInstance) - { - var dictionary = new Dictionary - { - { "@type", "Dependency" }, - { "@id", dependencyInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", dependencyInstance.AliasIds); - dictionary.Add("client", $"[ {string.Join(",", dependencyInstance.Client)} ]"); - dictionary.Add("declaredName", dependencyInstance.DeclaredName); - dictionary.Add("declaredShortName", dependencyInstance.DeclaredShortName); - dictionary.Add("elementId", dependencyInstance.ElementId); - dictionary.Add("isImplied", dependencyInstance.IsImplied); - dictionary.Add("isImpliedIncluded", dependencyInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", dependencyInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", dependencyInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", dependencyInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", dependencyInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", dependencyInstance.Source)} ]"); - dictionary.Add("supplier", $"[ {string.Join(",", dependencyInstance.Supplier)} ]"); - dictionary.Add("target", $"[ {string.Join(",", dependencyInstance.Target)} ]"); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IDependency dependencyInstance) - { - var dictionary = new Dictionary - { - { "@type", "Dependency" }, - { "@id", dependencyInstance.Id } - }; - - dictionary.Add("aliasIds", dependencyInstance.AliasIds); - dictionary.Add("client", dependencyInstance.Client); - dictionary.Add("declaredName", dependencyInstance.DeclaredName); - dictionary.Add("declaredShortName", dependencyInstance.DeclaredShortName); - dictionary.Add("elementId", dependencyInstance.ElementId); - dictionary.Add("isImplied", dependencyInstance.IsImplied); - dictionary.Add("isImpliedIncluded", dependencyInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", dependencyInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", dependencyInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", dependencyInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", dependencyInstance.OwningRelationship); - dictionary.Add("source", dependencyInstance.Source); - dictionary.Add("supplier", dependencyInstance.Supplier); - dictionary.Add("target", dependencyInstance.Target); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IDependency ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IDependency dependencyInstance)) - { - throw new ArgumentException("The dataItem must be of Type IDependency", "dataItem"); - } - - return dependencyInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/EnumerationDefinitionDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/EnumerationDefinitionDictionaryWriter.cs deleted file mode 100644 index 7c8c37761..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/EnumerationDefinitionDictionaryWriter.cs +++ /dev/null @@ -1,195 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class EnumerationDefinitionDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var enumerationDefinitionInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(enumerationDefinitionInstance); - case DictionaryKind.Simplified: - return WriteSimplified(enumerationDefinitionInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IEnumerationDefinition enumerationDefinitionInstance) - { - var dictionary = new Dictionary - { - { "@type", "EnumerationDefinition" }, - { "@id", enumerationDefinitionInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", enumerationDefinitionInstance.AliasIds); - dictionary.Add("declaredName", enumerationDefinitionInstance.DeclaredName); - dictionary.Add("declaredShortName", enumerationDefinitionInstance.DeclaredShortName); - dictionary.Add("elementId", enumerationDefinitionInstance.ElementId); - dictionary.Add("isAbstract", enumerationDefinitionInstance.IsAbstract); - dictionary.Add("isImpliedIncluded", enumerationDefinitionInstance.IsImpliedIncluded); - dictionary.Add("isSufficient", enumerationDefinitionInstance.IsSufficient); - dictionary.Add("isVariation", enumerationDefinitionInstance.IsVariation); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", enumerationDefinitionInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", enumerationDefinitionInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IEnumerationDefinition enumerationDefinitionInstance) - { - var dictionary = new Dictionary - { - { "@type", "EnumerationDefinition" }, - { "@id", enumerationDefinitionInstance.Id } - }; - - dictionary.Add("aliasIds", enumerationDefinitionInstance.AliasIds); - dictionary.Add("declaredName", enumerationDefinitionInstance.DeclaredName); - dictionary.Add("declaredShortName", enumerationDefinitionInstance.DeclaredShortName); - dictionary.Add("elementId", enumerationDefinitionInstance.ElementId); - dictionary.Add("isAbstract", enumerationDefinitionInstance.IsAbstract); - dictionary.Add("isImpliedIncluded", enumerationDefinitionInstance.IsImpliedIncluded); - dictionary.Add("isSufficient", enumerationDefinitionInstance.IsSufficient); - dictionary.Add("isVariation", enumerationDefinitionInstance.IsVariation); - dictionary.Add("ownedRelationship", enumerationDefinitionInstance.OwnedRelationship); - dictionary.Add("owningRelationship", enumerationDefinitionInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IEnumerationDefinition ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IEnumerationDefinition enumerationDefinitionInstance)) - { - throw new ArgumentException("The dataItem must be of Type IEnumerationDefinition", "dataItem"); - } - - return enumerationDefinitionInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureDictionaryWriter.cs deleted file mode 100644 index cdb84ecda..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureDictionaryWriter.cs +++ /dev/null @@ -1,211 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class FeatureDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var featureInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(featureInstance); - case DictionaryKind.Simplified: - return WriteSimplified(featureInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IFeature featureInstance) - { - var dictionary = new Dictionary - { - { "@type", "Feature" }, - { "@id", featureInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", featureInstance.AliasIds); - dictionary.Add("declaredName", featureInstance.DeclaredName); - dictionary.Add("declaredShortName", featureInstance.DeclaredShortName); - dictionary.Add("direction", featureInstance.Direction); - dictionary.Add("elementId", featureInstance.ElementId); - dictionary.Add("isAbstract", featureInstance.IsAbstract); - dictionary.Add("isComposite", featureInstance.IsComposite); - dictionary.Add("isConstant", featureInstance.IsConstant); - dictionary.Add("isDerived", featureInstance.IsDerived); - dictionary.Add("isEnd", featureInstance.IsEnd); - dictionary.Add("isImpliedIncluded", featureInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", featureInstance.IsOrdered); - dictionary.Add("isPortion", featureInstance.IsPortion); - dictionary.Add("isSufficient", featureInstance.IsSufficient); - dictionary.Add("isUnique", featureInstance.IsUnique); - dictionary.Add("isVariable", featureInstance.IsVariable); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", featureInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", featureInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IFeature featureInstance) - { - var dictionary = new Dictionary - { - { "@type", "Feature" }, - { "@id", featureInstance.Id } - }; - - dictionary.Add("aliasIds", featureInstance.AliasIds); - dictionary.Add("declaredName", featureInstance.DeclaredName); - dictionary.Add("declaredShortName", featureInstance.DeclaredShortName); - dictionary.Add("direction", featureInstance.Direction); - dictionary.Add("elementId", featureInstance.ElementId); - dictionary.Add("isAbstract", featureInstance.IsAbstract); - dictionary.Add("isComposite", featureInstance.IsComposite); - dictionary.Add("isConstant", featureInstance.IsConstant); - dictionary.Add("isDerived", featureInstance.IsDerived); - dictionary.Add("isEnd", featureInstance.IsEnd); - dictionary.Add("isImpliedIncluded", featureInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", featureInstance.IsOrdered); - dictionary.Add("isPortion", featureInstance.IsPortion); - dictionary.Add("isSufficient", featureInstance.IsSufficient); - dictionary.Add("isUnique", featureInstance.IsUnique); - dictionary.Add("isVariable", featureInstance.IsVariable); - dictionary.Add("ownedRelationship", featureInstance.OwnedRelationship); - dictionary.Add("owningRelationship", featureInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFeature ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IFeature featureInstance)) - { - throw new ArgumentException("The dataItem must be of Type IFeature", "dataItem"); - } - - return featureInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureTypingDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureTypingDictionaryWriter.cs deleted file mode 100644 index ee8823819..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FeatureTypingDictionaryWriter.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class FeatureTypingDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var featureTypingInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(featureTypingInstance); - case DictionaryKind.Simplified: - return WriteSimplified(featureTypingInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IFeatureTyping featureTypingInstance) - { - var dictionary = new Dictionary - { - { "@type", "FeatureTyping" }, - { "@id", featureTypingInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", featureTypingInstance.AliasIds); - dictionary.Add("declaredName", featureTypingInstance.DeclaredName); - dictionary.Add("declaredShortName", featureTypingInstance.DeclaredShortName); - dictionary.Add("elementId", featureTypingInstance.ElementId); - dictionary.Add("general", featureTypingInstance.General.ToString()); - dictionary.Add("isImplied", featureTypingInstance.IsImplied); - dictionary.Add("isImpliedIncluded", featureTypingInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", featureTypingInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", featureTypingInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", featureTypingInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", featureTypingInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", featureTypingInstance.Source)} ]"); - dictionary.Add("specific", featureTypingInstance.Specific.ToString()); - dictionary.Add("target", $"[ {string.Join(",", featureTypingInstance.Target)} ]"); - dictionary.Add("type", featureTypingInstance.Type.ToString()); - dictionary.Add("typedFeature", featureTypingInstance.TypedFeature.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IFeatureTyping featureTypingInstance) - { - var dictionary = new Dictionary - { - { "@type", "FeatureTyping" }, - { "@id", featureTypingInstance.Id } - }; - - dictionary.Add("aliasIds", featureTypingInstance.AliasIds); - dictionary.Add("declaredName", featureTypingInstance.DeclaredName); - dictionary.Add("declaredShortName", featureTypingInstance.DeclaredShortName); - dictionary.Add("elementId", featureTypingInstance.ElementId); - dictionary.Add("general", featureTypingInstance.General); - dictionary.Add("isImplied", featureTypingInstance.IsImplied); - dictionary.Add("isImpliedIncluded", featureTypingInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", featureTypingInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", featureTypingInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", featureTypingInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", featureTypingInstance.OwningRelationship); - dictionary.Add("source", featureTypingInstance.Source); - dictionary.Add("specific", featureTypingInstance.Specific); - dictionary.Add("target", featureTypingInstance.Target); - dictionary.Add("type", featureTypingInstance.Type); - dictionary.Add("typedFeature", featureTypingInstance.TypedFeature); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFeatureTyping ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IFeatureTyping featureTypingInstance)) - { - throw new ArgumentException("The dataItem must be of Type IFeatureTyping", "dataItem"); - } - - return featureTypingInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FlowDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FlowDictionaryWriter.cs deleted file mode 100644 index 9c52fbad2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FlowDictionaryWriter.cs +++ /dev/null @@ -1,221 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class FlowDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var flowInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(flowInstance); - case DictionaryKind.Simplified: - return WriteSimplified(flowInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IFlow flowInstance) - { - var dictionary = new Dictionary - { - { "@type", "Flow" }, - { "@id", flowInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", flowInstance.AliasIds); - dictionary.Add("declaredName", flowInstance.DeclaredName); - dictionary.Add("declaredShortName", flowInstance.DeclaredShortName); - dictionary.Add("direction", flowInstance.Direction); - dictionary.Add("elementId", flowInstance.ElementId); - dictionary.Add("isAbstract", flowInstance.IsAbstract); - dictionary.Add("isComposite", flowInstance.IsComposite); - dictionary.Add("isConstant", flowInstance.IsConstant); - dictionary.Add("isDerived", flowInstance.IsDerived); - dictionary.Add("isEnd", flowInstance.IsEnd); - dictionary.Add("isImplied", flowInstance.IsImplied); - dictionary.Add("isImpliedIncluded", flowInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", flowInstance.IsOrdered); - dictionary.Add("isPortion", flowInstance.IsPortion); - dictionary.Add("isSufficient", flowInstance.IsSufficient); - dictionary.Add("isUnique", flowInstance.IsUnique); - dictionary.Add("isVariable", flowInstance.IsVariable); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", flowInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", flowInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", flowInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", flowInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", flowInstance.Source)} ]"); - dictionary.Add("target", $"[ {string.Join(",", flowInstance.Target)} ]"); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IFlow flowInstance) - { - var dictionary = new Dictionary - { - { "@type", "Flow" }, - { "@id", flowInstance.Id } - }; - - dictionary.Add("aliasIds", flowInstance.AliasIds); - dictionary.Add("declaredName", flowInstance.DeclaredName); - dictionary.Add("declaredShortName", flowInstance.DeclaredShortName); - dictionary.Add("direction", flowInstance.Direction); - dictionary.Add("elementId", flowInstance.ElementId); - dictionary.Add("isAbstract", flowInstance.IsAbstract); - dictionary.Add("isComposite", flowInstance.IsComposite); - dictionary.Add("isConstant", flowInstance.IsConstant); - dictionary.Add("isDerived", flowInstance.IsDerived); - dictionary.Add("isEnd", flowInstance.IsEnd); - dictionary.Add("isImplied", flowInstance.IsImplied); - dictionary.Add("isImpliedIncluded", flowInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", flowInstance.IsOrdered); - dictionary.Add("isPortion", flowInstance.IsPortion); - dictionary.Add("isSufficient", flowInstance.IsSufficient); - dictionary.Add("isUnique", flowInstance.IsUnique); - dictionary.Add("isVariable", flowInstance.IsVariable); - dictionary.Add("ownedRelatedElement", flowInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", flowInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", flowInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", flowInstance.OwningRelationship); - dictionary.Add("source", flowInstance.Source); - dictionary.Add("target", flowInstance.Target); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFlow ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IFlow flowInstance)) - { - throw new ArgumentException("The dataItem must be of Type IFlow", "dataItem"); - } - - return flowInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FramedConcernMembershipDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FramedConcernMembershipDictionaryWriter.cs deleted file mode 100644 index a12dac438..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/FramedConcernMembershipDictionaryWriter.cs +++ /dev/null @@ -1,209 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class FramedConcernMembershipDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var framedConcernMembershipInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(framedConcernMembershipInstance); - case DictionaryKind.Simplified: - return WriteSimplified(framedConcernMembershipInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IFramedConcernMembership framedConcernMembershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "FramedConcernMembership" }, - { "@id", framedConcernMembershipInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", framedConcernMembershipInstance.AliasIds); - dictionary.Add("declaredName", framedConcernMembershipInstance.DeclaredName); - dictionary.Add("declaredShortName", framedConcernMembershipInstance.DeclaredShortName); - dictionary.Add("elementId", framedConcernMembershipInstance.ElementId); - dictionary.Add("isImplied", framedConcernMembershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", framedConcernMembershipInstance.IsImpliedIncluded); - dictionary.Add("kind", framedConcernMembershipInstance.Kind); - dictionary.Add("memberElement", framedConcernMembershipInstance.MemberElement.ToString()); - dictionary.Add("memberName", framedConcernMembershipInstance.MemberName); - dictionary.Add("memberShortName", framedConcernMembershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", framedConcernMembershipInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", framedConcernMembershipInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", framedConcernMembershipInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", framedConcernMembershipInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", framedConcernMembershipInstance.Source)} ]"); - dictionary.Add("target", $"[ {string.Join(",", framedConcernMembershipInstance.Target)} ]"); - dictionary.Add("visibility", framedConcernMembershipInstance.Visibility); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IFramedConcernMembership framedConcernMembershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "FramedConcernMembership" }, - { "@id", framedConcernMembershipInstance.Id } - }; - - dictionary.Add("aliasIds", framedConcernMembershipInstance.AliasIds); - dictionary.Add("declaredName", framedConcernMembershipInstance.DeclaredName); - dictionary.Add("declaredShortName", framedConcernMembershipInstance.DeclaredShortName); - dictionary.Add("elementId", framedConcernMembershipInstance.ElementId); - dictionary.Add("isImplied", framedConcernMembershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", framedConcernMembershipInstance.IsImpliedIncluded); - dictionary.Add("kind", framedConcernMembershipInstance.Kind); - dictionary.Add("memberElement", framedConcernMembershipInstance.MemberElement); - dictionary.Add("memberName", framedConcernMembershipInstance.MemberName); - dictionary.Add("memberShortName", framedConcernMembershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", framedConcernMembershipInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", framedConcernMembershipInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", framedConcernMembershipInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", framedConcernMembershipInstance.OwningRelationship); - dictionary.Add("source", framedConcernMembershipInstance.Source); - dictionary.Add("target", framedConcernMembershipInstance.Target); - dictionary.Add("visibility", framedConcernMembershipInstance.Visibility); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IFramedConcernMembership ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IFramedConcernMembership framedConcernMembershipInstance)) - { - throw new ArgumentException("The dataItem must be of Type IFramedConcernMembership", "dataItem"); - } - - return framedConcernMembershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralIntegerDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralIntegerDictionaryWriter.cs deleted file mode 100644 index 9690d5807..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralIntegerDictionaryWriter.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class LiteralIntegerDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var literalIntegerInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(literalIntegerInstance); - case DictionaryKind.Simplified: - return WriteSimplified(literalIntegerInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(ILiteralInteger literalIntegerInstance) - { - var dictionary = new Dictionary - { - { "@type", "LiteralInteger" }, - { "@id", literalIntegerInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", literalIntegerInstance.AliasIds); - dictionary.Add("declaredName", literalIntegerInstance.DeclaredName); - dictionary.Add("declaredShortName", literalIntegerInstance.DeclaredShortName); - dictionary.Add("direction", literalIntegerInstance.Direction); - dictionary.Add("elementId", literalIntegerInstance.ElementId); - dictionary.Add("isAbstract", literalIntegerInstance.IsAbstract); - dictionary.Add("isComposite", literalIntegerInstance.IsComposite); - dictionary.Add("isConstant", literalIntegerInstance.IsConstant); - dictionary.Add("isDerived", literalIntegerInstance.IsDerived); - dictionary.Add("isEnd", literalIntegerInstance.IsEnd); - dictionary.Add("isImpliedIncluded", literalIntegerInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", literalIntegerInstance.IsOrdered); - dictionary.Add("isPortion", literalIntegerInstance.IsPortion); - dictionary.Add("isSufficient", literalIntegerInstance.IsSufficient); - dictionary.Add("isUnique", literalIntegerInstance.IsUnique); - dictionary.Add("isVariable", literalIntegerInstance.IsVariable); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", literalIntegerInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", literalIntegerInstance.OwningRelationship.ToString()); - dictionary.Add("value", literalIntegerInstance.Value); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(ILiteralInteger literalIntegerInstance) - { - var dictionary = new Dictionary - { - { "@type", "LiteralInteger" }, - { "@id", literalIntegerInstance.Id } - }; - - dictionary.Add("aliasIds", literalIntegerInstance.AliasIds); - dictionary.Add("declaredName", literalIntegerInstance.DeclaredName); - dictionary.Add("declaredShortName", literalIntegerInstance.DeclaredShortName); - dictionary.Add("direction", literalIntegerInstance.Direction); - dictionary.Add("elementId", literalIntegerInstance.ElementId); - dictionary.Add("isAbstract", literalIntegerInstance.IsAbstract); - dictionary.Add("isComposite", literalIntegerInstance.IsComposite); - dictionary.Add("isConstant", literalIntegerInstance.IsConstant); - dictionary.Add("isDerived", literalIntegerInstance.IsDerived); - dictionary.Add("isEnd", literalIntegerInstance.IsEnd); - dictionary.Add("isImpliedIncluded", literalIntegerInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", literalIntegerInstance.IsOrdered); - dictionary.Add("isPortion", literalIntegerInstance.IsPortion); - dictionary.Add("isSufficient", literalIntegerInstance.IsSufficient); - dictionary.Add("isUnique", literalIntegerInstance.IsUnique); - dictionary.Add("isVariable", literalIntegerInstance.IsVariable); - dictionary.Add("ownedRelationship", literalIntegerInstance.OwnedRelationship); - dictionary.Add("owningRelationship", literalIntegerInstance.OwningRelationship); - dictionary.Add("value", literalIntegerInstance.Value); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ILiteralInteger ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is ILiteralInteger literalIntegerInstance)) - { - throw new ArgumentException("The dataItem must be of Type ILiteralInteger", "dataItem"); - } - - return literalIntegerInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralRationalDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralRationalDictionaryWriter.cs deleted file mode 100644 index 23c559481..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/LiteralRationalDictionaryWriter.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class LiteralRationalDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var literalRationalInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(literalRationalInstance); - case DictionaryKind.Simplified: - return WriteSimplified(literalRationalInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(ILiteralRational literalRationalInstance) - { - var dictionary = new Dictionary - { - { "@type", "LiteralRational" }, - { "@id", literalRationalInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", literalRationalInstance.AliasIds); - dictionary.Add("declaredName", literalRationalInstance.DeclaredName); - dictionary.Add("declaredShortName", literalRationalInstance.DeclaredShortName); - dictionary.Add("direction", literalRationalInstance.Direction); - dictionary.Add("elementId", literalRationalInstance.ElementId); - dictionary.Add("isAbstract", literalRationalInstance.IsAbstract); - dictionary.Add("isComposite", literalRationalInstance.IsComposite); - dictionary.Add("isConstant", literalRationalInstance.IsConstant); - dictionary.Add("isDerived", literalRationalInstance.IsDerived); - dictionary.Add("isEnd", literalRationalInstance.IsEnd); - dictionary.Add("isImpliedIncluded", literalRationalInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", literalRationalInstance.IsOrdered); - dictionary.Add("isPortion", literalRationalInstance.IsPortion); - dictionary.Add("isSufficient", literalRationalInstance.IsSufficient); - dictionary.Add("isUnique", literalRationalInstance.IsUnique); - dictionary.Add("isVariable", literalRationalInstance.IsVariable); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", literalRationalInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", literalRationalInstance.OwningRelationship.ToString()); - dictionary.Add("value", literalRationalInstance.Value); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(ILiteralRational literalRationalInstance) - { - var dictionary = new Dictionary - { - { "@type", "LiteralRational" }, - { "@id", literalRationalInstance.Id } - }; - - dictionary.Add("aliasIds", literalRationalInstance.AliasIds); - dictionary.Add("declaredName", literalRationalInstance.DeclaredName); - dictionary.Add("declaredShortName", literalRationalInstance.DeclaredShortName); - dictionary.Add("direction", literalRationalInstance.Direction); - dictionary.Add("elementId", literalRationalInstance.ElementId); - dictionary.Add("isAbstract", literalRationalInstance.IsAbstract); - dictionary.Add("isComposite", literalRationalInstance.IsComposite); - dictionary.Add("isConstant", literalRationalInstance.IsConstant); - dictionary.Add("isDerived", literalRationalInstance.IsDerived); - dictionary.Add("isEnd", literalRationalInstance.IsEnd); - dictionary.Add("isImpliedIncluded", literalRationalInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", literalRationalInstance.IsOrdered); - dictionary.Add("isPortion", literalRationalInstance.IsPortion); - dictionary.Add("isSufficient", literalRationalInstance.IsSufficient); - dictionary.Add("isUnique", literalRationalInstance.IsUnique); - dictionary.Add("isVariable", literalRationalInstance.IsVariable); - dictionary.Add("ownedRelationship", literalRationalInstance.OwnedRelationship); - dictionary.Add("owningRelationship", literalRationalInstance.OwningRelationship); - dictionary.Add("value", literalRationalInstance.Value); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ILiteralRational ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is ILiteralRational literalRationalInstance)) - { - throw new ArgumentException("The dataItem must be of Type ILiteralRational", "dataItem"); - } - - return literalRationalInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MembershipDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MembershipDictionaryWriter.cs deleted file mode 100644 index 894750b4c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MembershipDictionaryWriter.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class MembershipDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var membershipInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(membershipInstance); - case DictionaryKind.Simplified: - return WriteSimplified(membershipInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IMembership membershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "Membership" }, - { "@id", membershipInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", membershipInstance.AliasIds); - dictionary.Add("declaredName", membershipInstance.DeclaredName); - dictionary.Add("declaredShortName", membershipInstance.DeclaredShortName); - dictionary.Add("elementId", membershipInstance.ElementId); - dictionary.Add("isImplied", membershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", membershipInstance.IsImpliedIncluded); - dictionary.Add("memberElement", membershipInstance.MemberElement.ToString()); - dictionary.Add("memberName", membershipInstance.MemberName); - dictionary.Add("memberShortName", membershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", membershipInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", membershipInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", membershipInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", membershipInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", membershipInstance.Source)} ]"); - dictionary.Add("target", $"[ {string.Join(",", membershipInstance.Target)} ]"); - dictionary.Add("visibility", membershipInstance.Visibility); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IMembership membershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "Membership" }, - { "@id", membershipInstance.Id } - }; - - dictionary.Add("aliasIds", membershipInstance.AliasIds); - dictionary.Add("declaredName", membershipInstance.DeclaredName); - dictionary.Add("declaredShortName", membershipInstance.DeclaredShortName); - dictionary.Add("elementId", membershipInstance.ElementId); - dictionary.Add("isImplied", membershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", membershipInstance.IsImpliedIncluded); - dictionary.Add("memberElement", membershipInstance.MemberElement); - dictionary.Add("memberName", membershipInstance.MemberName); - dictionary.Add("memberShortName", membershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", membershipInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", membershipInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", membershipInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", membershipInstance.OwningRelationship); - dictionary.Add("source", membershipInstance.Source); - dictionary.Add("target", membershipInstance.Target); - dictionary.Add("visibility", membershipInstance.Visibility); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IMembership ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IMembership membershipInstance)) - { - throw new ArgumentException("The dataItem must be of Type IMembership", "dataItem"); - } - - return membershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MultiplicityRangeDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MultiplicityRangeDictionaryWriter.cs deleted file mode 100644 index e7509283b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/MultiplicityRangeDictionaryWriter.cs +++ /dev/null @@ -1,211 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class MultiplicityRangeDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var multiplicityRangeInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(multiplicityRangeInstance); - case DictionaryKind.Simplified: - return WriteSimplified(multiplicityRangeInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IMultiplicityRange multiplicityRangeInstance) - { - var dictionary = new Dictionary - { - { "@type", "MultiplicityRange" }, - { "@id", multiplicityRangeInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", multiplicityRangeInstance.AliasIds); - dictionary.Add("declaredName", multiplicityRangeInstance.DeclaredName); - dictionary.Add("declaredShortName", multiplicityRangeInstance.DeclaredShortName); - dictionary.Add("direction", multiplicityRangeInstance.Direction); - dictionary.Add("elementId", multiplicityRangeInstance.ElementId); - dictionary.Add("isAbstract", multiplicityRangeInstance.IsAbstract); - dictionary.Add("isComposite", multiplicityRangeInstance.IsComposite); - dictionary.Add("isConstant", multiplicityRangeInstance.IsConstant); - dictionary.Add("isDerived", multiplicityRangeInstance.IsDerived); - dictionary.Add("isEnd", multiplicityRangeInstance.IsEnd); - dictionary.Add("isImpliedIncluded", multiplicityRangeInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", multiplicityRangeInstance.IsOrdered); - dictionary.Add("isPortion", multiplicityRangeInstance.IsPortion); - dictionary.Add("isSufficient", multiplicityRangeInstance.IsSufficient); - dictionary.Add("isUnique", multiplicityRangeInstance.IsUnique); - dictionary.Add("isVariable", multiplicityRangeInstance.IsVariable); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", multiplicityRangeInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", multiplicityRangeInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IMultiplicityRange multiplicityRangeInstance) - { - var dictionary = new Dictionary - { - { "@type", "MultiplicityRange" }, - { "@id", multiplicityRangeInstance.Id } - }; - - dictionary.Add("aliasIds", multiplicityRangeInstance.AliasIds); - dictionary.Add("declaredName", multiplicityRangeInstance.DeclaredName); - dictionary.Add("declaredShortName", multiplicityRangeInstance.DeclaredShortName); - dictionary.Add("direction", multiplicityRangeInstance.Direction); - dictionary.Add("elementId", multiplicityRangeInstance.ElementId); - dictionary.Add("isAbstract", multiplicityRangeInstance.IsAbstract); - dictionary.Add("isComposite", multiplicityRangeInstance.IsComposite); - dictionary.Add("isConstant", multiplicityRangeInstance.IsConstant); - dictionary.Add("isDerived", multiplicityRangeInstance.IsDerived); - dictionary.Add("isEnd", multiplicityRangeInstance.IsEnd); - dictionary.Add("isImpliedIncluded", multiplicityRangeInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", multiplicityRangeInstance.IsOrdered); - dictionary.Add("isPortion", multiplicityRangeInstance.IsPortion); - dictionary.Add("isSufficient", multiplicityRangeInstance.IsSufficient); - dictionary.Add("isUnique", multiplicityRangeInstance.IsUnique); - dictionary.Add("isVariable", multiplicityRangeInstance.IsVariable); - dictionary.Add("ownedRelationship", multiplicityRangeInstance.OwnedRelationship); - dictionary.Add("owningRelationship", multiplicityRangeInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IMultiplicityRange ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IMultiplicityRange multiplicityRangeInstance)) - { - throw new ArgumentException("The dataItem must be of Type IMultiplicityRange", "dataItem"); - } - - return multiplicityRangeInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/OwningMembershipDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/OwningMembershipDictionaryWriter.cs deleted file mode 100644 index 67f972c9e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/OwningMembershipDictionaryWriter.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class OwningMembershipDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var owningMembershipInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(owningMembershipInstance); - case DictionaryKind.Simplified: - return WriteSimplified(owningMembershipInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IOwningMembership owningMembershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "OwningMembership" }, - { "@id", owningMembershipInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", owningMembershipInstance.AliasIds); - dictionary.Add("declaredName", owningMembershipInstance.DeclaredName); - dictionary.Add("declaredShortName", owningMembershipInstance.DeclaredShortName); - dictionary.Add("elementId", owningMembershipInstance.ElementId); - dictionary.Add("isImplied", owningMembershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", owningMembershipInstance.IsImpliedIncluded); - dictionary.Add("memberElement", owningMembershipInstance.MemberElement.ToString()); - dictionary.Add("memberName", owningMembershipInstance.MemberName); - dictionary.Add("memberShortName", owningMembershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", owningMembershipInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", owningMembershipInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", owningMembershipInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", owningMembershipInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", owningMembershipInstance.Source)} ]"); - dictionary.Add("target", $"[ {string.Join(",", owningMembershipInstance.Target)} ]"); - dictionary.Add("visibility", owningMembershipInstance.Visibility); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IOwningMembership owningMembershipInstance) - { - var dictionary = new Dictionary - { - { "@type", "OwningMembership" }, - { "@id", owningMembershipInstance.Id } - }; - - dictionary.Add("aliasIds", owningMembershipInstance.AliasIds); - dictionary.Add("declaredName", owningMembershipInstance.DeclaredName); - dictionary.Add("declaredShortName", owningMembershipInstance.DeclaredShortName); - dictionary.Add("elementId", owningMembershipInstance.ElementId); - dictionary.Add("isImplied", owningMembershipInstance.IsImplied); - dictionary.Add("isImpliedIncluded", owningMembershipInstance.IsImpliedIncluded); - dictionary.Add("memberElement", owningMembershipInstance.MemberElement); - dictionary.Add("memberName", owningMembershipInstance.MemberName); - dictionary.Add("memberShortName", owningMembershipInstance.MemberShortName); - dictionary.Add("ownedRelatedElement", owningMembershipInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", owningMembershipInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", owningMembershipInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", owningMembershipInstance.OwningRelationship); - dictionary.Add("source", owningMembershipInstance.Source); - dictionary.Add("target", owningMembershipInstance.Target); - dictionary.Add("visibility", owningMembershipInstance.Visibility); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IOwningMembership ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IOwningMembership owningMembershipInstance)) - { - throw new ArgumentException("The dataItem must be of Type IOwningMembership", "dataItem"); - } - - return owningMembershipInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/ReferenceSubsettingDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/ReferenceSubsettingDictionaryWriter.cs deleted file mode 100644 index e30061f4f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/ReferenceSubsettingDictionaryWriter.cs +++ /dev/null @@ -1,209 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class ReferenceSubsettingDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var referenceSubsettingInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(referenceSubsettingInstance); - case DictionaryKind.Simplified: - return WriteSimplified(referenceSubsettingInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IReferenceSubsetting referenceSubsettingInstance) - { - var dictionary = new Dictionary - { - { "@type", "ReferenceSubsetting" }, - { "@id", referenceSubsettingInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", referenceSubsettingInstance.AliasIds); - dictionary.Add("declaredName", referenceSubsettingInstance.DeclaredName); - dictionary.Add("declaredShortName", referenceSubsettingInstance.DeclaredShortName); - dictionary.Add("elementId", referenceSubsettingInstance.ElementId); - dictionary.Add("general", referenceSubsettingInstance.General.ToString()); - dictionary.Add("isImplied", referenceSubsettingInstance.IsImplied); - dictionary.Add("isImpliedIncluded", referenceSubsettingInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", referenceSubsettingInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", referenceSubsettingInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", referenceSubsettingInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", referenceSubsettingInstance.OwningRelationship.ToString()); - dictionary.Add("referencedFeature", referenceSubsettingInstance.ReferencedFeature.ToString()); - dictionary.Add("source", $"[ {string.Join(",", referenceSubsettingInstance.Source)} ]"); - dictionary.Add("specific", referenceSubsettingInstance.Specific.ToString()); - dictionary.Add("subsettedFeature", referenceSubsettingInstance.SubsettedFeature.ToString()); - dictionary.Add("subsettingFeature", referenceSubsettingInstance.SubsettingFeature.ToString()); - dictionary.Add("target", $"[ {string.Join(",", referenceSubsettingInstance.Target)} ]"); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IReferenceSubsetting referenceSubsettingInstance) - { - var dictionary = new Dictionary - { - { "@type", "ReferenceSubsetting" }, - { "@id", referenceSubsettingInstance.Id } - }; - - dictionary.Add("aliasIds", referenceSubsettingInstance.AliasIds); - dictionary.Add("declaredName", referenceSubsettingInstance.DeclaredName); - dictionary.Add("declaredShortName", referenceSubsettingInstance.DeclaredShortName); - dictionary.Add("elementId", referenceSubsettingInstance.ElementId); - dictionary.Add("general", referenceSubsettingInstance.General); - dictionary.Add("isImplied", referenceSubsettingInstance.IsImplied); - dictionary.Add("isImpliedIncluded", referenceSubsettingInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", referenceSubsettingInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", referenceSubsettingInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", referenceSubsettingInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", referenceSubsettingInstance.OwningRelationship); - dictionary.Add("referencedFeature", referenceSubsettingInstance.ReferencedFeature); - dictionary.Add("source", referenceSubsettingInstance.Source); - dictionary.Add("specific", referenceSubsettingInstance.Specific); - dictionary.Add("subsettedFeature", referenceSubsettingInstance.SubsettedFeature); - dictionary.Add("subsettingFeature", referenceSubsettingInstance.SubsettingFeature); - dictionary.Add("target", referenceSubsettingInstance.Target); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IReferenceSubsetting ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IReferenceSubsetting referenceSubsettingInstance)) - { - throw new ArgumentException("The dataItem must be of Type IReferenceSubsetting", "dataItem"); - } - - return referenceSubsettingInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/RequirementUsageDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/RequirementUsageDictionaryWriter.cs deleted file mode 100644 index 21c47b172..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/RequirementUsageDictionaryWriter.cs +++ /dev/null @@ -1,219 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class RequirementUsageDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var requirementUsageInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(requirementUsageInstance); - case DictionaryKind.Simplified: - return WriteSimplified(requirementUsageInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IRequirementUsage requirementUsageInstance) - { - var dictionary = new Dictionary - { - { "@type", "RequirementUsage" }, - { "@id", requirementUsageInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", requirementUsageInstance.AliasIds); - dictionary.Add("declaredName", requirementUsageInstance.DeclaredName); - dictionary.Add("declaredShortName", requirementUsageInstance.DeclaredShortName); - dictionary.Add("direction", requirementUsageInstance.Direction); - dictionary.Add("elementId", requirementUsageInstance.ElementId); - dictionary.Add("isAbstract", requirementUsageInstance.IsAbstract); - dictionary.Add("isComposite", requirementUsageInstance.IsComposite); - dictionary.Add("isConstant", requirementUsageInstance.IsConstant); - dictionary.Add("isDerived", requirementUsageInstance.IsDerived); - dictionary.Add("isEnd", requirementUsageInstance.IsEnd); - dictionary.Add("isImpliedIncluded", requirementUsageInstance.IsImpliedIncluded); - dictionary.Add("isIndividual", requirementUsageInstance.IsIndividual); - dictionary.Add("isOrdered", requirementUsageInstance.IsOrdered); - dictionary.Add("isPortion", requirementUsageInstance.IsPortion); - dictionary.Add("isSufficient", requirementUsageInstance.IsSufficient); - dictionary.Add("isUnique", requirementUsageInstance.IsUnique); - dictionary.Add("isVariable", requirementUsageInstance.IsVariable); - dictionary.Add("isVariation", requirementUsageInstance.IsVariation); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", requirementUsageInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", requirementUsageInstance.OwningRelationship.ToString()); - dictionary.Add("portionKind", requirementUsageInstance.PortionKind); - dictionary.Add("reqId", requirementUsageInstance.ReqId); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IRequirementUsage requirementUsageInstance) - { - var dictionary = new Dictionary - { - { "@type", "RequirementUsage" }, - { "@id", requirementUsageInstance.Id } - }; - - dictionary.Add("aliasIds", requirementUsageInstance.AliasIds); - dictionary.Add("declaredName", requirementUsageInstance.DeclaredName); - dictionary.Add("declaredShortName", requirementUsageInstance.DeclaredShortName); - dictionary.Add("direction", requirementUsageInstance.Direction); - dictionary.Add("elementId", requirementUsageInstance.ElementId); - dictionary.Add("isAbstract", requirementUsageInstance.IsAbstract); - dictionary.Add("isComposite", requirementUsageInstance.IsComposite); - dictionary.Add("isConstant", requirementUsageInstance.IsConstant); - dictionary.Add("isDerived", requirementUsageInstance.IsDerived); - dictionary.Add("isEnd", requirementUsageInstance.IsEnd); - dictionary.Add("isImpliedIncluded", requirementUsageInstance.IsImpliedIncluded); - dictionary.Add("isIndividual", requirementUsageInstance.IsIndividual); - dictionary.Add("isOrdered", requirementUsageInstance.IsOrdered); - dictionary.Add("isPortion", requirementUsageInstance.IsPortion); - dictionary.Add("isSufficient", requirementUsageInstance.IsSufficient); - dictionary.Add("isUnique", requirementUsageInstance.IsUnique); - dictionary.Add("isVariable", requirementUsageInstance.IsVariable); - dictionary.Add("isVariation", requirementUsageInstance.IsVariation); - dictionary.Add("ownedRelationship", requirementUsageInstance.OwnedRelationship); - dictionary.Add("owningRelationship", requirementUsageInstance.OwningRelationship); - dictionary.Add("portionKind", requirementUsageInstance.PortionKind); - dictionary.Add("reqId", requirementUsageInstance.ReqId); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IRequirementUsage ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IRequirementUsage requirementUsageInstance)) - { - throw new ArgumentException("The dataItem must be of Type IRequirementUsage", "dataItem"); - } - - return requirementUsageInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SelectExpressionDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SelectExpressionDictionaryWriter.cs deleted file mode 100644 index f70b4198a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SelectExpressionDictionaryWriter.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class SelectExpressionDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var selectExpressionInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(selectExpressionInstance); - case DictionaryKind.Simplified: - return WriteSimplified(selectExpressionInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(ISelectExpression selectExpressionInstance) - { - var dictionary = new Dictionary - { - { "@type", "SelectExpression" }, - { "@id", selectExpressionInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", selectExpressionInstance.AliasIds); - dictionary.Add("declaredName", selectExpressionInstance.DeclaredName); - dictionary.Add("declaredShortName", selectExpressionInstance.DeclaredShortName); - dictionary.Add("direction", selectExpressionInstance.Direction); - dictionary.Add("elementId", selectExpressionInstance.ElementId); - dictionary.Add("isAbstract", selectExpressionInstance.IsAbstract); - dictionary.Add("isComposite", selectExpressionInstance.IsComposite); - dictionary.Add("isConstant", selectExpressionInstance.IsConstant); - dictionary.Add("isDerived", selectExpressionInstance.IsDerived); - dictionary.Add("isEnd", selectExpressionInstance.IsEnd); - dictionary.Add("isImpliedIncluded", selectExpressionInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", selectExpressionInstance.IsOrdered); - dictionary.Add("isPortion", selectExpressionInstance.IsPortion); - dictionary.Add("isSufficient", selectExpressionInstance.IsSufficient); - dictionary.Add("isUnique", selectExpressionInstance.IsUnique); - dictionary.Add("isVariable", selectExpressionInstance.IsVariable); - dictionary.Add("operator", selectExpressionInstance.Operator); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", selectExpressionInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", selectExpressionInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(ISelectExpression selectExpressionInstance) - { - var dictionary = new Dictionary - { - { "@type", "SelectExpression" }, - { "@id", selectExpressionInstance.Id } - }; - - dictionary.Add("aliasIds", selectExpressionInstance.AliasIds); - dictionary.Add("declaredName", selectExpressionInstance.DeclaredName); - dictionary.Add("declaredShortName", selectExpressionInstance.DeclaredShortName); - dictionary.Add("direction", selectExpressionInstance.Direction); - dictionary.Add("elementId", selectExpressionInstance.ElementId); - dictionary.Add("isAbstract", selectExpressionInstance.IsAbstract); - dictionary.Add("isComposite", selectExpressionInstance.IsComposite); - dictionary.Add("isConstant", selectExpressionInstance.IsConstant); - dictionary.Add("isDerived", selectExpressionInstance.IsDerived); - dictionary.Add("isEnd", selectExpressionInstance.IsEnd); - dictionary.Add("isImpliedIncluded", selectExpressionInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", selectExpressionInstance.IsOrdered); - dictionary.Add("isPortion", selectExpressionInstance.IsPortion); - dictionary.Add("isSufficient", selectExpressionInstance.IsSufficient); - dictionary.Add("isUnique", selectExpressionInstance.IsUnique); - dictionary.Add("isVariable", selectExpressionInstance.IsVariable); - dictionary.Add("operator", selectExpressionInstance.Operator); - dictionary.Add("ownedRelationship", selectExpressionInstance.OwnedRelationship); - dictionary.Add("owningRelationship", selectExpressionInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ISelectExpression ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is ISelectExpression selectExpressionInstance)) - { - throw new ArgumentException("The dataItem must be of Type ISelectExpression", "dataItem"); - } - - return selectExpressionInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SubclassificationDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SubclassificationDictionaryWriter.cs deleted file mode 100644 index 6d98986bc..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/SubclassificationDictionaryWriter.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class SubclassificationDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var subclassificationInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(subclassificationInstance); - case DictionaryKind.Simplified: - return WriteSimplified(subclassificationInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(ISubclassification subclassificationInstance) - { - var dictionary = new Dictionary - { - { "@type", "Subclassification" }, - { "@id", subclassificationInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", subclassificationInstance.AliasIds); - dictionary.Add("declaredName", subclassificationInstance.DeclaredName); - dictionary.Add("declaredShortName", subclassificationInstance.DeclaredShortName); - dictionary.Add("elementId", subclassificationInstance.ElementId); - dictionary.Add("general", subclassificationInstance.General.ToString()); - dictionary.Add("isImplied", subclassificationInstance.IsImplied); - dictionary.Add("isImpliedIncluded", subclassificationInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", $"[ {string.Join(",", subclassificationInstance.OwnedRelatedElement)} ]"); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", subclassificationInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelatedElement", subclassificationInstance.OwningRelatedElement.ToString()); - dictionary.Add("owningRelationship", subclassificationInstance.OwningRelationship.ToString()); - dictionary.Add("source", $"[ {string.Join(",", subclassificationInstance.Source)} ]"); - dictionary.Add("specific", subclassificationInstance.Specific.ToString()); - dictionary.Add("subclassifier", subclassificationInstance.Subclassifier.ToString()); - dictionary.Add("superclassifier", subclassificationInstance.Superclassifier.ToString()); - dictionary.Add("target", $"[ {string.Join(",", subclassificationInstance.Target)} ]"); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(ISubclassification subclassificationInstance) - { - var dictionary = new Dictionary - { - { "@type", "Subclassification" }, - { "@id", subclassificationInstance.Id } - }; - - dictionary.Add("aliasIds", subclassificationInstance.AliasIds); - dictionary.Add("declaredName", subclassificationInstance.DeclaredName); - dictionary.Add("declaredShortName", subclassificationInstance.DeclaredShortName); - dictionary.Add("elementId", subclassificationInstance.ElementId); - dictionary.Add("general", subclassificationInstance.General); - dictionary.Add("isImplied", subclassificationInstance.IsImplied); - dictionary.Add("isImpliedIncluded", subclassificationInstance.IsImpliedIncluded); - dictionary.Add("ownedRelatedElement", subclassificationInstance.OwnedRelatedElement); - dictionary.Add("ownedRelationship", subclassificationInstance.OwnedRelationship); - dictionary.Add("owningRelatedElement", subclassificationInstance.OwningRelatedElement); - dictionary.Add("owningRelationship", subclassificationInstance.OwningRelationship); - dictionary.Add("source", subclassificationInstance.Source); - dictionary.Add("specific", subclassificationInstance.Specific); - dictionary.Add("subclassifier", subclassificationInstance.Subclassifier); - dictionary.Add("superclassifier", subclassificationInstance.Superclassifier); - dictionary.Add("target", subclassificationInstance.Target); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ISubclassification ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is ISubclassification subclassificationInstance)) - { - throw new ArgumentException("The dataItem must be of Type ISubclassification", "dataItem"); - } - - return subclassificationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/TextualRepresentationDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/TextualRepresentationDictionaryWriter.cs deleted file mode 100644 index 5fc279c01..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/TextualRepresentationDictionaryWriter.cs +++ /dev/null @@ -1,193 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class TextualRepresentationDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var textualRepresentationInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(textualRepresentationInstance); - case DictionaryKind.Simplified: - return WriteSimplified(textualRepresentationInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(ITextualRepresentation textualRepresentationInstance) - { - var dictionary = new Dictionary - { - { "@type", "TextualRepresentation" }, - { "@id", textualRepresentationInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", textualRepresentationInstance.AliasIds); - dictionary.Add("body", textualRepresentationInstance.Body); - dictionary.Add("declaredName", textualRepresentationInstance.DeclaredName); - dictionary.Add("declaredShortName", textualRepresentationInstance.DeclaredShortName); - dictionary.Add("elementId", textualRepresentationInstance.ElementId); - dictionary.Add("isImpliedIncluded", textualRepresentationInstance.IsImpliedIncluded); - dictionary.Add("language", textualRepresentationInstance.Language); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", textualRepresentationInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", textualRepresentationInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(ITextualRepresentation textualRepresentationInstance) - { - var dictionary = new Dictionary - { - { "@type", "TextualRepresentation" }, - { "@id", textualRepresentationInstance.Id } - }; - - dictionary.Add("aliasIds", textualRepresentationInstance.AliasIds); - dictionary.Add("body", textualRepresentationInstance.Body); - dictionary.Add("declaredName", textualRepresentationInstance.DeclaredName); - dictionary.Add("declaredShortName", textualRepresentationInstance.DeclaredShortName); - dictionary.Add("elementId", textualRepresentationInstance.ElementId); - dictionary.Add("isImpliedIncluded", textualRepresentationInstance.IsImpliedIncluded); - dictionary.Add("language", textualRepresentationInstance.Language); - dictionary.Add("ownedRelationship", textualRepresentationInstance.OwnedRelationship); - dictionary.Add("owningRelationship", textualRepresentationInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static ITextualRepresentation ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is ITextualRepresentation textualRepresentationInstance)) - { - throw new ArgumentException("The dataItem must be of Type ITextualRepresentation", "dataItem"); - } - - return textualRepresentationInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/UsageDictionaryWriter.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/UsageDictionaryWriter.cs deleted file mode 100644 index 01e5bb06c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDictionaryWriter/UsageDictionaryWriter.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Dictionary.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - - /// - /// The purpose of the is to write (convert) a - /// to a . - /// - public static class UsageDictionaryWriter - { - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// The target that is to be created - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// When the is then the values are written to the - /// as is. When the is - /// then the following applies: - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - public static Dictionary Write(IData dataItem, DictionaryKind dictionaryKind) - { - var usageInstance = ThingNullAndTypeCheck(dataItem); - - switch (dictionaryKind) - { - case DictionaryKind.Complex: - return WriteComplex(usageInstance); - case DictionaryKind.Simplified: - return WriteSimplified(usageInstance); - default: - throw new NotSupportedException($"The dictionaryKind:{dictionaryKind} is not supported"); - } - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// The values that are of the following types are stored as is: - /// - Number, an abstract type, which has the subtypes Integer and Float - /// - String - /// - Boolean - /// - The spatial type Point - /// - Temporal types: Date, Time, LocalTime, DateTime, LocalDateTime and Duration - /// values of other types are converted to string, in case these are an then - /// the values are converted to an Array of String using JSON notation, i.e. [ value_1, ..., value_n ] - /// - private static Dictionary WriteSimplified(IUsage usageInstance) - { - var dictionary = new Dictionary - { - { "@type", "Usage" }, - { "@id", usageInstance.Id.ToString() } - }; - - dictionary.Add("aliasIds", usageInstance.AliasIds); - dictionary.Add("declaredName", usageInstance.DeclaredName); - dictionary.Add("declaredShortName", usageInstance.DeclaredShortName); - dictionary.Add("direction", usageInstance.Direction); - dictionary.Add("elementId", usageInstance.ElementId); - dictionary.Add("isAbstract", usageInstance.IsAbstract); - dictionary.Add("isComposite", usageInstance.IsComposite); - dictionary.Add("isConstant", usageInstance.IsConstant); - dictionary.Add("isDerived", usageInstance.IsDerived); - dictionary.Add("isEnd", usageInstance.IsEnd); - dictionary.Add("isImpliedIncluded", usageInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", usageInstance.IsOrdered); - dictionary.Add("isPortion", usageInstance.IsPortion); - dictionary.Add("isSufficient", usageInstance.IsSufficient); - dictionary.Add("isUnique", usageInstance.IsUnique); - dictionary.Add("isVariable", usageInstance.IsVariable); - dictionary.Add("isVariation", usageInstance.IsVariation); - dictionary.Add("ownedRelationship", $"[ {string.Join(",", usageInstance.OwnedRelationship)} ]"); - dictionary.Add("owningRelationship", usageInstance.OwningRelationship.ToString()); - - return dictionary; - } - - /// - /// Writes a to a that contains a key-value-pair - /// for each property. The type key is used to store type information (name of the Type). - /// - /// - /// The subject that is to be written to a . - /// - /// - /// An instance of that contains all the properties as key-value-pairs as well - /// as a type key that is used to store type information (name of the Type). - /// - /// - /// All values are stored as is, no conversion is done - /// - private static Dictionary WriteComplex(IUsage usageInstance) - { - var dictionary = new Dictionary - { - { "@type", "Usage" }, - { "@id", usageInstance.Id } - }; - - dictionary.Add("aliasIds", usageInstance.AliasIds); - dictionary.Add("declaredName", usageInstance.DeclaredName); - dictionary.Add("declaredShortName", usageInstance.DeclaredShortName); - dictionary.Add("direction", usageInstance.Direction); - dictionary.Add("elementId", usageInstance.ElementId); - dictionary.Add("isAbstract", usageInstance.IsAbstract); - dictionary.Add("isComposite", usageInstance.IsComposite); - dictionary.Add("isConstant", usageInstance.IsConstant); - dictionary.Add("isDerived", usageInstance.IsDerived); - dictionary.Add("isEnd", usageInstance.IsEnd); - dictionary.Add("isImpliedIncluded", usageInstance.IsImpliedIncluded); - dictionary.Add("isOrdered", usageInstance.IsOrdered); - dictionary.Add("isPortion", usageInstance.IsPortion); - dictionary.Add("isSufficient", usageInstance.IsSufficient); - dictionary.Add("isUnique", usageInstance.IsUnique); - dictionary.Add("isVariable", usageInstance.IsVariable); - dictionary.Add("isVariation", usageInstance.IsVariation); - dictionary.Add("ownedRelationship", usageInstance.OwnedRelationship); - dictionary.Add("owningRelationship", usageInstance.OwningRelationship); - - return dictionary; - } - - /// - /// Checks whether the is not null and whether it is - /// of type - /// - /// - /// The subject - /// - /// - /// an instance of - /// - /// - /// Thrown when is null - /// - /// - /// Thrown when is not of type - /// - private static IUsage ThingNullAndTypeCheck(IData dataItem) - { - if (dataItem == null) - { - throw new ArgumentNullException("dataItem", "The dataItem may not be null"); - } - - if (!(dataItem is IUsage usageInstance)) - { - throw new ArgumentException("The dataItem must be of Type IUsage", "dataItem"); - } - - return usageInstance; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/AnnotatingElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/AnnotatingElement.cs deleted file mode 100644 index 985a9ac0f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/AnnotatingElement.cs +++ /dev/null @@ -1,116 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An AnnotatingElement is an Element that provides additional description of or metadata on some other - /// Element. An AnnotatingElement is either attached to its annotatedElements by Annotation - /// Relationships, or it implicitly annotates its owningNamespace.annotatedElement = if - /// annotation->notEmpty() then annotation.annotatedElement else Sequence{owningNamespace} - /// endifownedAnnotatingRelationship = ownedRelationship-> selectByKind(Annotation)-> select(a | - /// a.annotatedElement <> self)annotation = if owningAnnotatingRelationship = null then - /// ownedAnnotatingRelationship else - /// owningAnnotatingRelationship->prepend(owningAnnotatingRelationship) endif - /// - public partial class AnnotatingElement : IAnnotatingElement - { - /// - /// Initializes a new instance of the class. - /// - public AnnotatingElement() - { - this.AliasIds = new List(); - this.IsImpliedIncluded = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Association.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Association.cs deleted file mode 100644 index 98678dc3c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Association.cs +++ /dev/null @@ -1,173 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Association is a Relationship and a Classifier to enable classification of links between things - /// (in the universe). The co-domains (types) of the associationEnd Features are the relatedTypes, as - /// co-domain and participants (linked things) of an Association identify each other.relatedType = - /// associationEnd.typespecializesFromLibrary('Links::Link')oclIsKindOf(Structure) = - /// oclIsKindOf(AssociationStructure)associationEnd->size() = 2 implies - /// specializesFromLibrary('Links::BinaryLink')not isAbstract implies relatedType->size() >= - /// 2associationEnds->size() > 2 implies not specializesFromLibrary('Links::BinaryLink')sourceType = - /// if relatedType->isEmpty() then null else relatedType->first() endiftargetType = if - /// relatedType->size() < 2 then OrderedSet{} else relatedType-> subSequence(2, - /// relatedType->size())-> asOrderedSet() endifownedEndFeature->forAll(type->size() = 1) - /// - public partial class Association : IAssociation - { - /// - /// Initializes a new instance of the class. - /// - public Association() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.IsSufficient = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Dependency.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Dependency.cs deleted file mode 100644 index 1b37fcd7d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Dependency.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Dependency is a Relationship that indicates that one or more client Elements require one more - /// supplier Elements for their complete specification. In general, this means that a change to one of - /// the supplier Elements may necessitate a change to, or re-specification of, the client Elements.Note - /// that a Dependency is entirely a model-level Relationship, without instance-level semantics. - /// - public partial class Dependency : IDependency - { - /// - /// Initializes a new instance of the class. - /// - public Dependency() - { - this.AliasIds = new List(); - this.Client = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Supplier = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The Element or Elements dependent on the supplier Elements. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Client { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The Element or Elements on which the client Elements depend in some respect. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Supplier { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/EnumerationDefinition.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/EnumerationDefinition.cs deleted file mode 100644 index 0583c002c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/EnumerationDefinition.cs +++ /dev/null @@ -1,138 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An EnumerationDefinition is an AttributeDefinition all of whose instances are given by an explicit - /// list of enumeratedValues. This is realized by requiring that the EnumerationDefinition have - /// isVariation = true, with the enumeratedValues being its variants. isVariation - /// - public partial class EnumerationDefinition : IEnumerationDefinition - { - /// - /// Initializes a new instance of the class. - /// - public EnumerationDefinition() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsImpliedIncluded = false; - this.IsSufficient = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether this Definition is for a variation point or not. If true, then all the memberships of the - /// Definition must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Feature.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Feature.cs deleted file mode 100644 index 41f5789df..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Feature.cs +++ /dev/null @@ -1,311 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Feature is a Type that classifies relations between multiple things (in the universe). The domain - /// of the relation is the intersection of the featuringTypes of the Feature. (The domain of a Feature - /// with no featuringTyps is implicitly the most general Type Base::Anything from the Kernel Semantic - /// Library.) The co-domain of the relation is the intersection of the types of the Feature.In the - /// simplest cases, the featuringTypes and types are Classifiers and the Feature relates two things, one - /// from the domain and one from the range. Examples include cars paired with wheels, people paired with - /// other people, and cars paired with numbers representing the car length.Since Features are Types, - /// their featuringTypes and types can be Features. In this case, the Feature effectively classifies - /// relations between relations, which can be interpreted as the sequence of things related by the - /// domain Feature concatenated with the sequence of things related by the co-domain Feature.The values - /// of a Feature for a given instance of its domain are all the instances of its co-domain that are - /// related to that domain instance by the Feature. The values of a Feature with chainingFeatures are - /// the same as values of the last Feature in the chain, which can be found by starting with values of - /// the first Feature, then using those values as domain instances to obtain valus of the second - /// Feature, and so on, to values of the last Feature.ownedRedefinition = - /// ownedSubsetting->selectByKind(Redefinition)ownedTypeFeaturing = - /// ownedRelationship->selectByKind(TypeFeaturing)-> select(tf | tf.featureOfType = - /// self)ownedSubsetting = ownedSpecialization->selectByKind(Subsetting)ownedTyping = - /// ownedGeneralization->selectByKind(FeatureTyping)type = let types : OrderedSet(Types) = - /// OrderedSet{self}-> -- Note: The closure operation automatically handles circular - /// relationships. closure(typingFeatures()).typing.type->asOrderedSet() in types->reject(t1 | - /// types->exist(t2 | t2 <> t1 and t2.specializes(t1)))multiplicity <> null implies - /// multiplicity.featuringType = featuringType - /// specializesFromLibrary('Base::things')chainingFeature->excludes(self)ownedFeatureChaining = - /// ownedRelationship->selectByKind(FeatureChaining)chainingFeature = - /// ownedFeatureChaining.chainingFeaturechainingFeature->size() <> 1isEnd and owningType <> null implies - /// let i : Integer = owningType.ownedEndFeature->indexOf(self) in - /// owningType.ownedSpecialization.general-> forAll(supertype | - /// supertype.endFeature->size() >= i implies - /// redefines(supertype.endFeature->at(i))direction = null andownedSpecializations->forAll(isImplied) - /// implies ownedMembership-> selectByKind(FeatureValue)-> forAll(fv | - /// specializes(fv.value.result))isEnd and owningType <> null and(owningType.oclIsKindOf(Association) or - /// owningType.oclIsKindOf(Connector)) implies - /// specializesFromLibrary('Links::Link::participant')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Structure)) andowningType <> null - /// and(owningType.oclIsKindOf(Structure) or owningType.type->includes(oclIsKindOf(Structure))) implies - /// - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(Class)) - /// implies specializesFromLibrary('Occurrences::occurrences')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(DataType)) - /// implies specializesFromLibrary('Base::dataValues')owningType <> null - /// andowningType.oclIsKindOf(FlowEnd) andowningType.ownedFeature->at(1) = self implies let flowType - /// : Type = owningType.owningType in flowType <> null implies let i : Integer = - /// flowType.ownedFeature.indexOf(owningType) in (i = 1 implies - /// redefinesFromLibrary('Transfers::Transfer::source::sourceOutput')) and (i = 2 implies - /// redefinesFromLibrary('Transfers::Transfer::source::targetInput')) owningType <> - /// null andnot owningFeatureMembership. oclIsKindOf(ReturnParameterMembership) - /// and(owningType.oclIsKindOf(Behavior) or owningType.oclIsKindOf(Step) and - /// (owningType.oclIsKindOf(InvocationExpression) implies not ownedRedefinition->exists(not - /// isImplied)) implies let i : Integer = owningType.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership))-> - /// indexOf(self) in owningType.ownedSpecialization.general-> forAll(supertype | - /// let ownedParameters : Sequence(Feature) = - /// supertype.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership)) in - /// ownedParameters->size() >= i implies - /// redefines(ownedParameters->at(i))ownedTyping.type->exists(selectByKind(Structure)) implies - /// specializesFromLibary('Objects::objects')owningType <> null and(owningType.oclIsKindOf(Function) and - /// self = owningType.oclAsType(Function).result or owningType.oclIsKindOf(Expression) and self = - /// owningType.oclAsType(Expression).result) implies owningType.ownedSpecialization.general-> - /// select(oclIsKindOf(Function) or oclIsKindOf(Expression))-> forAll(supertype | - /// redefines( if superType.oclIsKindOf(Function) then - /// superType.oclAsType(Function).result else - /// superType.oclAsType(Expression).result endif)ownedFeatureInverting = - /// ownedRelationship->selectByKind(FeatureInverting)-> select(fi | fi.featureInverted = - /// self)featuringType = let featuringTypes : OrderedSet(Type) = - /// featuring.type->asOrderedSet() in if chainingFeature->isEmpty() then featuringTypes else - /// featuringTypes-> union(chainingFeature->first().featuringType)-> - /// asOrderedSet() endifownedReferenceSubsetting = let referenceSubsettings : - /// OrderedSet(ReferenceSubsetting) = ownedSubsetting->selectByKind(ReferenceSubsetting) in if - /// referenceSubsettings->isEmpty() then null else referenceSubsettings->first() - /// endifownedSubsetting->selectByKind(ReferenceSubsetting)->size() <= - /// 1Sequence{2..chainingFeature->size()}->forAll(i | - /// chainingFeature->at(i).isFeaturedWithin(chainingFeature->at(i-1)))isPortion - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::portions')featureTarget = if - /// chainingFeature->isEmpty() then self else chainingFeature->last() endifownedCrossSubsetting = let - /// crossSubsettings: Sequence(CrossSubsetting) = ownedSubsetting->selectByKind(CrossSubsetting) - /// in if crossSubsettings->isEmpty() then null else crossSubsettings->first() endifisEnd - /// implies multiplicities().allSuperTypes()->flatten()-> - /// selectByKind(MultiplicityRange)->exists(hasBounds(1,1))crossFeature <> null implies - /// crossFeature.type->asSet() = type->asSet()ownedSubsetting->selectByKind(CrossSubsetting)->size() <= - /// 1crossFeature = if ownedCrossSubsetting = null then null else let chainingFeatures: - /// Sequence(Feature) = ownedCrossSubsetting.crossedFeature.chainingFeature in if - /// chainingFeatures->size() < 2 then null else chainingFeatures->at(2) - /// endifisOwnedCrossFeature() implies owner.oclAsType(Feature).type->forAll(t | - /// self.specializes(t))isOwnedCrossFeature() implies ownedSubsetting.subsettedFeature->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature - /// <> null).crossFeature)crossFeature <> null implies - /// ownedRedefinition.redefinedFeature.crossFeature-> forAll(f | f <> null implies - /// crossFeature.specializes(f))ownedCrossFeature() <> null implies crossFeature = - /// ownedCrossFeature()isOwnedCrossFeature() implies let otherEnds : OrderedSet(Feature) = - /// owner.oclAsType(Feature).owningType.endFeature->excluding(self) in if (otherEnds->size() = 1) - /// then featuringType = otherEnds->first().type else featuringType->size() = 1 and - /// featuringType->first().isCartesianProduct() and - /// featuringType->first().asCartesianProduct() = otherEnds.type and - /// featuringType->first().allSupertypes()->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature() <> - /// null).crossFeature().featuringType) endifisPortion implies not isVariableisEnd implied - /// direction = nullowningFeatureMembership <> null implies featuringTypes->exists(t | - /// isFeaturingType(t))isConstant implies isVariableisVariable implies owningType <> null and - /// owningType.specializes('Occurrences::Occurrence')isEnd implies not (isDerived or isAbstract or - /// isComposite or isPortion)isEnd and isVariable implies isConstant - /// - public partial class Feature : IFeature - { - /// - /// Initializes a new instance of the class. - /// - public Feature() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FeatureTyping.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FeatureTyping.cs deleted file mode 100644 index adbe49eb6..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FeatureTyping.cs +++ /dev/null @@ -1,171 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// FeatureTyping is Specialization in which the specific Type is a Feature. This means the set of - /// instances of the (specific) typedFeature is a subset of the set of instances of the (general) type. - /// In the simplest case, the type is a Classifier, whereupon the typedFeature has values that are - /// instances of the Classifier. - /// - public partial class FeatureTyping : IFeatureTyping - { - /// - /// Initializes a new instance of the class. - /// - public FeatureTyping() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Specific { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// The Type that is being applied by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Type { get; set; } - - /// - /// The Feature that has a type determined by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid TypedFeature { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Flow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Flow.cs deleted file mode 100644 index ea6c4aad6..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Flow.cs +++ /dev/null @@ -1,250 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Flow is a Step that represents the transfer of values from one Feature to another. Flows can take - /// non-zero time to complete.specializesFromLibrary('Transfers::transfers')payloadType = if - /// payloadFeature = null then Sequence{} else payloadFeature.type endifsourceOutputFeature = - /// if connectorEnd->isEmpty() or connectorEnd.ownedFeature->isEmpty() then null else - /// connectorEnd.ownedFeature->first() endiftargetInputFeature = if connectorEnd->size() < 2 or - /// connectorEnd->at(2).ownedFeature->isEmpty() then null else - /// connectorEnd->at(2).ownedFeature->first() endifflowEnd = - /// connectorEnd->selectByKind(FlowEnd)payloadFeature = let payloadFeatures : - /// Sequence(PayloadFeature) = ownedFeature->selectByKind(PayloadFeature) in if - /// payloadFeatures->isEmpty() then null else payloadFeatures->first() - /// endifownedFeature->selectByKind(PayloadFeature)->size() <= 1ownedEndFeatures->notEmpty() implies - /// specializesFromLibrary('Transfers::flowTransfers') - /// - public partial class Flow : IFlow - { - /// - /// Initializes a new instance of the class. - /// - public Flow() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FramedConcernMembership.cs deleted file mode 100644 index 0f177074e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/FramedConcernMembership.cs +++ /dev/null @@ -1,177 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A FramedConcernMembership is a RequirementConstraintMembership for a framed ConcernUsage of a - /// RequirementDefinition or RequirementUsage.kind = RequirementConstraintKind::requirement - /// - public partial class FramedConcernMembership : IFramedConcernMembership - { - /// - /// Initializes a new instance of the class. - /// - public FramedConcernMembership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether the RequirementConstraintMembership is for an assumed or required ConstraintUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public RequirementConstraintKind Kind { get; set; } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid MemberElement { get; set; } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAnnotatingElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAnnotatingElement.cs deleted file mode 100644 index 250b73cc3..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAnnotatingElement.cs +++ /dev/null @@ -1,50 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An AnnotatingElement is an Element that provides additional description of or metadata on some other - /// Element. An AnnotatingElement is either attached to its annotatedElements by Annotation - /// Relationships, or it implicitly annotates its owningNamespace.annotatedElement = if - /// annotation->notEmpty() then annotation.annotatedElement else Sequence{owningNamespace} - /// endifownedAnnotatingRelationship = ownedRelationship-> selectByKind(Annotation)-> select(a | - /// a.annotatedElement <> self)annotation = if owningAnnotatingRelationship = null then - /// ownedAnnotatingRelationship else - /// owningAnnotatingRelationship->prepend(owningAnnotatingRelationship) endif - /// - public partial interface IAnnotatingElement : IElement - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAssociation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAssociation.cs deleted file mode 100644 index 373612e24..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IAssociation.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Association is a Relationship and a Classifier to enable classification of links between things - /// (in the universe). The co-domains (types) of the associationEnd Features are the relatedTypes, as - /// co-domain and participants (linked things) of an Association identify each other.relatedType = - /// associationEnd.typespecializesFromLibrary('Links::Link')oclIsKindOf(Structure) = - /// oclIsKindOf(AssociationStructure)associationEnd->size() = 2 implies - /// specializesFromLibrary('Links::BinaryLink')not isAbstract implies relatedType->size() >= - /// 2associationEnds->size() > 2 implies not specializesFromLibrary('Links::BinaryLink')sourceType = - /// if relatedType->isEmpty() then null else relatedType->first() endiftargetType = if - /// relatedType->size() < 2 then OrderedSet{} else relatedType-> subSequence(2, - /// relatedType->size())-> asOrderedSet() endifownedEndFeature->forAll(type->size() = 1) - /// - public partial interface IAssociation : IClassifier, IRelationship - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IDependency.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IDependency.cs deleted file mode 100644 index 03c3cd26d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IDependency.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Dependency is a Relationship that indicates that one or more client Elements require one more - /// supplier Elements for their complete specification. In general, this means that a change to one of - /// the supplier Elements may necessitate a change to, or re-specification of, the client Elements.Note - /// that a Dependency is entirely a model-level Relationship, without instance-level semantics. - /// - public partial interface IDependency : IRelationship - { - /// - /// The Element or Elements dependent on the supplier Elements. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Client { get; set; } - - /// - /// The Element or Elements on which the client Elements depend in some respect. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Supplier { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IElement.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IElement.cs deleted file mode 100644 index c3d6df445..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IElement.cs +++ /dev/null @@ -1,107 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Element is a constituent of a model that is uniquely identified relative to all other Elements. - /// It can have Relationships with other Elements. Some of these Relationships might imply ownership of - /// other Elements, which means that if an Element is deleted from a model, then so are all the Elements - /// that it owns.ownedElement = ownedRelationship.ownedRelatedElementowner = - /// owningRelationship.owningRelatedElementqualifiedName = if owningNamespace = null then null - /// else if name <> null and owningNamespace.ownedMember-> select(m | m.name = - /// name).indexOf(self) <> 1 then null else if owningNamespace.owner = null then escapedName() - /// else if owningNamespace.qualifiedName = null or escapedName() = null then null else - /// owningNamespace.qualifiedName + '::' + escapedName() endif endif endif endifdocumentation = - /// ownedElement->selectByKind(Documentation)ownedAnnotation = ownedRelationship-> - /// selectByKind(Annotation)-> select(a | a.annotatedElement = self)name = - /// effectiveName()ownedRelationship->exists(isImplied) implies isImpliedIncludedisLibraryElement = - /// libraryNamespace() <> nullshortName = effectiveShortName()owningNamespace = if owningMembership = - /// null then null else owningMembership.membershipOwningNamespace endiftextualRepresentation = - /// ownedElement->selectByKind(TextualRepresentation) - /// - public partial interface IElement - { - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsImpliedIncluded { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IEnumerationDefinition.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IEnumerationDefinition.cs deleted file mode 100644 index b8c0f8c18..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IEnumerationDefinition.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An EnumerationDefinition is an AttributeDefinition all of whose instances are given by an explicit - /// list of enumeratedValues. This is realized by requiring that the EnumerationDefinition have - /// isVariation = true, with the enumeratedValues being its variants. isVariation - /// - public partial interface IEnumerationDefinition : IAttributeDefinition - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeature.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeature.cs deleted file mode 100644 index edb0e7d54..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeature.cs +++ /dev/null @@ -1,217 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Feature is a Type that classifies relations between multiple things (in the universe). The domain - /// of the relation is the intersection of the featuringTypes of the Feature. (The domain of a Feature - /// with no featuringTyps is implicitly the most general Type Base::Anything from the Kernel Semantic - /// Library.) The co-domain of the relation is the intersection of the types of the Feature.In the - /// simplest cases, the featuringTypes and types are Classifiers and the Feature relates two things, one - /// from the domain and one from the range. Examples include cars paired with wheels, people paired with - /// other people, and cars paired with numbers representing the car length.Since Features are Types, - /// their featuringTypes and types can be Features. In this case, the Feature effectively classifies - /// relations between relations, which can be interpreted as the sequence of things related by the - /// domain Feature concatenated with the sequence of things related by the co-domain Feature.The values - /// of a Feature for a given instance of its domain are all the instances of its co-domain that are - /// related to that domain instance by the Feature. The values of a Feature with chainingFeatures are - /// the same as values of the last Feature in the chain, which can be found by starting with values of - /// the first Feature, then using those values as domain instances to obtain valus of the second - /// Feature, and so on, to values of the last Feature.ownedRedefinition = - /// ownedSubsetting->selectByKind(Redefinition)ownedTypeFeaturing = - /// ownedRelationship->selectByKind(TypeFeaturing)-> select(tf | tf.featureOfType = - /// self)ownedSubsetting = ownedSpecialization->selectByKind(Subsetting)ownedTyping = - /// ownedGeneralization->selectByKind(FeatureTyping)type = let types : OrderedSet(Types) = - /// OrderedSet{self}-> -- Note: The closure operation automatically handles circular - /// relationships. closure(typingFeatures()).typing.type->asOrderedSet() in types->reject(t1 | - /// types->exist(t2 | t2 <> t1 and t2.specializes(t1)))multiplicity <> null implies - /// multiplicity.featuringType = featuringType - /// specializesFromLibrary('Base::things')chainingFeature->excludes(self)ownedFeatureChaining = - /// ownedRelationship->selectByKind(FeatureChaining)chainingFeature = - /// ownedFeatureChaining.chainingFeaturechainingFeature->size() <> 1isEnd and owningType <> null implies - /// let i : Integer = owningType.ownedEndFeature->indexOf(self) in - /// owningType.ownedSpecialization.general-> forAll(supertype | - /// supertype.endFeature->size() >= i implies - /// redefines(supertype.endFeature->at(i))direction = null andownedSpecializations->forAll(isImplied) - /// implies ownedMembership-> selectByKind(FeatureValue)-> forAll(fv | - /// specializes(fv.value.result))isEnd and owningType <> null and(owningType.oclIsKindOf(Association) or - /// owningType.oclIsKindOf(Connector)) implies - /// specializesFromLibrary('Links::Link::participant')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Structure)) andowningType <> null - /// and(owningType.oclIsKindOf(Structure) or owningType.type->includes(oclIsKindOf(Structure))) implies - /// - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(Class)) - /// implies specializesFromLibrary('Occurrences::occurrences')isComposite - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::suboccurrences')ownedTyping.type->exists(selectByKind(DataType)) - /// implies specializesFromLibrary('Base::dataValues')owningType <> null - /// andowningType.oclIsKindOf(FlowEnd) andowningType.ownedFeature->at(1) = self implies let flowType - /// : Type = owningType.owningType in flowType <> null implies let i : Integer = - /// flowType.ownedFeature.indexOf(owningType) in (i = 1 implies - /// redefinesFromLibrary('Transfers::Transfer::source::sourceOutput')) and (i = 2 implies - /// redefinesFromLibrary('Transfers::Transfer::source::targetInput')) owningType <> - /// null andnot owningFeatureMembership. oclIsKindOf(ReturnParameterMembership) - /// and(owningType.oclIsKindOf(Behavior) or owningType.oclIsKindOf(Step) and - /// (owningType.oclIsKindOf(InvocationExpression) implies not ownedRedefinition->exists(not - /// isImplied)) implies let i : Integer = owningType.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership))-> - /// indexOf(self) in owningType.ownedSpecialization.general-> forAll(supertype | - /// let ownedParameters : Sequence(Feature) = - /// supertype.ownedFeature->select(direction <> null)-> - /// reject(owningFeatureMembership. oclIsKindOf(ReturnParameterMembership)) in - /// ownedParameters->size() >= i implies - /// redefines(ownedParameters->at(i))ownedTyping.type->exists(selectByKind(Structure)) implies - /// specializesFromLibary('Objects::objects')owningType <> null and(owningType.oclIsKindOf(Function) and - /// self = owningType.oclAsType(Function).result or owningType.oclIsKindOf(Expression) and self = - /// owningType.oclAsType(Expression).result) implies owningType.ownedSpecialization.general-> - /// select(oclIsKindOf(Function) or oclIsKindOf(Expression))-> forAll(supertype | - /// redefines( if superType.oclIsKindOf(Function) then - /// superType.oclAsType(Function).result else - /// superType.oclAsType(Expression).result endif)ownedFeatureInverting = - /// ownedRelationship->selectByKind(FeatureInverting)-> select(fi | fi.featureInverted = - /// self)featuringType = let featuringTypes : OrderedSet(Type) = - /// featuring.type->asOrderedSet() in if chainingFeature->isEmpty() then featuringTypes else - /// featuringTypes-> union(chainingFeature->first().featuringType)-> - /// asOrderedSet() endifownedReferenceSubsetting = let referenceSubsettings : - /// OrderedSet(ReferenceSubsetting) = ownedSubsetting->selectByKind(ReferenceSubsetting) in if - /// referenceSubsettings->isEmpty() then null else referenceSubsettings->first() - /// endifownedSubsetting->selectByKind(ReferenceSubsetting)->size() <= - /// 1Sequence{2..chainingFeature->size()}->forAll(i | - /// chainingFeature->at(i).isFeaturedWithin(chainingFeature->at(i-1)))isPortion - /// andownedTyping.type->includes(oclIsKindOf(Class)) andowningType <> null - /// and(owningType.oclIsKindOf(Class) or owningType.oclIsKindOf(Feature) and - /// owningType.oclAsType(Feature).type-> exists(oclIsKindOf(Class))) implies - /// specializesFromLibrary('Occurrence::Occurrence::portions')featureTarget = if - /// chainingFeature->isEmpty() then self else chainingFeature->last() endifownedCrossSubsetting = let - /// crossSubsettings: Sequence(CrossSubsetting) = ownedSubsetting->selectByKind(CrossSubsetting) - /// in if crossSubsettings->isEmpty() then null else crossSubsettings->first() endifisEnd - /// implies multiplicities().allSuperTypes()->flatten()-> - /// selectByKind(MultiplicityRange)->exists(hasBounds(1,1))crossFeature <> null implies - /// crossFeature.type->asSet() = type->asSet()ownedSubsetting->selectByKind(CrossSubsetting)->size() <= - /// 1crossFeature = if ownedCrossSubsetting = null then null else let chainingFeatures: - /// Sequence(Feature) = ownedCrossSubsetting.crossedFeature.chainingFeature in if - /// chainingFeatures->size() < 2 then null else chainingFeatures->at(2) - /// endifisOwnedCrossFeature() implies owner.oclAsType(Feature).type->forAll(t | - /// self.specializes(t))isOwnedCrossFeature() implies ownedSubsetting.subsettedFeature->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature - /// <> null).crossFeature)crossFeature <> null implies - /// ownedRedefinition.redefinedFeature.crossFeature-> forAll(f | f <> null implies - /// crossFeature.specializes(f))ownedCrossFeature() <> null implies crossFeature = - /// ownedCrossFeature()isOwnedCrossFeature() implies let otherEnds : OrderedSet(Feature) = - /// owner.oclAsType(Feature).owningType.endFeature->excluding(self) in if (otherEnds->size() = 1) - /// then featuringType = otherEnds->first().type else featuringType->size() = 1 and - /// featuringType->first().isCartesianProduct() and - /// featuringType->first().asCartesianProduct() = otherEnds.type and - /// featuringType->first().allSupertypes()->includesAll( - /// owner.oclAsType(Feature).ownedRedefinition.redefinedFeature-> select(crossFeature() <> - /// null).crossFeature().featuringType) endifisPortion implies not isVariableisEnd implied - /// direction = nullowningFeatureMembership <> null implies featuringTypes->exists(t | - /// isFeaturingType(t))isConstant implies isVariableisVariable implies owningType <> null and - /// owningType.specializes('Occurrences::Occurrence')isEnd implies not (isDerived or isAbstract or - /// isComposite or isPortion)isEnd and isVariable implies isConstant - /// - public partial interface IFeature : IType - { - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - FeatureDirectionKind? Direction { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsEnd { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsPortion { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsVariable { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeatureTyping.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeatureTyping.cs deleted file mode 100644 index dc17b4305..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFeatureTyping.cs +++ /dev/null @@ -1,58 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// FeatureTyping is Specialization in which the specific Type is a Feature. This means the set of - /// instances of the (specific) typedFeature is a subset of the set of instances of the (general) type. - /// In the simplest case, the type is a Classifier, whereupon the typedFeature has values that are - /// instances of the Classifier. - /// - public partial interface IFeatureTyping : ISpecialization - { - /// - /// The Type that is being applied by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid Type { get; set; } - - /// - /// The Feature that has a type determined by this FeatureTyping. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid TypedFeature { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFlow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFlow.cs deleted file mode 100644 index 1fb91449a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFlow.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An Flow is a Step that represents the transfer of values from one Feature to another. Flows can take - /// non-zero time to complete.specializesFromLibrary('Transfers::transfers')payloadType = if - /// payloadFeature = null then Sequence{} else payloadFeature.type endifsourceOutputFeature = - /// if connectorEnd->isEmpty() or connectorEnd.ownedFeature->isEmpty() then null else - /// connectorEnd.ownedFeature->first() endiftargetInputFeature = if connectorEnd->size() < 2 or - /// connectorEnd->at(2).ownedFeature->isEmpty() then null else - /// connectorEnd->at(2).ownedFeature->first() endifflowEnd = - /// connectorEnd->selectByKind(FlowEnd)payloadFeature = let payloadFeatures : - /// Sequence(PayloadFeature) = ownedFeature->selectByKind(PayloadFeature) in if - /// payloadFeatures->isEmpty() then null else payloadFeatures->first() - /// endifownedFeature->selectByKind(PayloadFeature)->size() <= 1ownedEndFeatures->notEmpty() implies - /// specializesFromLibrary('Transfers::flowTransfers') - /// - public partial interface IFlow : IConnector, IStep - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFramedConcernMembership.cs deleted file mode 100644 index 9d7e0a6d4..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IFramedConcernMembership.cs +++ /dev/null @@ -1,44 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A FramedConcernMembership is a RequirementConstraintMembership for a framed ConcernUsage of a - /// RequirementDefinition or RequirementUsage.kind = RequirementConstraintKind::requirement - /// - public partial interface IFramedConcernMembership : IRequirementConstraintMembership - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralInteger.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralInteger.cs deleted file mode 100644 index 27bcbe4ac..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralInteger.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralInteger is a LiteralExpression that provides an Integer value as a result. Its result - /// parameter must have the type - /// Integer.specializesFromLibrary('Performances::literalIntegerEvaluations') - /// - public partial interface ILiteralInteger : ILiteralExpression - { - /// - /// The Integer value that is the result of evaluating this LiteralInteger.The Integer value that is the - /// result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - int Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralRational.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralRational.cs deleted file mode 100644 index 5d3f43059..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ILiteralRational.cs +++ /dev/null @@ -1,52 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralRational is a LiteralExpression that provides a Rational value as a result. Its result - /// parameter must have the type - /// Rational.specializesFromLibrary('Performances::literalRationalEvaluations') - /// - public partial interface ILiteralRational : ILiteralExpression - { - /// - /// The value whose rational approximation is the result of evaluating this LiteralRational.The Real - /// value that is the result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - double Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMembership.cs deleted file mode 100644 index feb64e8de..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMembership.cs +++ /dev/null @@ -1,75 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Membership is a Relationship between a Namespace and an Element that indicates the Element is a - /// member of (i.e., is contained in) the Namespace. Any memberNames specify how the memberElement is - /// identified in the Namespace and the visibility specifies whether or not the memberElement is - /// publicly visible from outside the Namespace.If a Membership is an OwningMembership, then it owns its - /// memberElement, which becomes an ownedMember of the membershipOwningNamespace. Otherwise, the - /// memberNames of a Membership are effectively aliases within the membershipOwningNamespace for an - /// Element with a separate OwningMembership in the same or a different Namespace. memberElementId - /// = memberElement.elementId - /// - public partial interface IMembership : IRelationship - { - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid MemberElement { get; set; } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string MemberName { get; set; } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string MemberShortName { get; set; } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMultiplicityRange.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMultiplicityRange.cs deleted file mode 100644 index bfa5e6975..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IMultiplicityRange.cs +++ /dev/null @@ -1,60 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A MultiplicityRange is a Multiplicity whose value is defined to be the (inclusive) range of natural - /// numbers given by the result of a lowerBound Expression and the result of an upperBound Expression. - /// The result of these Expressions shall be of type Natural. If the result of the upperBound Expression - /// is the unbounded value *, then the specified range includes all natural numbers greater than or - /// equal to the lowerBound value. If no lowerBound Expression, then the default is that the lower bound - /// has the same value as the upper bound, except if the upperBound evaluates to *, in which case the - /// default for the lower bound is 0.bound->forAll(b | b.featuringType = - /// self.featuringType)bound->forAll(b | b.result.specializesFromLibrary('ScalarValues::Integer') and - /// let value : UnlimitedNatural = valueOf(b) in value <> null implies value >= 0)lowerBound = - /// let ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->size() < 2 then null else ownedExpressions->first() endifupperBound = let - /// ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->isEmpty() then null else if ownedExpressions->size() = 1 then - /// ownedExpressions->at(1) else ownedExpressions->at(2) endif endif bound = if upperBound = - /// null then Sequence{} else if lowerBound = null then Sequence{upperBound} else - /// Sequence{lowerBound, upperBound} endif endifif lowerBound = null then ownedMember->notEmpty() - /// and ownedMember->at(1) = upperBoundelse ownedMember->size() > 1 and ownedMember->at(1) = - /// lowerBound and ownedMember->at(2) = upperBoundendif - /// - public partial interface IMultiplicityRange : IMultiplicity - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IOwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IOwningMembership.cs deleted file mode 100644 index 1f7025cce..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IOwningMembership.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The - /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace.ownedMemberName = - /// ownedMemberElement.nameownedMemberShortName = ownedMemberElement.shortName - /// - public partial interface IOwningMembership : IMembership - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IReferenceSubsetting.cs deleted file mode 100644 index c61fee7a9..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IReferenceSubsetting.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// ReferenceSubsetting is a kind of Subsetting in which the referencedFeature is syntactically - /// distinguished from other Features subsetted by the referencingFeature. ReferenceSubsetting has the - /// same semantics as Subsetting, but the referencedFeature may have a special purpose relative to the - /// referencingFeature. For instance, ReferenceSubsetting is used to identify the relatedFeatures of a - /// Connector.ReferenceSubsetting is always an ownedRelationship of its referencingFeature. A Feature - /// can have at most one ownedReferenceSubsetting. - /// - public partial interface IReferenceSubsetting : ISubsetting - { - /// - /// The Feature that is referenced by the referencingFeature of this ReferenceSubsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid ReferencedFeature { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRelationship.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRelationship.cs deleted file mode 100644 index 205dbda76..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRelationship.cs +++ /dev/null @@ -1,85 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Relationship is an Element that relates other Element. Some of its relatedElements may be owned, - /// in which case those ownedRelatedElements will be deleted from a model if their owningRelationship - /// is. A Relationship may also be owned by another Element, in which case the ownedRelatedElements of - /// the Relationship are also considered to be transitively owned by the owningRelatedElement of the - /// Relationship.The relatedElements of a Relationship are divided into source and target Elements. The - /// Relationship is considered to be directed from the source to the target Elements. An undirected - /// Relationship may have either all source or all target Elements.A "relationship Element" in - /// the abstract syntax is generically any Element that is an instance of either Relationship or a - /// direct or indirect specialization of Relationship. Any other kind of Element is a - /// "non-relationship Element". It is a convention of that non-relationship Elements are only - /// related via reified relationship Elements. Any meta-associations directly between non-relationship - /// Elements must be derived from underlying reified Relationship.relatedElement = source->union(target) - /// - public partial interface IRelationship : IElement - { - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsImplied { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - List OwnedRelatedElement { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid? OwningRelatedElement { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRequirementUsage.cs deleted file mode 100644 index 3c5c7067d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IRequirementUsage.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A RequirementUsage is a Usage of a RequirementDefinition.actorParameter = featureMembership-> - /// selectByKind(ActorMembership). ownedActorParameterassumedConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::assumption). ownedConstraintframedConcern = featureMembership-> - /// selectByKind(FramedConcernMembership). ownedConcernrequiredConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::requirement). ownedConstraintstakeholderParameter = - /// featureMembership-> selectByKind(AStakholderMembership). - /// ownedStakeholderParametersubjectParameter = let subjects : OrderedSet(SubjectMembership) = - /// featureMembership->selectByKind(SubjectMembership) in if subjects->isEmpty() then null else - /// subjects->first().ownedSubjectParameter endiftext = documentation.bodyfeatureMembership-> - /// selectByKind(SubjectMembership)-> size() <= 1input->notEmpty() and input->first() = - /// subjectParameterspecializesFromLibrary('Requirements::requirementChecks')isComposite and owningType - /// <> null and (owningType.oclIsKindOf(RequirementDefinition) or - /// owningType.oclIsKindOf(RequirementUsage)) implies - /// specializesFromLibrary('Requirements::RequirementCheck::subrequirements')owningfeatureMembership <> - /// null andowningfeatureMembership.oclIsKindOf(ObjectiveMembership) implies - /// owningType.ownedSpecialization.general->forAll(gen | (gen.oclIsKindOf(CaseDefinition) implies - /// redefines(gen.oclAsType(CaseDefinition).objectiveRequirement)) and - /// (gen.oclIsKindOf(CaseUsage) implies - /// redefines(gen.oclAsType(CaseUsage).objectiveRequirement))owningFeatureMembership <> null - /// andowningFeatureMembership.oclIsKindOf(RequirementVerificationMembership) implies - /// specializesFromLibrary('VerificationCases::VerificationCase::obj::requirementVerifications') - /// - public partial interface IRequirementUsage : IConstraintUsage - { - /// - /// An optional modeler-specified identifier for this RequirementUsage (used, e.g., to link it to an - /// original requirement text in some source document), which is the declaredShortName for the - /// RequirementUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string ReqId { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISelectExpression.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISelectExpression.cs deleted file mode 100644 index 6604c9fe1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISelectExpression.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A SelectExpression is an OperatorExpression whose operator is "select", which resolves to the - /// Function ControlFunctions::select from the Kernel Functions Library.operator = - /// 'select'arguments->notEmpty() implies result.specializes(arguments->first().result) - /// - public partial interface ISelectExpression : IOperatorExpression - { - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISubclassification.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISubclassification.cs deleted file mode 100644 index 0cbbf7bfe..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ISubclassification.cs +++ /dev/null @@ -1,56 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// Subclassification is Specialization in which both the specific and general Types are Classifier. - /// This means all instances of the specific Classifier are also instances of the general Classifier. - /// - public partial interface ISubclassification : ISpecialization - { - /// - /// The more specific Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid Subclassifier { get; set; } - - /// - /// The more general Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - Guid Superclassifier { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ITextualRepresentation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ITextualRepresentation.cs deleted file mode 100644 index b7c9108e0..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ITextualRepresentation.cs +++ /dev/null @@ -1,78 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A TextualRepresentation is an AnnotatingElement whose body represents the representedElement in a - /// given language. The representedElement must be the owner of the TextualRepresentation. The named - /// language can be a natural language, in which case the body is an informal representation, or an - /// artificial language, in which case the body is expected to be a formal, machine-parsable - /// representation.If the named language of a TextualRepresentation is machine-parsable, then the body - /// text should be legal input text as defined for that language. The interpretation of the named - /// language string shall be case insensitive. The following language names are defined to correspond to - /// the given standard languages:
kerml Kernel Modeling Language
ocl Object Constraint - /// Language
alf Action Language for fUML
Other specifications may - /// define specific language strings, other than those shown above, to be used to indicate the use of - /// languages from those specifications in KerML TextualRepresentation.If the language of a - /// TextualRepresentation is "kerml", then the body text shall be a legal representation of - /// the representedElement in the KerML textual concrete syntax. A conforming tool can use such a - /// TextualRepresentation Annotation to record the original KerML concrete syntax text from which an - /// Element was parsed. In this case, it is a tool responsibility to ensure that the body of the - /// TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element - /// changes other than by re-parsing the body text.An Element with a TextualRepresentation in a language - /// other than KerML is essentially a semantically "opaque" Element specified in the other - /// language. However, a conforming KerML tool may interpret such an element consistently with the - /// specification of the named language. - ///
- public partial interface ITextualRepresentation : IAnnotatingElement - { - /// - /// The textual representation of the representedElement in the given language. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string Body { get; set; } - - /// - /// The natural or artifical language in which the body text is written. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - string Language { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IUsage.cs deleted file mode 100644 index 54cffce50..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/IUsage.cs +++ /dev/null @@ -1,96 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Usage is a usage of a Definition.A Usage may have nestedUsages that model features that apply in - /// the context of the owningUsage. A Usage may also have Definitions nested in it, but this has no - /// semantic significance, other than the nested scoping resulting from the Usage being considered as a - /// Namespace for any nested Definitions.However, if a Usage has isVariation = true, then it represents - /// a variation point Usage. In this case, all of its members must be variant Usages, related to the - /// Usage by VariantMembership Relationships. Rather than being features of the Usage, variant Usages - /// model different concrete alternatives that can be chosen to fill in for the variation point - /// Usage.variant = variantMembership.ownedVariantUsagevariantMembership = - /// ownedMembership->selectByKind(VariantMembership)isVariation implies - /// ownedFeatureMembership->isEmpty()isReference = not isCompositeowningVariationUsage <> null implies - /// specializes(owningVariationUsage)isVariation implies not ownedSpecialization.specific->exists( - /// oclIsKindOf(Definition) and oclAsType(Definition).isVariation or - /// oclIsKindOf(Usage) and oclAsType(Usage).isVariation)owningVariationDefinition <> null implies - /// specializes(owningVariationDefinition)directedUsage = - /// directedFeature->selectByKind(Usage)nestedAction = - /// nestedUsage->selectByKind(ActionUsage)nestedAllocation = - /// nestedUsage->selectByKind(AllocationUsage)nestedAnalysisCase = - /// nestedUsage->selectByKind(AnalysisCaseUsage)nestedAttribute = - /// nestedUsage->selectByKind(AttributeUsage)nestedCalculation = - /// nestedUsage->selectByKind(CalculationUsage)nestedCase = - /// nestedUsage->selectByKind(CaseUsage)nestedConcern = - /// nestedUsage->selectByKind(ConcernUsage)nestedConnection = - /// nestedUsage->selectByKind(ConnectorAsUsage)nestedConstraint = - /// nestedUsage->selectByKind(ConstraintUsage)ownedNested = - /// nestedUsage->selectByKind(EnumerationUsage)nestedFlow = - /// nestedUsage->selectByKind(FlowConnectionUsage)nestedInterface = - /// nestedUsage->selectByKind(ReferenceUsage)nestedItem = - /// nestedUsage->selectByKind(ItemUsage)nestedMetadata = - /// nestedUsage->selectByKind(MetadataUsage)nestedOccurrence = - /// nestedUsage->selectByKind(OccurrenceUsage)nestedPart = - /// nestedUsage->selectByKind(PartUsage)nestedPort = nestedUsage->selectByKind(PortUsage)nestedReference - /// = nestedUsage->selectByKind(ReferenceUsage)nestedRendering = - /// nestedUsage->selectByKind(RenderingUsage)nestedRequirement = - /// nestedUsage->selectByKind(RequirementUsage)nestedState = - /// nestedUsage->selectByKind(StateUsage)nestedTransition = - /// nestedUsage->selectByKind(TransitionUsage)nestedUsage = - /// ownedFeature->selectByKind(Usage)nestedUseCase = - /// nestedUsage->selectByKind(UseCaseUsage)nestedVerificationCase = - /// nestedUsage->selectByKind(VerificationCaseUsage)nestedView = - /// nestedUsage->selectByKind(ViewUsage)nestedViewpoint = nestedUsage->selectByKind(ViewpointUsage)usage - /// = feature->selectByKind(Usage)direction <> null or isEnd or featuringType->isEmpty() implies - /// isReferenceisVariation implies isAbstractmayTimeVary = owningType <> null and - /// owningType.specializesFromLibrary('Occurrences::Occurrence') and not ( isPortion or - /// specializesFromLibrary('Links::SelfLink') or - /// specializesFromLibrary('Occurrences::HappensLink') or isComposite and - /// specializesFromLibrary('Actions::Action') )owningVariationUsage <> null implies - /// featuringType->asSet() = owningVariationUsage.featuringType->asSet() - /// - public partial interface IUsage : IFeature - { - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - bool IsVariation { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralInteger.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralInteger.cs deleted file mode 100644 index ce555dd29..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralInteger.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralInteger is a LiteralExpression that provides an Integer value as a result. Its result - /// parameter must have the type - /// Integer.specializesFromLibrary('Performances::literalIntegerEvaluations') - /// - public partial class LiteralInteger : ILiteralInteger - { - /// - /// Initializes a new instance of the class. - /// - public LiteralInteger() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The Integer value that is the result of evaluating this LiteralInteger.The Integer value that is the - /// result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public int Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralRational.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralRational.cs deleted file mode 100644 index 8c35a1eec..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/LiteralRational.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A LiteralRational is a LiteralExpression that provides a Rational value as a result. Its result - /// parameter must have the type - /// Rational.specializesFromLibrary('Performances::literalRationalEvaluations') - /// - public partial class LiteralRational : ILiteralRational - { - /// - /// Initializes a new instance of the class. - /// - public LiteralRational() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The value whose rational approximation is the result of evaluating this LiteralRational.The Real - /// value that is the result of evaluating this Expression. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public double Value { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Membership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Membership.cs deleted file mode 100644 index 267a28ccb..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Membership.cs +++ /dev/null @@ -1,177 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Membership is a Relationship between a Namespace and an Element that indicates the Element is a - /// member of (i.e., is contained in) the Namespace. Any memberNames specify how the memberElement is - /// identified in the Namespace and the visibility specifies whether or not the memberElement is - /// publicly visible from outside the Namespace.If a Membership is an OwningMembership, then it owns its - /// memberElement, which becomes an ownedMember of the membershipOwningNamespace. Otherwise, the - /// memberNames of a Membership are effectively aliases within the membershipOwningNamespace for an - /// Element with a separate OwningMembership in the same or a different Namespace. memberElementId - /// = memberElement.elementId - /// - public partial class Membership : IMembership - { - /// - /// Initializes a new instance of the class. - /// - public Membership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid MemberElement { get; set; } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/MultiplicityRange.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/MultiplicityRange.cs deleted file mode 100644 index 2519bfd00..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/MultiplicityRange.cs +++ /dev/null @@ -1,221 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A MultiplicityRange is a Multiplicity whose value is defined to be the (inclusive) range of natural - /// numbers given by the result of a lowerBound Expression and the result of an upperBound Expression. - /// The result of these Expressions shall be of type Natural. If the result of the upperBound Expression - /// is the unbounded value *, then the specified range includes all natural numbers greater than or - /// equal to the lowerBound value. If no lowerBound Expression, then the default is that the lower bound - /// has the same value as the upper bound, except if the upperBound evaluates to *, in which case the - /// default for the lower bound is 0.bound->forAll(b | b.featuringType = - /// self.featuringType)bound->forAll(b | b.result.specializesFromLibrary('ScalarValues::Integer') and - /// let value : UnlimitedNatural = valueOf(b) in value <> null implies value >= 0)lowerBound = - /// let ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->size() < 2 then null else ownedExpressions->first() endifupperBound = let - /// ownedExpressions : Sequence(Expression) = ownedMember->selectByKind(Expression) in if - /// ownedExpressions->isEmpty() then null else if ownedExpressions->size() = 1 then - /// ownedExpressions->at(1) else ownedExpressions->at(2) endif endif bound = if upperBound = - /// null then Sequence{} else if lowerBound = null then Sequence{upperBound} else - /// Sequence{lowerBound, upperBound} endif endifif lowerBound = null then ownedMember->notEmpty() - /// and ownedMember->at(1) = upperBoundelse ownedMember->size() > 1 and ownedMember->at(1) = - /// lowerBound and ownedMember->at(2) = upperBoundendif - /// - public partial class MultiplicityRange : IMultiplicityRange - { - /// - /// Initializes a new instance of the class. - /// - public MultiplicityRange() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/OwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/OwningMembership.cs deleted file mode 100644 index 1d5034f46..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/OwningMembership.cs +++ /dev/null @@ -1,172 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// An OwningMembership is a Membership that owns its memberElement as a ownedRelatedElement. The - /// ownedMemberElement becomes an ownedMember of the membershipOwningNamespace.ownedMemberName = - /// ownedMemberElement.nameownedMemberShortName = ownedMemberElement.shortName - /// - public partial class OwningMembership : IOwningMembership - { - /// - /// Initializes a new instance of the class. - /// - public OwningMembership() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - this.Visibility = VisibilityKind.Public; - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The Element that becomes a member of the membershipOwningNamespace due to this Membership. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid MemberElement { get; set; } - - /// - /// The name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberName { get; set; } - - /// - /// The short name of the memberElement relative to the membershipOwningNamespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string MemberShortName { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - /// - /// Whether or not the Membership of the memberElement in the membershipOwningNamespace is publicly - /// visible outside that Namespace. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public VisibilityKind Visibility { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ReferenceSubsetting.cs deleted file mode 100644 index d8c27851d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/ReferenceSubsetting.cs +++ /dev/null @@ -1,179 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// ReferenceSubsetting is a kind of Subsetting in which the referencedFeature is syntactically - /// distinguished from other Features subsetted by the referencingFeature. ReferenceSubsetting has the - /// same semantics as Subsetting, but the referencedFeature may have a special purpose relative to the - /// referencingFeature. For instance, ReferenceSubsetting is used to identify the relatedFeatures of a - /// Connector.ReferenceSubsetting is always an ownedRelationship of its referencingFeature. A Feature - /// can have at most one ownedReferenceSubsetting. - /// - public partial class ReferenceSubsetting : IReferenceSubsetting - { - /// - /// Initializes a new instance of the class. - /// - public ReferenceSubsetting() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The Feature that is referenced by the referencingFeature of this ReferenceSubsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid ReferencedFeature { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Specific { get; set; } - - /// - /// The Feature that is subsetted by the subsettingFeature of this Subsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid SubsettedFeature { get; set; } - - /// - /// The Feature that is a subset of the subsettedFeature of this Subsetting. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid SubsettingFeature { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/RequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/RequirementUsage.cs deleted file mode 100644 index 2ce5732a5..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/RequirementUsage.cs +++ /dev/null @@ -1,257 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A RequirementUsage is a Usage of a RequirementDefinition.actorParameter = featureMembership-> - /// selectByKind(ActorMembership). ownedActorParameterassumedConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::assumption). ownedConstraintframedConcern = featureMembership-> - /// selectByKind(FramedConcernMembership). ownedConcernrequiredConstraint = ownedFeatureMembership-> - /// selectByKind(RequirementConstraintMembership)-> select(kind = - /// RequirementConstraintKind::requirement). ownedConstraintstakeholderParameter = - /// featureMembership-> selectByKind(AStakholderMembership). - /// ownedStakeholderParametersubjectParameter = let subjects : OrderedSet(SubjectMembership) = - /// featureMembership->selectByKind(SubjectMembership) in if subjects->isEmpty() then null else - /// subjects->first().ownedSubjectParameter endiftext = documentation.bodyfeatureMembership-> - /// selectByKind(SubjectMembership)-> size() <= 1input->notEmpty() and input->first() = - /// subjectParameterspecializesFromLibrary('Requirements::requirementChecks')isComposite and owningType - /// <> null and (owningType.oclIsKindOf(RequirementDefinition) or - /// owningType.oclIsKindOf(RequirementUsage)) implies - /// specializesFromLibrary('Requirements::RequirementCheck::subrequirements')owningfeatureMembership <> - /// null andowningfeatureMembership.oclIsKindOf(ObjectiveMembership) implies - /// owningType.ownedSpecialization.general->forAll(gen | (gen.oclIsKindOf(CaseDefinition) implies - /// redefines(gen.oclAsType(CaseDefinition).objectiveRequirement)) and - /// (gen.oclIsKindOf(CaseUsage) implies - /// redefines(gen.oclAsType(CaseUsage).objectiveRequirement))owningFeatureMembership <> null - /// andowningFeatureMembership.oclIsKindOf(RequirementVerificationMembership) implies - /// specializesFromLibrary('VerificationCases::VerificationCase::obj::requirementVerifications') - /// - public partial class RequirementUsage : IRequirementUsage - { - /// - /// Initializes a new instance of the class. - /// - public RequirementUsage() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsIndividual = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether this OccurrenceUsage represents the usage of the specific individual represented by its - /// individualDefinition. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsIndividual { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The kind of temporal portion (time slice or snapshot) is represented by this OccurrenceUsage. If - /// portionKind is not null, then the owningType of the OccurrenceUsage must be non-null, and the - /// OccurrenceUsage represents portions of the featuring instance of the owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public PortionKind? PortionKind { get; set; } - - /// - /// An optional modeler-specified identifier for this RequirementUsage (used, e.g., to link it to an - /// original requirement text in some source document), which is the declaredShortName for the - /// RequirementUsage. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ReqId { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/SelectExpression.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/SelectExpression.cs deleted file mode 100644 index aee99bbfc..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/SelectExpression.cs +++ /dev/null @@ -1,213 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A SelectExpression is an OperatorExpression whose operator is "select", which resolves to the - /// Function ControlFunctions::select from the Kernel Functions Library.operator = - /// 'select'arguments->notEmpty() implies result.specializes(arguments->first().result) - /// - public partial class SelectExpression : ISelectExpression - { - /// - /// Initializes a new instance of the class. - /// - public SelectExpression() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// An operator symbol that names a corresponding Function from one of the standard packages from the - /// Kernel Function Library . - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Operator { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Subclassification.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Subclassification.cs deleted file mode 100644 index 099c92365..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Subclassification.cs +++ /dev/null @@ -1,169 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// Subclassification is Specialization in which both the specific and general Types are Classifier. - /// This means all instances of the specific Classifier are also instances of the general Classifier. - /// - public partial class Subclassification : ISubclassification - { - /// - /// Initializes a new instance of the class. - /// - public Subclassification() - { - this.AliasIds = new List(); - this.IsImplied = false; - this.IsImpliedIncluded = false; - this.OwnedRelatedElement = new List(); - this.OwnedRelationship = new List(); - this.Source = new List(); - this.Target = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// A Type with a superset of all instances of the specific Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid General { get; set; } - - /// - /// Whether this Relationship was generated by tooling to meet semantic rules, rather than being - /// directly created by a modeler. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImplied { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The relatedElements of this Relationship that are owned by the Relationship. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelatedElement { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The relatedElement of this Relationship that owns the Relationship, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelatedElement { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - /// - /// The relatedElements from which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Source { get; set; } - - /// - /// A Type with a subset of all instances of the general Type, which might be the same set. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Specific { get; set; } - - /// - /// The more specific Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Subclassifier { get; set; } - - /// - /// The more general Classifier in this Subclassification. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Superclassifier { get; set; } - - /// - /// The relatedElements to which this Relationship is considered to be directed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List Target { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/TextualRepresentation.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/TextualRepresentation.cs deleted file mode 100644 index 01d6a0950..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/TextualRepresentation.cs +++ /dev/null @@ -1,144 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A TextualRepresentation is an AnnotatingElement whose body represents the representedElement in a - /// given language. The representedElement must be the owner of the TextualRepresentation. The named - /// language can be a natural language, in which case the body is an informal representation, or an - /// artificial language, in which case the body is expected to be a formal, machine-parsable - /// representation.If the named language of a TextualRepresentation is machine-parsable, then the body - /// text should be legal input text as defined for that language. The interpretation of the named - /// language string shall be case insensitive. The following language names are defined to correspond to - /// the given standard languages:
kerml Kernel Modeling Language
ocl Object Constraint - /// Language
alf Action Language for fUML
Other specifications may - /// define specific language strings, other than those shown above, to be used to indicate the use of - /// languages from those specifications in KerML TextualRepresentation.If the language of a - /// TextualRepresentation is "kerml", then the body text shall be a legal representation of - /// the representedElement in the KerML textual concrete syntax. A conforming tool can use such a - /// TextualRepresentation Annotation to record the original KerML concrete syntax text from which an - /// Element was parsed. In this case, it is a tool responsibility to ensure that the body of the - /// TextualRepresentation remains correct (or the Annotation is removed) if the annotated Element - /// changes other than by re-parsing the body text.An Element with a TextualRepresentation in a language - /// other than KerML is essentially a semantically "opaque" Element specified in the other - /// language. However, a conforming KerML tool may interpret such an element consistently with the - /// specification of the named language. - ///
- public partial class TextualRepresentation : ITextualRepresentation - { - /// - /// Initializes a new instance of the class. - /// - public TextualRepresentation() - { - this.AliasIds = new List(); - this.IsImpliedIncluded = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The textual representation of the representedElement in the given language. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Body { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// The natural or artifical language in which the body text is written. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string Language { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Usage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Usage.cs deleted file mode 100644 index 8fc3a009c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenDto/Usage.cs +++ /dev/null @@ -1,257 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core.DTO -{ - using System; - using System.Collections.Generic; - - using SysML2.NET.Core; - using SysML2.NET.Decorators; - - /// - /// A Usage is a usage of a Definition.A Usage may have nestedUsages that model features that apply in - /// the context of the owningUsage. A Usage may also have Definitions nested in it, but this has no - /// semantic significance, other than the nested scoping resulting from the Usage being considered as a - /// Namespace for any nested Definitions.However, if a Usage has isVariation = true, then it represents - /// a variation point Usage. In this case, all of its members must be variant Usages, related to the - /// Usage by VariantMembership Relationships. Rather than being features of the Usage, variant Usages - /// model different concrete alternatives that can be chosen to fill in for the variation point - /// Usage.variant = variantMembership.ownedVariantUsagevariantMembership = - /// ownedMembership->selectByKind(VariantMembership)isVariation implies - /// ownedFeatureMembership->isEmpty()isReference = not isCompositeowningVariationUsage <> null implies - /// specializes(owningVariationUsage)isVariation implies not ownedSpecialization.specific->exists( - /// oclIsKindOf(Definition) and oclAsType(Definition).isVariation or - /// oclIsKindOf(Usage) and oclAsType(Usage).isVariation)owningVariationDefinition <> null implies - /// specializes(owningVariationDefinition)directedUsage = - /// directedFeature->selectByKind(Usage)nestedAction = - /// nestedUsage->selectByKind(ActionUsage)nestedAllocation = - /// nestedUsage->selectByKind(AllocationUsage)nestedAnalysisCase = - /// nestedUsage->selectByKind(AnalysisCaseUsage)nestedAttribute = - /// nestedUsage->selectByKind(AttributeUsage)nestedCalculation = - /// nestedUsage->selectByKind(CalculationUsage)nestedCase = - /// nestedUsage->selectByKind(CaseUsage)nestedConcern = - /// nestedUsage->selectByKind(ConcernUsage)nestedConnection = - /// nestedUsage->selectByKind(ConnectorAsUsage)nestedConstraint = - /// nestedUsage->selectByKind(ConstraintUsage)ownedNested = - /// nestedUsage->selectByKind(EnumerationUsage)nestedFlow = - /// nestedUsage->selectByKind(FlowConnectionUsage)nestedInterface = - /// nestedUsage->selectByKind(ReferenceUsage)nestedItem = - /// nestedUsage->selectByKind(ItemUsage)nestedMetadata = - /// nestedUsage->selectByKind(MetadataUsage)nestedOccurrence = - /// nestedUsage->selectByKind(OccurrenceUsage)nestedPart = - /// nestedUsage->selectByKind(PartUsage)nestedPort = nestedUsage->selectByKind(PortUsage)nestedReference - /// = nestedUsage->selectByKind(ReferenceUsage)nestedRendering = - /// nestedUsage->selectByKind(RenderingUsage)nestedRequirement = - /// nestedUsage->selectByKind(RequirementUsage)nestedState = - /// nestedUsage->selectByKind(StateUsage)nestedTransition = - /// nestedUsage->selectByKind(TransitionUsage)nestedUsage = - /// ownedFeature->selectByKind(Usage)nestedUseCase = - /// nestedUsage->selectByKind(UseCaseUsage)nestedVerificationCase = - /// nestedUsage->selectByKind(VerificationCaseUsage)nestedView = - /// nestedUsage->selectByKind(ViewUsage)nestedViewpoint = nestedUsage->selectByKind(ViewpointUsage)usage - /// = feature->selectByKind(Usage)direction <> null or isEnd or featuringType->isEmpty() implies - /// isReferenceisVariation implies isAbstractmayTimeVary = owningType <> null and - /// owningType.specializesFromLibrary('Occurrences::Occurrence') and not ( isPortion or - /// specializesFromLibrary('Links::SelfLink') or - /// specializesFromLibrary('Occurrences::HappensLink') or isComposite and - /// specializesFromLibrary('Actions::Action') )owningVariationUsage <> null implies - /// featuringType->asSet() = owningVariationUsage.featuringType->asSet() - /// - public partial class Usage : IUsage - { - /// - /// Initializes a new instance of the class. - /// - public Usage() - { - this.AliasIds = new List(); - this.IsAbstract = false; - this.IsComposite = false; - this.IsConstant = false; - this.IsDerived = false; - this.IsEnd = false; - this.IsImpliedIncluded = false; - this.IsOrdered = false; - this.IsPortion = false; - this.IsSufficient = false; - this.IsUnique = true; - this.IsVariable = false; - this.OwnedRelationship = new List(); - } - - /// - /// Gets or sets the unique identifier - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid Id { get; set; } - - /// - /// Various alternative identifiers for this Element. Generally, these will be set by tools. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: false)] - public List AliasIds { get; set; } - - /// - /// The declared name of this Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredName { get; set; } - - /// - /// An optional alternative name for the Element that is intended to be shorter or in some way more - /// succinct than its primary name. It may act as a modeler-specified identifier for the Element, though - /// it is then the responsibility of the modeler to maintain the uniqueness of this identifier within a - /// model or relative to some other context. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string DeclaredShortName { get; set; } - - /// - /// Indicates how values of this Feature are determined or used (as specified for the - /// FeatureDirectionKind). - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public FeatureDirectionKind? Direction { get; set; } - - /// - /// The globally unique identifier for this Element. This is intended to be set by tooling, and it must - /// not change during the lifetime of the Element. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public string ElementId { get; set; } - - /// - /// Indicates whether instances of this Type must also be instances of at least one of its specialized - /// Types. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsAbstract { get; set; } - - /// - /// Whether the Feature is a composite feature of its featuringType. If so, the values of the Feature - /// cannot exist after its featuring instance no longer does and cannot be values of another composite - /// feature that is not on the same featuring instance. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsComposite { get; set; } - - /// - /// If isVariable is true, then whether the value of this Feature nevertheless does not change over all - /// snapshots of its owningType. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsConstant { get; set; } - - /// - /// Whether the values of this Feature can always be computed from the values of other Features. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsDerived { get; set; } - - /// - /// Whether or not this Feature is an end Feature. An end Feature always has multiplicity 1, mapping - /// each of its domain instances to a single co-domain instance. However, it may have a crossFeature, in - /// which case values of the crossFeature must be the same as those found by navigation across instances - /// of the owningType from values of other end Features to values of this Feature. If the owningType has - /// n end Features, then the multiplicity, ordering, and uniqueness declared for the crossFeature of any - /// one of these end Features constrains the cardinality, ordering, and uniqueness of the collection of - /// values of that Feature reached by navigation when the values of the other n-1 end Features are held - /// fixed. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsEnd { get; set; } - - /// - /// Whether all necessary implied Relationships have been included in the ownedRelationships of this - /// Element. This property may be true, even if there are not actually any ownedRelationships with - /// isImplied = true, meaning that no such Relationships are actually implied for this Element. However, - /// if it is false, then ownedRelationships may not contain any implied Relationships. That is, either - /// all required implied Relationships must be included, or none of them. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsImpliedIncluded { get; set; } - - /// - /// Whether an order exists for the values of this Feature or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsOrdered { get; set; } - - /// - /// Whether the values of this Feature are contained in the space and time of instances of the domain of - /// the Feature and represent the same thing as those instances. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsPortion { get; set; } - - /// - /// Whether all things that meet the classification conditions of this Type must be classified by the - /// Type.(A Type gives conditions that must be met by whatever it classifies, but when isSufficient - /// is false, things may meet those conditions but still not be classified by the Type. For example, a - /// Type Car that is not sufficient could require everything it classifies to have four wheels, but not - /// all four wheeled things would classify as cars. However, if the Type Car were sufficient, it would - /// classify all four-wheeled things.) - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsSufficient { get; set; } - - /// - /// Whether or not values for this Feature must have no duplicates or not. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsUnique { get; set; } - - /// - /// Whether the value of this Feature might vary over time. That is, whether the Feature may have a - /// different value for each snapshot of an owningType that is an Occurrence. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariable { get; set; } - - /// - /// Whether this Usage is for a variation point or not. If true, then all the memberships of the Usage - /// must be VariantMemberships. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 1, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public bool IsVariation { get; set; } - - /// - /// The Relationships for which this Element is the owningRelatedElement. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: true, isUnique: true, lowerBound: 0, upperBound: -1, isMany: false, isRequired: false, isContainment: true)] - public List OwnedRelationship { get; set; } - - /// - /// The Relationship for which this Element is an ownedRelatedElement, if any. - /// - [EFeature(isChangeable: true, isVolatile: false, isTransient: false, isUnsettable: false, isDerived: false, isOrdered: false, isUnique: true, lowerBound: 0, upperBound: 1, isMany: false, isRequired: false, isContainment: false)] - public Guid? OwningRelationship { get; set; } - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AnnotatingElementFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AnnotatingElementFactory.cs deleted file mode 100644 index 7757b4c2b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AnnotatingElementFactory.cs +++ /dev/null @@ -1,72 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class AnnotatingElementFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.AnnotatingElement Create(Core.DTO.AnnotatingElement dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.AnnotatingElement - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImpliedIncluded = dto.IsImpliedIncluded, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AssociationFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AssociationFactory.cs deleted file mode 100644 index dbd050989..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/AssociationFactory.cs +++ /dev/null @@ -1,75 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class AssociationFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Association Create(Core.DTO.Association dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Association - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsSufficient = dto.IsSufficient, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/DependencyFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/DependencyFactory.cs deleted file mode 100644 index 84eafe90f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/DependencyFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class DependencyFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Dependency Create(Core.DTO.Dependency dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Dependency - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/EnumerationDefinitionFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/EnumerationDefinitionFactory.cs deleted file mode 100644 index c342d69a4..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/EnumerationDefinitionFactory.cs +++ /dev/null @@ -1,75 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class EnumerationDefinitionFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.EnumerationDefinition Create(Core.DTO.EnumerationDefinition dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.EnumerationDefinition - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsSufficient = dto.IsSufficient, - IsVariation = dto.IsVariation, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureFactory.cs deleted file mode 100644 index 798588256..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureFactory.cs +++ /dev/null @@ -1,83 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class FeatureFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Feature Create(Core.DTO.Feature dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Feature - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureTypingFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureTypingFactory.cs deleted file mode 100644 index 3cb0cfe07..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FeatureTypingFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class FeatureTypingFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.FeatureTyping Create(Core.DTO.FeatureTyping dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.FeatureTyping - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FlowFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FlowFactory.cs deleted file mode 100644 index 25b4ca327..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FlowFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class FlowFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Flow Create(Core.DTO.Flow dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Flow - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FramedConcernMembershipFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FramedConcernMembershipFactory.cs deleted file mode 100644 index 8f429a28f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/FramedConcernMembershipFactory.cs +++ /dev/null @@ -1,77 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class FramedConcernMembershipFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.FramedConcernMembership Create(Core.DTO.FramedConcernMembership dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.FramedConcernMembership - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - Kind = dto.Kind, - MemberName = dto.MemberName, - MemberShortName = dto.MemberShortName, - Visibility = dto.Visibility, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralIntegerFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralIntegerFactory.cs deleted file mode 100644 index cd9990c36..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralIntegerFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class LiteralIntegerFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.LiteralInteger Create(Core.DTO.LiteralInteger dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.LiteralInteger - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - Value = dto.Value, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralRationalFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralRationalFactory.cs deleted file mode 100644 index 98ef34a1a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/LiteralRationalFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class LiteralRationalFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.LiteralRational Create(Core.DTO.LiteralRational dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.LiteralRational - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - Value = dto.Value, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MembershipFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MembershipFactory.cs deleted file mode 100644 index c51069c81..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MembershipFactory.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class MembershipFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Membership Create(Core.DTO.Membership dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Membership - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - MemberName = dto.MemberName, - MemberShortName = dto.MemberShortName, - Visibility = dto.Visibility, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MultiplicityRangeFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MultiplicityRangeFactory.cs deleted file mode 100644 index d6d26dd0b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/MultiplicityRangeFactory.cs +++ /dev/null @@ -1,83 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class MultiplicityRangeFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.MultiplicityRange Create(Core.DTO.MultiplicityRange dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.MultiplicityRange - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/OwningMembershipFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/OwningMembershipFactory.cs deleted file mode 100644 index 78391d252..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/OwningMembershipFactory.cs +++ /dev/null @@ -1,76 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class OwningMembershipFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.OwningMembership Create(Core.DTO.OwningMembership dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.OwningMembership - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - MemberName = dto.MemberName, - MemberShortName = dto.MemberShortName, - Visibility = dto.Visibility, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/ReferenceSubsettingFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/ReferenceSubsettingFactory.cs deleted file mode 100644 index 5cfc56ff2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/ReferenceSubsettingFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class ReferenceSubsettingFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.ReferenceSubsetting Create(Core.DTO.ReferenceSubsetting dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.ReferenceSubsetting - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/RequirementUsageFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/RequirementUsageFactory.cs deleted file mode 100644 index 9a88a02cb..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/RequirementUsageFactory.cs +++ /dev/null @@ -1,87 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class RequirementUsageFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.RequirementUsage Create(Core.DTO.RequirementUsage dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.RequirementUsage - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsIndividual = dto.IsIndividual, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - IsVariation = dto.IsVariation, - PortionKind = dto.PortionKind, - ReqId = dto.ReqId, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SelectExpressionFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SelectExpressionFactory.cs deleted file mode 100644 index 9a0992081..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SelectExpressionFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class SelectExpressionFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.SelectExpression Create(Core.DTO.SelectExpression dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.SelectExpression - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - Operator = dto.Operator, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SubclassificationFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SubclassificationFactory.cs deleted file mode 100644 index 084816da1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/SubclassificationFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class SubclassificationFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Subclassification Create(Core.DTO.Subclassification dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Subclassification - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImplied = dto.IsImplied, - IsImpliedIncluded = dto.IsImpliedIncluded, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/TextualRepresentationFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/TextualRepresentationFactory.cs deleted file mode 100644 index 4c15eef61..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/TextualRepresentationFactory.cs +++ /dev/null @@ -1,74 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class TextualRepresentationFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.TextualRepresentation Create(Core.DTO.TextualRepresentation dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.TextualRepresentation - { - Id = dto.Id, - AliasIds = dto.AliasIds, - Body = dto.Body, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - ElementId = dto.ElementId, - IsImpliedIncluded = dto.IsImpliedIncluded, - Language = dto.Language, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/UsageFactory.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/UsageFactory.cs deleted file mode 100644 index 6a6a44761..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenElementFactory/UsageFactory.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - - /// - /// The purpose of the is to create a new instance of a - /// based on a - /// - public class UsageFactory - { - /// - /// Creates an instance of the and sets the value properties - /// based on the DTO - /// - /// - /// The instance of the - /// - /// - /// an instance of - /// - /// - /// thrown when is null - /// - public Core.POCO.Usage Create(Core.DTO.Usage dto) - { - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var poco = new Core.POCO.Usage - { - Id = dto.Id, - AliasIds = dto.AliasIds, - DeclaredName = dto.DeclaredName, - DeclaredShortName = dto.DeclaredShortName, - Direction = dto.Direction, - ElementId = dto.ElementId, - IsAbstract = dto.IsAbstract, - IsComposite = dto.IsComposite, - IsConstant = dto.IsConstant, - IsDerived = dto.IsDerived, - IsEnd = dto.IsEnd, - IsImpliedIncluded = dto.IsImpliedIncluded, - IsOrdered = dto.IsOrdered, - IsPortion = dto.IsPortion, - IsSufficient = dto.IsSufficient, - IsUnique = dto.IsUnique, - IsVariable = dto.IsVariable, - IsVariation = dto.IsVariation, - }; - - return poco; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenEnum/VisibilityKind.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenEnum/VisibilityKind.cs deleted file mode 100644 index c57a15b23..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenEnum/VisibilityKind.cs +++ /dev/null @@ -1,59 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Core -{ - /// - /// VisibilityKind is an enumeration whose literals specify the visibility of a Membership of an Element - /// in a Namespace outside of that Namespace. Note that "visibility" specifically restricts - /// whether an Element in a Namespace may be referenced by name from outside the Namespace and only - /// otherwise restricts access to an Element as provided by specific constraints in the abstract syntax - /// (e.g., preventing the import or inheritance of private Elements). - /// - public enum VisibilityKind - { - /// - /// Indicates a Membership is not visible outside its owning Namespace. - /// - Private = 0, - - /// - /// An intermediate level of visibility between public and private. By default, it is equivalent to - /// private for the purposes of normal access to and import of Elements from a Namespace. However, other - /// Relationships may be specified to include Memberships with protected visibility in the list of - /// memberships for a Namespace (e.g., Specialization). - /// - Protected = 1, - - /// - /// Indicates that a Membership is publicly visible outside its owning Namespace. - /// - Public = 2, - - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs deleted file mode 100644 index 795cab565..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AnnotatingElementExtensions.cs +++ /dev/null @@ -1,174 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class AnnotatingElementExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.AnnotatingElement poco, Core.DTO.AnnotatingElement dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.AnnotatingElement poco, Core.DTO.AnnotatingElement dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.AnnotatingElement ToDto(this Core.POCO.AnnotatingElement poco) - { - var dto = new Core.DTO.AnnotatingElement(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AssociationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AssociationExtensions.cs deleted file mode 100644 index f7b51441b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/AssociationExtensions.cs +++ /dev/null @@ -1,242 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class AssociationExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Association poco, Core.DTO.Association dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsSufficient = dto.IsSufficient; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Association poco, Core.DTO.Association dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Association ToDto(this Core.POCO.Association poco) - { - var dto = new Core.DTO.Association(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsSufficient = poco.IsSufficient; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/DependencyExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/DependencyExtensions.cs deleted file mode 100644 index 0412d3df2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/DependencyExtensions.cs +++ /dev/null @@ -1,268 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class DependencyExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Dependency poco, Core.DTO.Dependency dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - var clientToDelete = poco.Client.Select(x => x.Id).Except(dto.Client); - foreach (var identifier in clientToDelete) - { - poco.Client.Remove(poco.Client.Single(x => x.Id == identifier)); - } - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var supplierToDelete = poco.Supplier.Select(x => x.Id).Except(dto.Supplier); - foreach (var identifier in supplierToDelete) - { - poco.Supplier.Remove(poco.Supplier.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Dependency poco, Core.DTO.Dependency dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var clientToAdd = dto.Client.Except(poco.Client.Select(x => x.Id)); - foreach (var identifier in clientToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Client.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var supplierToAdd = dto.Supplier.Except(poco.Supplier.Select(x => x.Id)); - foreach (var identifier in supplierToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Supplier.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Dependency ToDto(this Core.POCO.Dependency poco) - { - var dto = new Core.DTO.Dependency(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.Client = poco.Client.Select(x => x.Id).ToList(); - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Supplier = poco.Supplier.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs deleted file mode 100644 index f22c322a7..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/EnumerationDefinitionExtensions.cs +++ /dev/null @@ -1,183 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class EnumerationDefinitionExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.EnumerationDefinition poco, Core.DTO.EnumerationDefinition dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsVariation = dto.IsVariation; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.EnumerationDefinition poco, Core.DTO.EnumerationDefinition dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.EnumerationDefinition ToDto(this Core.POCO.EnumerationDefinition poco) - { - var dto = new Core.DTO.EnumerationDefinition(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsSufficient = poco.IsSufficient; - dto.IsVariation = poco.IsVariation; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureExtensions.cs deleted file mode 100644 index 52b95ed5c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureExtensions.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class FeatureExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Feature poco, Core.DTO.Feature dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Feature poco, Core.DTO.Feature dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Feature ToDto(this Core.POCO.Feature poco) - { - var dto = new Core.DTO.Feature(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs deleted file mode 100644 index a46b17e5e..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs +++ /dev/null @@ -1,276 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class FeatureTypingExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.FeatureTyping poco, Core.DTO.FeatureTyping dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.FeatureTyping poco, Core.DTO.FeatureTyping dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.General, out lazyPoco)) - { - poco.General = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.General = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - if (cache.TryGetValue(dto.Specific, out lazyPoco)) - { - poco.Specific = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.Specific = null; - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - if (cache.TryGetValue(dto.Type, out lazyPoco)) - { - poco.Type = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.Type = null; - } - - if (cache.TryGetValue(dto.TypedFeature, out lazyPoco)) - { - poco.TypedFeature = (Core.POCO.Feature)lazyPoco.Value; - } - else - { - poco.TypedFeature = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.FeatureTyping ToDto(this Core.POCO.FeatureTyping poco) - { - var dto = new Core.DTO.FeatureTyping(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.General = poco.General.Id; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Specific = poco.Specific.Id; - dto.Target = poco.Target.Select(x => x.Id).ToList(); - dto.Type = poco.Type.Id; - dto.TypedFeature = poco.TypedFeature.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FlowExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FlowExtensions.cs deleted file mode 100644 index 102a837c1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FlowExtensions.cs +++ /dev/null @@ -1,269 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class FlowExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Flow poco, Core.DTO.Flow dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Flow poco, Core.DTO.Flow dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Flow ToDto(this Core.POCO.Flow poco) - { - var dto = new Core.DTO.Flow(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs deleted file mode 100644 index 151bddba1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/FramedConcernMembershipExtensions.cs +++ /dev/null @@ -1,258 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class FramedConcernMembershipExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.FramedConcernMembership poco, Core.DTO.FramedConcernMembership dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.Kind = dto.Kind; - - poco.MemberName = dto.MemberName; - - poco.MemberShortName = dto.MemberShortName; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - poco.Visibility = dto.Visibility; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.FramedConcernMembership poco, Core.DTO.FramedConcernMembership dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.MemberElement, out lazyPoco)) - { - poco.MemberElement = (IElement)lazyPoco.Value; - } - else - { - poco.MemberElement = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.FramedConcernMembership ToDto(this Core.POCO.FramedConcernMembership poco) - { - var dto = new Core.DTO.FramedConcernMembership(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.Kind = poco.Kind; - dto.MemberElement = poco.MemberElement.Id; - dto.MemberName = poco.MemberName; - dto.MemberShortName = poco.MemberShortName; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - dto.Visibility = poco.Visibility; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs deleted file mode 100644 index 54df7d6e2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralIntegerExtensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class LiteralIntegerExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.LiteralInteger poco, Core.DTO.LiteralInteger dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - poco.Value = dto.Value; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.LiteralInteger poco, Core.DTO.LiteralInteger dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.LiteralInteger ToDto(this Core.POCO.LiteralInteger poco) - { - var dto = new Core.DTO.LiteralInteger(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Value = poco.Value; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs deleted file mode 100644 index c5acef292..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/LiteralRationalExtensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class LiteralRationalExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.LiteralRational poco, Core.DTO.LiteralRational dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - poco.Value = dto.Value; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.LiteralRational poco, Core.DTO.LiteralRational dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.LiteralRational ToDto(this Core.POCO.LiteralRational poco) - { - var dto = new Core.DTO.LiteralRational(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Value = poco.Value; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MembershipExtensions.cs deleted file mode 100644 index b48baeca2..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MembershipExtensions.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class MembershipExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Membership poco, Core.DTO.Membership dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.MemberName = dto.MemberName; - - poco.MemberShortName = dto.MemberShortName; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - poco.Visibility = dto.Visibility; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Membership poco, Core.DTO.Membership dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.MemberElement, out lazyPoco)) - { - poco.MemberElement = (IElement)lazyPoco.Value; - } - else - { - poco.MemberElement = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Membership ToDto(this Core.POCO.Membership poco) - { - var dto = new Core.DTO.Membership(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.MemberElement = poco.MemberElement.Id; - dto.MemberName = poco.MemberName; - dto.MemberShortName = poco.MemberShortName; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - dto.Visibility = poco.Visibility; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs deleted file mode 100644 index 92d3f839d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/MultiplicityRangeExtensions.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class MultiplicityRangeExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.MultiplicityRange poco, Core.DTO.MultiplicityRange dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.MultiplicityRange poco, Core.DTO.MultiplicityRange dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.MultiplicityRange ToDto(this Core.POCO.MultiplicityRange poco) - { - var dto = new Core.DTO.MultiplicityRange(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs deleted file mode 100644 index 4acde4495..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/OwningMembershipExtensions.cs +++ /dev/null @@ -1,255 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class OwningMembershipExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.OwningMembership poco, Core.DTO.OwningMembership dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.MemberName = dto.MemberName; - - poco.MemberShortName = dto.MemberShortName; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - poco.Visibility = dto.Visibility; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.OwningMembership poco, Core.DTO.OwningMembership dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.MemberElement, out lazyPoco)) - { - poco.MemberElement = (IElement)lazyPoco.Value; - } - else - { - poco.MemberElement = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.OwningMembership ToDto(this Core.POCO.OwningMembership poco) - { - var dto = new Core.DTO.OwningMembership(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.MemberElement = poco.MemberElement.Id; - dto.MemberName = poco.MemberName; - dto.MemberShortName = poco.MemberShortName; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Target = poco.Target.Select(x => x.Id).ToList(); - dto.Visibility = poco.Visibility; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs deleted file mode 100644 index 017aa1af1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs +++ /dev/null @@ -1,286 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class ReferenceSubsettingExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.ReferenceSubsetting poco, Core.DTO.ReferenceSubsetting dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.ReferenceSubsetting poco, Core.DTO.ReferenceSubsetting dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.General, out lazyPoco)) - { - poco.General = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.General = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - if (cache.TryGetValue(dto.ReferencedFeature, out lazyPoco)) - { - poco.ReferencedFeature = (Core.POCO.Feature)lazyPoco.Value; - } - else - { - poco.ReferencedFeature = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - if (cache.TryGetValue(dto.Specific, out lazyPoco)) - { - poco.Specific = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.Specific = null; - } - - if (cache.TryGetValue(dto.SubsettedFeature, out lazyPoco)) - { - poco.SubsettedFeature = (Core.POCO.Feature)lazyPoco.Value; - } - else - { - poco.SubsettedFeature = null; - } - - if (cache.TryGetValue(dto.SubsettingFeature, out lazyPoco)) - { - poco.SubsettingFeature = (Core.POCO.Feature)lazyPoco.Value; - } - else - { - poco.SubsettingFeature = null; - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.ReferenceSubsetting ToDto(this Core.POCO.ReferenceSubsetting poco) - { - var dto = new Core.DTO.ReferenceSubsetting(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.General = poco.General.Id; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.ReferencedFeature = poco.ReferencedFeature.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Specific = poco.Specific.Id; - dto.SubsettedFeature = poco.SubsettedFeature.Id; - dto.SubsettingFeature = poco.SubsettingFeature.Id; - dto.Target = poco.Target.Select(x => x.Id).ToList(); - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs deleted file mode 100644 index 2c43bb2d6..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs +++ /dev/null @@ -1,219 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class RequirementUsageExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.RequirementUsage poco, Core.DTO.RequirementUsage dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsIndividual = dto.IsIndividual; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - poco.IsVariation = dto.IsVariation; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - poco.PortionKind = dto.PortionKind; - - poco.ReqId = dto.ReqId; - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.RequirementUsage poco, Core.DTO.RequirementUsage dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.RequirementUsage ToDto(this Core.POCO.RequirementUsage poco) - { - var dto = new Core.DTO.RequirementUsage(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsIndividual = poco.IsIndividual; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.IsVariation = poco.IsVariation; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.PortionKind = poco.PortionKind; - dto.ReqId = poco.ReqId; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs deleted file mode 100644 index 8d2ada627..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SelectExpressionExtensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class SelectExpressionExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.SelectExpression poco, Core.DTO.SelectExpression dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - poco.Operator = dto.Operator; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.SelectExpression poco, Core.DTO.SelectExpression dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.SelectExpression ToDto(this Core.POCO.SelectExpression poco) - { - var dto = new Core.DTO.SelectExpression(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.Operator = poco.Operator; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SubclassificationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SubclassificationExtensions.cs deleted file mode 100644 index 7818ca40a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/SubclassificationExtensions.cs +++ /dev/null @@ -1,276 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class SubclassificationExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Subclassification poco, Core.DTO.Subclassification dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImplied = dto.IsImplied; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - var ownedRelatedElementToDelete = poco.OwnedRelatedElement.Select(x => x.Id).Except(dto.OwnedRelatedElement); - foreach (var identifier in ownedRelatedElementToDelete) - { - poco.OwnedRelatedElement.Remove(poco.OwnedRelatedElement.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelatedElementToDelete); - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - var sourceToDelete = poco.Source.Select(x => x.Id).Except(dto.Source); - foreach (var identifier in sourceToDelete) - { - poco.Source.Remove(poco.Source.Single(x => x.Id == identifier)); - } - - var targetToDelete = poco.Target.Select(x => x.Id).Except(dto.Target); - foreach (var identifier in targetToDelete) - { - poco.Target.Remove(poco.Target.Single(x => x.Id == identifier)); - } - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Subclassification poco, Core.DTO.Subclassification dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - if (cache.TryGetValue(dto.General, out lazyPoco)) - { - poco.General = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.General = null; - } - - var ownedRelatedElementToAdd = dto.OwnedRelatedElement.Except(poco.OwnedRelatedElement.Select(x => x.Id)); - foreach (var identifier in ownedRelatedElementToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelatedElement.Add((IElement)lazyPoco.Value); - } - } - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelatedElement.HasValue && cache.TryGetValue(dto.OwningRelatedElement.Value, out lazyPoco)) - { - poco.OwningRelatedElement = (IElement)lazyPoco.Value; - } - else - { - poco.OwningRelatedElement = null; - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - var sourceToAdd = dto.Source.Except(poco.Source.Select(x => x.Id)); - foreach (var identifier in sourceToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Source.Add((IElement)lazyPoco.Value); - } - } - - if (cache.TryGetValue(dto.Specific, out lazyPoco)) - { - poco.Specific = (Core.POCO.Type)lazyPoco.Value; - } - else - { - poco.Specific = null; - } - - if (cache.TryGetValue(dto.Subclassifier, out lazyPoco)) - { - poco.Subclassifier = (Core.POCO.Classifier)lazyPoco.Value; - } - else - { - poco.Subclassifier = null; - } - - if (cache.TryGetValue(dto.Superclassifier, out lazyPoco)) - { - poco.Superclassifier = (Core.POCO.Classifier)lazyPoco.Value; - } - else - { - poco.Superclassifier = null; - } - - var targetToAdd = dto.Target.Except(poco.Target.Select(x => x.Id)); - foreach (var identifier in targetToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.Target.Add((IElement)lazyPoco.Value); - } - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Subclassification ToDto(this Core.POCO.Subclassification poco) - { - var dto = new Core.DTO.Subclassification(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.General = poco.General.Id; - dto.IsImplied = poco.IsImplied; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; - dto.OwningRelationship = poco.OwningRelationship?.Id; - dto.Source = poco.Source.Select(x => x.Id).ToList(); - dto.Specific = poco.Specific.Id; - dto.Subclassifier = poco.Subclassifier.Id; - dto.Superclassifier = poco.Superclassifier.Id; - dto.Target = poco.Target.Select(x => x.Id).ToList(); - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs deleted file mode 100644 index 3042cffe5..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/TextualRepresentationExtensions.cs +++ /dev/null @@ -1,180 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class TextualRepresentationExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.TextualRepresentation poco, Core.DTO.TextualRepresentation dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.Body = dto.Body; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.ElementId = dto.ElementId; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.Language = dto.Language; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.TextualRepresentation poco, Core.DTO.TextualRepresentation dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.TextualRepresentation ToDto(this Core.POCO.TextualRepresentation poco) - { - var dto = new Core.DTO.TextualRepresentation(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.Body = poco.Body; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.ElementId = poco.ElementId; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.Language = poco.Language; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/UsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/UsageExtensions.cs deleted file mode 100644 index f5519bf24..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenPocoExtension/UsageExtensions.cs +++ /dev/null @@ -1,210 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Dal -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - - using Core.POCO; - - /// - /// A static class that provides extension methods for the class - /// - public static class UsageExtensions - { - /// - /// Updates the value properties of the by setting the value equal to that of the dto - /// Removes deleted objects from the reference properties and returns the unique identifiers - /// of the objects that have been removed from contained properties - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The unique identifiers of the objects that have been removed from contained properties - /// - /// - /// Thrown when the or is null - /// - public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Core.POCO.Usage poco, Core.DTO.Usage dto) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - var identifiersOfObjectsToDelete = new List(); - - poco.AliasIds = dto.AliasIds; - - poco.DeclaredName = dto.DeclaredName; - - poco.DeclaredShortName = dto.DeclaredShortName; - - poco.Direction = dto.Direction; - - poco.ElementId = dto.ElementId; - - poco.IsAbstract = dto.IsAbstract; - - poco.IsComposite = dto.IsComposite; - - poco.IsConstant = dto.IsConstant; - - poco.IsDerived = dto.IsDerived; - - poco.IsEnd = dto.IsEnd; - - poco.IsImpliedIncluded = dto.IsImpliedIncluded; - - poco.IsOrdered = dto.IsOrdered; - - poco.IsPortion = dto.IsPortion; - - poco.IsSufficient = dto.IsSufficient; - - poco.IsUnique = dto.IsUnique; - - poco.IsVariable = dto.IsVariable; - - poco.IsVariation = dto.IsVariation; - - var ownedRelationshipToDelete = poco.OwnedRelationship.Select(x => x.Id).Except(dto.OwnedRelationship); - foreach (var identifier in ownedRelationshipToDelete) - { - poco.OwnedRelationship.Remove(poco.OwnedRelationship.Single(x => x.Id == identifier)); - } - identifiersOfObjectsToDelete.AddRange(ownedRelationshipToDelete); - - - return identifiersOfObjectsToDelete; - } - - /// - /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO - /// and the provided cache to find the referenced object. - /// - /// - /// The that is to be updated - /// - /// - /// The DTO that is used to update the with - /// - /// - /// The that contains the - /// s that are know and cached. - /// - /// - public static void UpdateReferenceProperties(this Core.POCO.Usage poco, Core.DTO.Usage dto, ConcurrentDictionary> cache) - { - if (poco == null) - { - throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null"); - } - - if (dto == null) - { - throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null"); - } - - if (cache == null) - { - throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null"); - } - - Lazy lazyPoco; - - var ownedRelationshipToAdd = dto.OwnedRelationship.Except(poco.OwnedRelationship.Select(x => x.Id)); - foreach (var identifier in ownedRelationshipToAdd) - { - if (cache.TryGetValue(identifier, out lazyPoco)) - { - poco.OwnedRelationship.Add((IRelationship)lazyPoco.Value); - } - } - - if (dto.OwningRelationship.HasValue && cache.TryGetValue(dto.OwningRelationship.Value, out lazyPoco)) - { - poco.OwningRelationship = (IRelationship)lazyPoco.Value; - } - else - { - poco.OwningRelationship = null; - } - - } - - /// - /// Creates a based on the provided POCO - /// - /// - /// The subject from which a DTO is to be created - /// - /// - /// An instance of - /// - public static Core.DTO.Usage ToDto(this Core.POCO.Usage poco) - { - var dto = new Core.DTO.Usage(); - - dto.Id = poco.Id; - dto.AliasIds = poco.AliasIds; - dto.DeclaredName = poco.DeclaredName; - dto.DeclaredShortName = poco.DeclaredShortName; - dto.Direction = poco.Direction; - dto.ElementId = poco.ElementId; - dto.IsAbstract = poco.IsAbstract; - dto.IsComposite = poco.IsComposite; - dto.IsConstant = poco.IsConstant; - dto.IsDerived = poco.IsDerived; - dto.IsEnd = poco.IsEnd; - dto.IsImpliedIncluded = poco.IsImpliedIncluded; - dto.IsOrdered = poco.IsOrdered; - dto.IsPortion = poco.IsPortion; - dto.IsSufficient = poco.IsSufficient; - dto.IsUnique = poco.IsUnique; - dto.IsVariable = poco.IsVariable; - dto.IsVariation = poco.IsVariation; - dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); - dto.OwningRelationship = poco.OwningRelationship?.Id; - - return dto; - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AnnotatingElementSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AnnotatingElementSerializer.cs deleted file mode 100644 index 29d77c64c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AnnotatingElementSerializer.cs +++ /dev/null @@ -1,113 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class AnnotatingElementSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IAnnotatingElement iAnnotatingElement)) - { - throw new ArgumentException("The object shall be an IAnnotatingElement", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("AnnotatingElement"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iAnnotatingElement.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iAnnotatingElement.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iAnnotatingElement.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iAnnotatingElement.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iAnnotatingElement.ElementId); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iAnnotatingElement.IsImpliedIncluded); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iAnnotatingElement.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iAnnotatingElement.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iAnnotatingElement.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AssociationSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AssociationSerializer.cs deleted file mode 100644 index b29b72959..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/AssociationSerializer.cs +++ /dev/null @@ -1,164 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class AssociationSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IAssociation iAssociation)) - { - throw new ArgumentException("The object shall be an IAssociation", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Association"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iAssociation.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iAssociation.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iAssociation.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iAssociation.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iAssociation.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iAssociation.IsAbstract); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iAssociation.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iAssociation.IsImpliedIncluded); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iAssociation.IsSufficient); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iAssociation.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iAssociation.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iAssociation.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iAssociation.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iAssociation.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iAssociation.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iAssociation.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iAssociation.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/DependencySerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/DependencySerializer.cs deleted file mode 100644 index 6bb754b6a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/DependencySerializer.cs +++ /dev/null @@ -1,178 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class DependencySerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IDependency iDependency)) - { - throw new ArgumentException("The object shall be an IDependency", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Dependency"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iDependency.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iDependency.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WriteStartArray("client"u8); - foreach (var item in iDependency.Client) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iDependency.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iDependency.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iDependency.ElementId); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iDependency.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iDependency.IsImpliedIncluded); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iDependency.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iDependency.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iDependency.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iDependency.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iDependency.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iDependency.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iDependency.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("supplier"u8); - foreach (var item in iDependency.Supplier) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iDependency.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs deleted file mode 100644 index ab8ac42b6..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/EnumerationDefinitionSerializer.cs +++ /dev/null @@ -1,122 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class EnumerationDefinitionSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IEnumerationDefinition iEnumerationDefinition)) - { - throw new ArgumentException("The object shall be an IEnumerationDefinition", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("EnumerationDefinition"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iEnumerationDefinition.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iEnumerationDefinition.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iEnumerationDefinition.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iEnumerationDefinition.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iEnumerationDefinition.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iEnumerationDefinition.IsAbstract); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iEnumerationDefinition.IsImpliedIncluded); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iEnumerationDefinition.IsSufficient); - - writer.WritePropertyName("isVariation"u8); - writer.WriteBooleanValue(iEnumerationDefinition.IsVariation); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iEnumerationDefinition.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iEnumerationDefinition.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iEnumerationDefinition.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureSerializer.cs deleted file mode 100644 index 67c6511e1..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureSerializer.cs +++ /dev/null @@ -1,152 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class FeatureSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IFeature iFeature)) - { - throw new ArgumentException("The object shall be an IFeature", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Feature"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeature.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iFeature.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iFeature.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iFeature.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iFeature.Direction.HasValue) - { - writer.WriteStringValue(iFeature.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iFeature.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iFeature.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iFeature.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iFeature.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iFeature.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iFeature.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iFeature.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iFeature.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iFeature.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iFeature.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iFeature.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iFeature.IsVariable); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iFeature.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iFeature.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeature.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureTypingSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureTypingSerializer.cs deleted file mode 100644 index d83a3f442..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FeatureTypingSerializer.cs +++ /dev/null @@ -1,182 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class FeatureTypingSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IFeatureTyping iFeatureTyping)) - { - throw new ArgumentException("The object shall be an IFeatureTyping", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("FeatureTyping"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iFeatureTyping.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iFeatureTyping.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iFeatureTyping.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iFeatureTyping.ElementId); - - writer.WritePropertyName("general"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.General); - writer.WriteEndObject(); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iFeatureTyping.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iFeatureTyping.IsImpliedIncluded); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iFeatureTyping.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iFeatureTyping.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iFeatureTyping.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iFeatureTyping.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iFeatureTyping.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("specific"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.Specific); - writer.WriteEndObject(); - - writer.WriteStartArray("target"u8); - foreach (var item in iFeatureTyping.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("type"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.Type); - writer.WriteEndObject(); - - writer.WritePropertyName("typedFeature"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureTyping.TypedFeature); - writer.WriteEndObject(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FlowSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FlowSerializer.cs deleted file mode 100644 index a4b8c909d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FlowSerializer.cs +++ /dev/null @@ -1,197 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class FlowSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IFlow iFlow)) - { - throw new ArgumentException("The object shall be an IFlow", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Flow"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFlow.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iFlow.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iFlow.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iFlow.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iFlow.Direction.HasValue) - { - writer.WriteStringValue(iFlow.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iFlow.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iFlow.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iFlow.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iFlow.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iFlow.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iFlow.IsEnd); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iFlow.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iFlow.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iFlow.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iFlow.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iFlow.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iFlow.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iFlow.IsVariable); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iFlow.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iFlow.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iFlow.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFlow.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iFlow.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFlow.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iFlow.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iFlow.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs deleted file mode 100644 index fb493b04d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs +++ /dev/null @@ -1,174 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class FramedConcernMembershipSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IFramedConcernMembership iFramedConcernMembership)) - { - throw new ArgumentException("The object shall be an IFramedConcernMembership", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("FramedConcernMembership"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFramedConcernMembership.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iFramedConcernMembership.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iFramedConcernMembership.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iFramedConcernMembership.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iFramedConcernMembership.ElementId); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iFramedConcernMembership.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iFramedConcernMembership.IsImpliedIncluded); - - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(iFramedConcernMembership.Kind.ToString().ToLower()); - - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFramedConcernMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iFramedConcernMembership.MemberName); - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iFramedConcernMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iFramedConcernMembership.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iFramedConcernMembership.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iFramedConcernMembership.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFramedConcernMembership.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iFramedConcernMembership.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFramedConcernMembership.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iFramedConcernMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iFramedConcernMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("visibility"u8); - writer.WriteStringValue(iFramedConcernMembership.Visibility.ToString().ToLower()); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralIntegerSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralIntegerSerializer.cs deleted file mode 100644 index c94847192..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralIntegerSerializer.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class LiteralIntegerSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is ILiteralInteger iLiteralInteger)) - { - throw new ArgumentException("The object shall be an ILiteralInteger", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("LiteralInteger"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iLiteralInteger.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iLiteralInteger.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iLiteralInteger.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iLiteralInteger.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iLiteralInteger.Direction.HasValue) - { - writer.WriteStringValue(iLiteralInteger.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iLiteralInteger.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iLiteralInteger.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iLiteralInteger.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iLiteralInteger.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iLiteralInteger.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iLiteralInteger.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iLiteralInteger.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iLiteralInteger.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iLiteralInteger.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iLiteralInteger.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iLiteralInteger.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iLiteralInteger.IsVariable); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iLiteralInteger.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iLiteralInteger.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iLiteralInteger.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("value"u8); - writer.WriteNumberValue(iLiteralInteger.Value); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralRationalSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralRationalSerializer.cs deleted file mode 100644 index 1b1381cdf..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/LiteralRationalSerializer.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class LiteralRationalSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is ILiteralRational iLiteralRational)) - { - throw new ArgumentException("The object shall be an ILiteralRational", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("LiteralRational"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iLiteralRational.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iLiteralRational.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iLiteralRational.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iLiteralRational.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iLiteralRational.Direction.HasValue) - { - writer.WriteStringValue(iLiteralRational.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iLiteralRational.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iLiteralRational.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iLiteralRational.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iLiteralRational.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iLiteralRational.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iLiteralRational.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iLiteralRational.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iLiteralRational.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iLiteralRational.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iLiteralRational.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iLiteralRational.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iLiteralRational.IsVariable); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iLiteralRational.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iLiteralRational.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iLiteralRational.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("value"u8); - writer.WriteNumberValue(iLiteralRational.Value); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MembershipSerializer.cs deleted file mode 100644 index d4e1d6053..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MembershipSerializer.cs +++ /dev/null @@ -1,171 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class MembershipSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IMembership iMembership)) - { - throw new ArgumentException("The object shall be an IMembership", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Membership"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMembership.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iMembership.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iMembership.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iMembership.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iMembership.ElementId); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iMembership.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iMembership.IsImpliedIncluded); - - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iMembership.MemberName); - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iMembership.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iMembership.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iMembership.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMembership.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iMembership.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMembership.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("visibility"u8); - writer.WriteStringValue(iMembership.Visibility.ToString().ToLower()); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs deleted file mode 100644 index a118ab48b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/MultiplicityRangeSerializer.cs +++ /dev/null @@ -1,152 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class MultiplicityRangeSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IMultiplicityRange iMultiplicityRange)) - { - throw new ArgumentException("The object shall be an IMultiplicityRange", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("MultiplicityRange"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMultiplicityRange.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iMultiplicityRange.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iMultiplicityRange.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iMultiplicityRange.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iMultiplicityRange.Direction.HasValue) - { - writer.WriteStringValue(iMultiplicityRange.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iMultiplicityRange.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iMultiplicityRange.IsVariable); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iMultiplicityRange.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iMultiplicityRange.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iMultiplicityRange.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/OwningMembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/OwningMembershipSerializer.cs deleted file mode 100644 index 745ebdf71..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/OwningMembershipSerializer.cs +++ /dev/null @@ -1,171 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class OwningMembershipSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IOwningMembership iOwningMembership)) - { - throw new ArgumentException("The object shall be an IOwningMembership", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("OwningMembership"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iOwningMembership.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iOwningMembership.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iOwningMembership.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iOwningMembership.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iOwningMembership.ElementId); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iOwningMembership.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iOwningMembership.IsImpliedIncluded); - - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iOwningMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iOwningMembership.MemberName); - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iOwningMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iOwningMembership.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iOwningMembership.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iOwningMembership.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iOwningMembership.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iOwningMembership.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iOwningMembership.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iOwningMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - foreach (var item in iOwningMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("visibility"u8); - writer.WriteStringValue(iOwningMembership.Visibility.ToString().ToLower()); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs deleted file mode 100644 index b12ef710a..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs +++ /dev/null @@ -1,188 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class ReferenceSubsettingSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IReferenceSubsetting iReferenceSubsetting)) - { - throw new ArgumentException("The object shall be an IReferenceSubsetting", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("ReferenceSubsetting"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iReferenceSubsetting.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iReferenceSubsetting.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iReferenceSubsetting.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iReferenceSubsetting.ElementId); - - writer.WritePropertyName("general"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.General); - writer.WriteEndObject(); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iReferenceSubsetting.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iReferenceSubsetting.IsImpliedIncluded); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iReferenceSubsetting.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iReferenceSubsetting.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iReferenceSubsetting.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iReferenceSubsetting.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("referencedFeature"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.ReferencedFeature); - writer.WriteEndObject(); - - writer.WriteStartArray("source"u8); - foreach (var item in iReferenceSubsetting.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("specific"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.Specific); - writer.WriteEndObject(); - - writer.WritePropertyName("subsettedFeature"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.SubsettedFeature); - writer.WriteEndObject(); - - writer.WritePropertyName("subsettingFeature"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReferenceSubsetting.SubsettingFeature); - writer.WriteEndObject(); - - writer.WriteStartArray("target"u8); - foreach (var item in iReferenceSubsetting.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/RequirementUsageSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/RequirementUsageSerializer.cs deleted file mode 100644 index 6bf748287..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/RequirementUsageSerializer.cs +++ /dev/null @@ -1,169 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class RequirementUsageSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IRequirementUsage iRequirementUsage)) - { - throw new ArgumentException("The object shall be an IRequirementUsage", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("RequirementUsage"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iRequirementUsage.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iRequirementUsage.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iRequirementUsage.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iRequirementUsage.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iRequirementUsage.Direction.HasValue) - { - writer.WriteStringValue(iRequirementUsage.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iRequirementUsage.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iRequirementUsage.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iRequirementUsage.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iRequirementUsage.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iRequirementUsage.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iRequirementUsage.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iRequirementUsage.IsImpliedIncluded); - - writer.WritePropertyName("isIndividual"u8); - writer.WriteBooleanValue(iRequirementUsage.IsIndividual); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iRequirementUsage.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iRequirementUsage.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iRequirementUsage.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iRequirementUsage.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iRequirementUsage.IsVariable); - - writer.WritePropertyName("isVariation"u8); - writer.WriteBooleanValue(iRequirementUsage.IsVariation); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iRequirementUsage.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iRequirementUsage.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iRequirementUsage.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("portionKind"u8); - if (iRequirementUsage.PortionKind.HasValue) - { - writer.WriteStringValue(iRequirementUsage.PortionKind.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("reqId"u8); - writer.WriteStringValue(iRequirementUsage.ReqId); - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SelectExpressionSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SelectExpressionSerializer.cs deleted file mode 100644 index d26f9e170..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SelectExpressionSerializer.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class SelectExpressionSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is ISelectExpression iSelectExpression)) - { - throw new ArgumentException("The object shall be an ISelectExpression", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("SelectExpression"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSelectExpression.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iSelectExpression.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iSelectExpression.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iSelectExpression.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iSelectExpression.Direction.HasValue) - { - writer.WriteStringValue(iSelectExpression.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iSelectExpression.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iSelectExpression.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iSelectExpression.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iSelectExpression.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iSelectExpression.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iSelectExpression.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iSelectExpression.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iSelectExpression.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iSelectExpression.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iSelectExpression.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iSelectExpression.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iSelectExpression.IsVariable); - - writer.WritePropertyName("operator"u8); - writer.WriteStringValue(iSelectExpression.Operator); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iSelectExpression.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iSelectExpression.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSelectExpression.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SubclassificationSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SubclassificationSerializer.cs deleted file mode 100644 index 8186df145..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/SubclassificationSerializer.cs +++ /dev/null @@ -1,182 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class SubclassificationSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is ISubclassification iSubclassification)) - { - throw new ArgumentException("The object shall be an ISubclassification", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Subclassification"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iSubclassification.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iSubclassification.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iSubclassification.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iSubclassification.ElementId); - - writer.WritePropertyName("general"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.General); - writer.WriteEndObject(); - - writer.WritePropertyName("isImplied"u8); - writer.WriteBooleanValue(iSubclassification.IsImplied); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iSubclassification.IsImpliedIncluded); - - writer.WriteStartArray("ownedRelatedElement"u8); - foreach (var item in iSubclassification.OwnedRelatedElement) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iSubclassification.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelatedElement"u8); - if (iSubclassification.OwningRelatedElement.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.OwningRelatedElement.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("owningRelationship"u8); - if (iSubclassification.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteStartArray("source"u8); - foreach (var item in iSubclassification.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("specific"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.Specific); - writer.WriteEndObject(); - - writer.WritePropertyName("subclassifier"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.Subclassifier); - writer.WriteEndObject(); - - writer.WritePropertyName("superclassifier"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubclassification.Superclassifier); - writer.WriteEndObject(); - - writer.WriteStartArray("target"u8); - foreach (var item in iSubclassification.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/TextualRepresentationSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/TextualRepresentationSerializer.cs deleted file mode 100644 index e9d72d98f..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/TextualRepresentationSerializer.cs +++ /dev/null @@ -1,119 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class TextualRepresentationSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is ITextualRepresentation iTextualRepresentation)) - { - throw new ArgumentException("The object shall be an ITextualRepresentation", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("TextualRepresentation"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iTextualRepresentation.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iTextualRepresentation.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("body"u8); - writer.WriteStringValue(iTextualRepresentation.Body); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iTextualRepresentation.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iTextualRepresentation.DeclaredShortName); - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iTextualRepresentation.ElementId); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iTextualRepresentation.IsImpliedIncluded); - - writer.WritePropertyName("language"u8); - writer.WriteStringValue(iTextualRepresentation.Language); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iTextualRepresentation.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iTextualRepresentation.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iTextualRepresentation.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/UsageSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/UsageSerializer.cs deleted file mode 100644 index e1abd9445..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Expected/Ecore/Core/AutoGenSerializer/UsageSerializer.cs +++ /dev/null @@ -1,155 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.Serializer.Json.Core.DTO -{ - using System; - using System.Text.Json; - - using SysML2.NET.Common; - using SysML2.NET.Core.DTO; - using SysML2.NET.Serializer.Json; - - /// - /// The purpose of the is to provide serialization capabilities - /// capabilities for the interface - /// - internal static class UsageSerializer - { - /// - /// Serializes an instance of using an - /// - /// - /// The to serialize - /// - /// - /// The target - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - internal static void Serialize(object obj, Utf8JsonWriter writer, SerializationModeKind serializationModeKind) - { - if (!(obj is IUsage iUsage)) - { - throw new ArgumentException("The object shall be an IUsage", nameof(obj)); - } - - writer.WriteStartObject(); - - writer.WritePropertyName("@type"u8); - writer.WriteStringValue("Usage"u8); - - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iUsage.Id); - - writer.WriteStartArray("aliasIds"u8); - foreach (var item in iUsage.AliasIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - - writer.WritePropertyName("declaredName"u8); - writer.WriteStringValue(iUsage.DeclaredName); - writer.WritePropertyName("declaredShortName"u8); - writer.WriteStringValue(iUsage.DeclaredShortName); - writer.WritePropertyName("direction"u8); - if (iUsage.Direction.HasValue) - { - writer.WriteStringValue(iUsage.Direction.Value.ToString().ToLower()); - } - else - { - writer.WriteNullValue(); - } - writer.WritePropertyName("elementId"u8); - writer.WriteStringValue(iUsage.ElementId); - - writer.WritePropertyName("isAbstract"u8); - writer.WriteBooleanValue(iUsage.IsAbstract); - - writer.WritePropertyName("isComposite"u8); - writer.WriteBooleanValue(iUsage.IsComposite); - - writer.WritePropertyName("isConstant"u8); - writer.WriteBooleanValue(iUsage.IsConstant); - - writer.WritePropertyName("isDerived"u8); - writer.WriteBooleanValue(iUsage.IsDerived); - - writer.WritePropertyName("isEnd"u8); - writer.WriteBooleanValue(iUsage.IsEnd); - - writer.WritePropertyName("isImpliedIncluded"u8); - writer.WriteBooleanValue(iUsage.IsImpliedIncluded); - - writer.WritePropertyName("isOrdered"u8); - writer.WriteBooleanValue(iUsage.IsOrdered); - - writer.WritePropertyName("isPortion"u8); - writer.WriteBooleanValue(iUsage.IsPortion); - - writer.WritePropertyName("isSufficient"u8); - writer.WriteBooleanValue(iUsage.IsSufficient); - - writer.WritePropertyName("isUnique"u8); - writer.WriteBooleanValue(iUsage.IsUnique); - - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iUsage.IsVariable); - - writer.WritePropertyName("isVariation"u8); - writer.WriteBooleanValue(iUsage.IsVariation); - - writer.WriteStartArray("ownedRelationship"u8); - foreach (var item in iUsage.OwnedRelationship) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - writer.WriteEndArray(); - - writer.WritePropertyName("owningRelationship"u8); - if (iUsage.OwningRelationship.HasValue) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iUsage.OwningRelationship.Value); - writer.WriteEndObject(); - } - else - { - writer.WriteNullValue(); - } - writer.WriteEndObject(); - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.CodeGenerator.Tests/Extensions/EcoreExtensionsTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Extensions/EcoreExtensionsTestFixture.cs deleted file mode 100644 index b20c5220b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Extensions/EcoreExtensionsTestFixture.cs +++ /dev/null @@ -1,53 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Extensions -{ - using ECoreNetto; - - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Extensions; - - [TestFixture] - public class EcoreExtensionsTestFixture - { - private EPackage ePackage; - - [SetUp] - public void SetUp() - { - this.ePackage = DataModelLoader.Load(); - } - - [Test] - public void Verify_that_QueryDocumentation_gracefully_returns() - { - var classifiers = this.ePackage.EClassifiers; - - Assert.That(() => - { - foreach (var eEnum in classifiers) - { - var docs = eEnum.QueryDocumentation(); - } - }, Throws.Nothing); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGeneratorTestFixture.cs deleted file mode 100644 index 8f4ee015c..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGeneratorTestFixture.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using System.IO; - using System.Threading.Tasks; - - using ECoreNetto; - - using NUnit.Framework; - - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreDalFactoryGeneratorTestFixture - { - private DirectoryInfo dalFactoryDirectoryInfo; - - private CoreDalFactoryGenerator dalFactoryGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Dal.Core.AutoGenElementFactory"); - - this.dalFactoryDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dalFactoryGenerator = new CoreDalFactoryGenerator(); - } - - [Test] - public void Verify_that_POCO_Element_factory_is_generated() - { - Assert.That(async () => await this.dalFactoryGenerator.GenerateElementDalFactory(rootPackage, dalFactoryDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void Verify_that_POCO_factories_are_generated() - { - Assert.That(async () => await this.dalFactoryGenerator.GeneratePocoFactories(rootPackage, dalFactoryDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_POCO_factories_are_generated_as_expected(string className) - { - var generatedCode = await this.dalFactoryGenerator.GeneratePocoFactory(rootPackage, dalFactoryDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenElementFactory/{className}Factory.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGeneratorTestFixture.cs deleted file mode 100644 index e487358ab..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGeneratorTestFixture.cs +++ /dev/null @@ -1,79 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - using System.Threading.Tasks; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreDalPocoExtensionsGeneratorTestFixture - { - private DirectoryInfo dalFactoryDirectoryInfo; - - private CoreDalPocoExtensionsGenerator dalPocoExtensionsGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Dal.Core.AutoGenPocoExtension"); - - this.dalFactoryDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dalPocoExtensionsGenerator = new CoreDalPocoExtensionsGenerator(); - } - - [Test] - public void Verify_that_ElementExtensions_is_generated() - { - Assert.That(async () => await this.dalPocoExtensionsGenerator.GenerateElementExtensions(rootPackage, dalFactoryDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void Verify_that_POCO_DalExtensions_are_generated() - { - Assert.That(async () => await this.dalPocoExtensionsGenerator.GenerateDalPocoExtensions(rootPackage, dalFactoryDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_POCO_DalExtensions_are_generated_as_expected(string className) - { - var generatedCode = await this.dalPocoExtensionsGenerator.GenerateDalPocoExtension(rootPackage, dalFactoryDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenPocoExtension/{className}Extensions.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGeneratorTestFixture.cs deleted file mode 100644 index 8864a4927..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGeneratorTestFixture.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - using System.Threading.Tasks; - - /// - /// Suite of tests for the class. - /// - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreDtoDictionaryReaderGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreDtoDictionaryReaderGenerator dtoDictionaryReaderGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Serializer.Dictionary.Core.AutoGenDictionaryReader"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dtoDictionaryReaderGenerator = new CoreDtoDictionaryReaderGenerator(); - } - - [Test] - public void verify_dto_DictionaryReaders_are_generated() - { - Assert.That(async () => await this.dtoDictionaryReaderGenerator.GenerateDtoDictionaryReaders(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_DictionaryReaderProvider_is_generated() - { - Assert.That(async () => await this.dtoDictionaryReaderGenerator.GenerateDtoDictionaryReaderProvider(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_expected_class_are_generated_correctly(string className) - { - var generatedCode = await this.dtoDictionaryReaderGenerator.GenerateDtoDictionaryReader(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenDictionaryReader/{className}DictionaryReader.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGeneratorTestFixture.cs deleted file mode 100644 index e51383925..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGeneratorTestFixture.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - using System.Threading.Tasks; - - /// - /// Suite of tests for the class. - /// - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreDtoDictionaryWriterGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreDtoDictionaryWriterGenerator dtoDictionaryWriterGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Serializer.Dictionary.Core.AutoGenDictionaryWriter"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dtoDictionaryWriterGenerator = new CoreDtoDictionaryWriterGenerator(); - } - - [Test] - public void verify_dto_DictionaryWriters_are_generated() - { - Assert.That(async () => await this.dtoDictionaryWriterGenerator.GenerateDtoDictionaryWriters(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_DictionaryWritersProvider_is_generated() - { - Assert.That(async () => await this.dtoDictionaryWriterGenerator.GenerateDtoDictionaryWriterProvider(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_expected_class_are_generated_correctly(string className) - { - var generatedCode = await this.dtoDictionaryWriterGenerator.GenerateDtoDictionaryWriter(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenDictionaryWriter/{className}DictionaryWriter.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoGeneratorTestGenerator.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoGeneratorTestGenerator.cs deleted file mode 100644 index 669e4a89d..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreDtoGeneratorTestGenerator.cs +++ /dev/null @@ -1,89 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - using System.Threading.Tasks; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreDtoGeneratorTestGenerator - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreDtoGenerator dtoGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Core.AutoGenDto"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dtoGenerator = new CoreDtoGenerator(); - } - - [Test] - public void verify_dto_interfaces_are_generated() - { - Assert.That(async () => await dtoGenerator.GenerateInterfaces(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_dto_classes_are_generated() - { - Assert.That(async () => await dtoGenerator.GenerateClasses(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_expected_dto_classes_are_generated_correctly(string className) - { - var generatedCode = await this.dtoGenerator.GenerateClass(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenDto/{className}.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - - [Test, TestCaseSource(typeof(ExpectedAllClasses)), Category("Expected")] - public async Task Verify_that_expected_dto_interfaces_are_generated_correctly(string className) - { - var generatedCode = await this.dtoGenerator.GenerateInterface(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenDto/I{className}.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreEnumGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreEnumGeneratorTestFixture.cs deleted file mode 100644 index af55a9e45..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreEnumGeneratorTestFixture.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using System.IO; - - using ECoreNetto; - - using NUnit.Framework; - - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreEnumGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreEnumGenerator enumGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Core.AutoGenEnum"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.enumGenerator = new CoreEnumGenerator(); - } - - [Test] - public void verify_enum_are_generated() - { - Assert.That(async () => await enumGenerator.Generate(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGeneratorTestFixture.cs deleted file mode 100644 index 83c66e049..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGeneratorTestFixture.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using System.IO; - - using ECoreNetto; - - using NUnit.Framework; - - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreGraphQLSchemaGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreGraphQLSchemaGenerator graphQlSchemaGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.OGM.Core.AutoGenGraphQLSchema"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.graphQlSchemaGenerator = new CoreGraphQLSchemaGenerator(); - } - - [Test] - public void verify_GraphQL_Schema_Are_generated() - { - Assert.That(async () => await graphQlSchemaGenerator.Generate(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGeneratorTestFixture.cs deleted file mode 100644 index c27c1f97b..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGeneratorTestFixture.cs +++ /dev/null @@ -1,86 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - using System.Threading.Tasks; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreJsonDtoDeSerializerGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreJsonDtoDeSerializerGenerator coreJsonDtoDeSerializerGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Serializer.Json.Core.AutoGenDeSerializer"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.coreJsonDtoDeSerializerGenerator = new CoreJsonDtoDeSerializerGenerator(); - } - - [Test] - public void verify_enum_deserializers_are_generated() - { - Assert.That(async () => await coreJsonDtoDeSerializerGenerator.GenerateEnumDeSerializers(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_dto_deserializers_are_generated() - { - Assert.That(async () => await coreJsonDtoDeSerializerGenerator.GenerateDtoDeSerializers(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_DeSerializationProvider_is_generated() - { - Assert.That(async () => await coreJsonDtoDeSerializerGenerator.GenerateDeSerializationProvider(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public void Verify_that_expected_json_deserializer_classes_are_generated_correctly(string className) - { - var generatedCode = this.coreJsonDtoDeSerializerGenerator.GenerateClass(this.rootPackage, className); - - var expected = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenDeSerializer/{className}DeSerializer.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGeneratorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGeneratorTestFixture.cs deleted file mode 100644 index ca0989d48..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGeneratorTestFixture.cs +++ /dev/null @@ -1,78 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using NUnit.Framework; - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - using System.IO; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CoreJsonDtoSerializerGeneratorTestFixture - { - private DirectoryInfo dtoDirectoryInfo; - - private CoreJsonDtoSerializerGenerator dtoSerializerGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Serializer.Json.Core.AutoGenSerializer"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.dtoSerializerGenerator = new CoreJsonDtoSerializerGenerator(); - } - - [Test] - public void verify_dto_serializers_are_generated() - { - Assert.That(async () => await dtoSerializerGenerator.GenerateSerializers(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_SerializationProvider_is_generated() - { - Assert.That(async () => await dtoSerializerGenerator.GenerateSerializationProvider(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public void Verify_that_expected_json_deserializer_classes_are_generated_correctly(string className) - { - var generatedCode = this.dtoSerializerGenerator.GenerateClass(this.rootPackage, className); - - var expected = File.ReadAllText(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/ECore/Core/AutoGenSerializer/{className}Serializer.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CorePocoGeneratorTestGenerator.cs b/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CorePocoGeneratorTestGenerator.cs deleted file mode 100644 index 73f5df626..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Generators/EcoreHandleBarsGenerators/CorePocoGeneratorTestGenerator.cs +++ /dev/null @@ -1,92 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Generators.HandleBarsGenerators -{ - using System.IO; - using System.Threading.Tasks; - - using ECoreNetto; - - using NUnit.Framework; - - using SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators; - using SysML2.NET.CodeGenerator.Tests.Expected.Ecore.Core; - - [Explicit("we are about to drop Ecore based code gen, these are present for reference only until permanently removed")] - [TestFixture] - public class CorePocoGeneratorTestGenerator - { - private DirectoryInfo dtoDirectoryInfo; - - private CorePocoGenerator pocoGenerator; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - var outputpath = TestContext.CurrentContext.TestDirectory; - var directoryInfo = new DirectoryInfo(outputpath); - - var path = Path.Combine("ECore", "_SysML2.NET.Core.AutoGenPoco"); - - this.dtoDirectoryInfo = directoryInfo.CreateSubdirectory(path); - - this.rootPackage = DataModelLoader.Load(); - - this.pocoGenerator = new CorePocoGenerator(); - } - - [Test] - public void verify_poco_interfaces_are_generated() - { - Assert.That(async () => await this.pocoGenerator.GenerateInterfaces(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test] - public void verify_poco_classes_are_generated() - { - Assert.That(async () => await this.pocoGenerator.GenerateClasses(rootPackage, dtoDirectoryInfo), - Throws.Nothing); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public async Task Verify_that_expected_poco_classes_are_generated_correctly(string className) - { - var generatedCode = await this.pocoGenerator.GenerateClass(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/Ecore/Core/AutGenPoco/{className}.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - - [Test, TestCaseSource(typeof(ExpectedAllClasses)), Category("Expected")] - public async Task Verify_that_expected_poco_interfaces_are_generated_correctly(string className) - { - var generatedCode = await this.pocoGenerator.GenerateInterface(rootPackage, dtoDirectoryInfo, className); - - var expected = await File.ReadAllTextAsync(Path.Combine(TestContext.CurrentContext.TestDirectory, $"Expected/Ecore/Core/AutGenPoco/I{className}.cs")); - - Assert.That(generatedCode, Is.EqualTo(expected)); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/Inspector/EcoreModelInspectorTestFixture.cs b/SysML2.NET.CodeGenerator.Tests/Inspector/EcoreModelInspectorTestFixture.cs deleted file mode 100644 index 8221d89e8..000000000 --- a/SysML2.NET.CodeGenerator.Tests/Inspector/EcoreModelInspectorTestFixture.cs +++ /dev/null @@ -1,81 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Tests.Inspector -{ - using System; - - using ECoreNetto; - using ECoreNetto.Extensions; - using ECoreNetto.Reporting.Generators; - using Expected.Ecore.Core; - using NUnit.Framework; - - using SysML2.NET.CodeGenerator; - - /// - /// Suite of tests for the class. - /// - [TestFixture] - public class EcoreModelInspectorTestFixture - { - private ModelInspector modelInspector; - - private EPackage rootPackage; - - [SetUp] - public void SetUp() - { - this.rootPackage = DataModelLoader.Load(); - - this.modelInspector = new ModelInspector(); - } - - [Test] - public void Verify_that_inspects_executes_as_expected() - { - var report = this.modelInspector.Inspect(this.rootPackage, true); - - Assert.That(report, Is.Not.Empty); - - Console.WriteLine(report); - } - - [Test, TestCaseSource(typeof(ExpectedConcreteClasses)), Category("Expected")] - public void Verify_that_inspect_class_executes_as_expected(string className) - { - var report = this.modelInspector.Inspect(this.rootPackage, className); - - Assert.That(report, Is.Not.Empty); - - Console.WriteLine(report); - } - - [Test] - public void Verify_that_analyze_docs_executes_as_expected() - { - var report = this.modelInspector.AnalyzeDocumentation(this.rootPackage, true); - - Assert.That(report, Is.Not.Empty); - - Console.WriteLine(report); - } - } -} diff --git a/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj b/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj index 40aeaff62..4156b6fe2 100644 --- a/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj +++ b/SysML2.NET.CodeGenerator.Tests/SysML2.NET.CodeGenerator.Tests.csproj @@ -18,250 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -290,375 +46,6 @@ - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - Always @@ -1354,228 +741,6 @@ - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - - - Always - Always @@ -1618,4 +783,8 @@ + + + + \ No newline at end of file diff --git a/SysML2.NET.CodeGenerator/DataModelLoader.cs b/SysML2.NET.CodeGenerator/DataModelLoader.cs deleted file mode 100644 index 5bba33c02..000000000 --- a/SysML2.NET.CodeGenerator/DataModelLoader.cs +++ /dev/null @@ -1,85 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator -{ - using System; - using System.IO; - using System.Linq; - using System.Net.Http; - using System.Reflection; - - using ECoreNetto; - using ECoreNetto.Resource; - - /// - /// The purpose of the is to load the SysML data-model - /// from the ecore file - /// - public static class DataModelLoader - { - /// - /// Load the data model and return the root - /// - /// - /// the root - /// - public static EPackage Load() - { - var assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - var ecoreFileName = Path.Combine(assemblyFolder, "datamodel", "SysML.ecore"); - - var uri = new Uri(ecoreFileName); - - var resourceSet = new ResourceSet(); - var resource = resourceSet.CreateResource(uri); - - var root = resource.Load(null); - - SortElementsByName(root); - - return root; - } - - /// - /// Sort the contained classes, structural features and operations in alphabetical order. - /// - /// - /// the who's content needs to be sorted - /// - public static void SortElementsByName(EPackage package) - { - var classifiers = package.EClassifiers.OrderBy(x => x.Name).ToList(); - package.EClassifiers.Clear(); - package.EClassifiers.AddRange(classifiers); - - foreach (var eClassifier in classifiers.OfType()) - { - var eStructuralFeatures = eClassifier.EStructuralFeatures.OrderBy(x => x.Name).ToList(); - eClassifier.EStructuralFeatures.Clear(); - eClassifier.EStructuralFeatures.AddRange(eStructuralFeatures); - - var eOperations = eClassifier.EOperations.OrderBy(x => x.Name).ToList(); - eClassifier.EOperations.Clear(); - eClassifier.EOperations.AddRange(eOperations); - } - } - } -} diff --git a/SysML2.NET.CodeGenerator/Extensions/EcoreExtensions.cs b/SysML2.NET.CodeGenerator/Extensions/EcoreExtensions.cs deleted file mode 100644 index 55be5fbda..000000000 --- a/SysML2.NET.CodeGenerator/Extensions/EcoreExtensions.cs +++ /dev/null @@ -1,452 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Extensions -{ - using System; - using System.Collections.Generic; - using System.Linq; - - using ECoreNetto; - using ECoreNetto.Extensions; - - using HtmlAgilityPack; - - /// - /// Extension methods for ECoreNetto classes - /// - public static class EcoreExtensions - { - /// - /// Queries the type-name of the - /// - /// - /// The subject - /// - /// - /// the name of the type - /// - public static string QueryTypeName(this EStructuralFeature eStructuralFeature) - { - var typeName = ""; - - if (eStructuralFeature is EAttribute eAttribute) - { - typeName = eAttribute.EType.Name; - - } - else if (eStructuralFeature is EReference eReference) - { - typeName = eReference.EType.Name; - } - - return typeName; - } - - /// - /// A mapping of the known SysML value types to C# types - /// - private static readonly Dictionary CSharpTypeMapping = new Dictionary - { - {"Boolean", "bool"}, - {"Integer", "int"}, - {"Real", "double"}, - {"UnlimitedNatural", "int"}, - {"String", "string"}, - {"EDouble", "double"} - }; - - /// - /// Queries the C# type-name of the - /// - /// - /// The subject - /// - /// - /// the C# name of the type - /// - public static string QueryCSharpTypeName(this EStructuralFeature eStructuralFeature) - { - var typeName = ""; - - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - typeName = eAttribute.EType.Name; - } - else if (!CSharpTypeMapping.TryGetValue(eAttribute.EType.Name, out typeName)) - { - throw new KeyNotFoundException($"the {eAttribute.Name}.{eAttribute.EType.Name} is not a registered Type"); - } - } - else if (eStructuralFeature is EReference eReference) - { - typeName = eReference.EType.Name; - } - - return typeName; - } - - /// - /// A mapping of the known SysML value types to GraphQL types - /// - private static readonly Dictionary GraphQLTypeMapping = new Dictionary - { - {"Boolean", "Boolean"}, - {"Integer", "Int"}, - {"Real", "Float"}, - {"UnlimitedNatural", "Int"}, - {"String", "String"}, - {"EDouble", "Float"} - }; - - /// - /// Queries the GraphQL type-name of the - /// - /// - /// The subject - /// - /// - /// the C# name of the type - /// - public static string QueryGraphQLTypeName(this EStructuralFeature eStructuralFeature) - { - var typeName = ""; - - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - typeName = eAttribute.EType.Name; - } - else if (!GraphQLTypeMapping.TryGetValue(eAttribute.EType.Name, out typeName)) - { - throw new KeyNotFoundException($"the {eAttribute.Name}.{eAttribute.EType.Name} is not a registered Type"); - } - } - else if (eStructuralFeature is EReference eReference) - { - typeName = eReference.EType.Name; - } - - return typeName; - } - - /// - /// Queries whether the Type is a boolean - /// - /// - /// the subject - /// - /// - /// true if it maps, false if not - /// - public static bool QueryIsBool(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - return false; - } - - if (eAttribute.EType.Name == "Boolean") - { - return true; - } - } - - return false; - } - - /// - /// Queries whether the Type is numeric - /// - /// - /// the subject - /// - /// - /// true if it maps, false if not - /// - public static bool QueryIsNumeric(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - return false; - } - - if (eAttribute.EType.Name == "Integer" - || eAttribute.EType.Name == "Real" - || eAttribute.EType.Name == "UnlimitedNatural" - || eAttribute.EType.Name == "EDouble") - { - return true; - } - } - - return false; - } - - /// - /// Queries whether the Type is an integer - /// - /// - /// the subject - /// - /// - /// true if it maps, false if not - /// - public static bool QueryIsInt(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - return false; - } - - if (eAttribute.EType.Name == "Integer") - { - return true; - } - } - - return false; - } - - /// - /// Queries whether the Type is a double - /// - /// - /// the subject - /// - /// - /// true if it maps, false if not - /// - public static bool QueryIsDouble(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - return false; - } - - if (eAttribute.EType.Name == "Real" || eAttribute.EType.Name == "EDouble") - { - return true; - } - } - - return false; - } - - /// - /// Queries whether the Type is string - /// - /// - /// the subject - /// - /// - /// true if it maps, false if not - /// - public static bool QueryIsString(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (eAttribute.EType is EEnum) - { - return false; - } - - if (eAttribute.EType.Name == "String") - { - return true; - } - } - - return false; - } - - /// - /// Queries whether the is a scalar - /// - /// - /// The subject - /// - /// - /// true if and = 1, false if not - /// - public static bool QueryIsScalar(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature.QueryIsString() && eStructuralFeature.UpperBound == 1) - { - return true; - } - - return eStructuralFeature.LowerBound == 1 && eStructuralFeature.UpperBound == 1; - } - - /// - /// Queries whether the is has a default value - /// - /// - /// The subject - /// - /// - /// true when the contains a value - /// - public static string QueryDefaultValue(this EStructuralFeature eStructuralFeature) - { - if (eStructuralFeature is EAttribute eAttribute) - { - if (string.IsNullOrEmpty(eStructuralFeature.DefaultValueLiteral)) - { - throw new InvalidOperationException("the structural feature does not have a default value"); - } - - return eAttribute.EType is EEnum ? $"{eStructuralFeature.QueryCSharpTypeName()}.{eStructuralFeature.DefaultValueLiteral.CapitalizeFirstLetter()}" : eStructuralFeature.DefaultValueLiteral; - } - - throw new NotSupportedException(""); - } - - /// - /// Queries the documentation from the and - /// returns it as a string - /// - /// - /// - public static IEnumerable QueryDocumentation(this EModelElement eModelElement) - { - var annotation = eModelElement.EAnnotations.FirstOrDefault(x => x.Details.ContainsKey("documentation")); - if (annotation == null) - { - return Enumerable.Empty(); - } - - if (annotation.Details.TryGetValue("documentation", out var documentation)) - { - var unwantedTags = new List { "p", "code", "em", "tt" }; - - var result = documentation.RemoveUnwantedHtmlTags(unwantedTags).ReplaceLineEndings(""); - - var splitLines = result.SplitToLines(100); - - return splitLines; - } - - return Enumerable.Empty(); - } - - /// - /// Queries the documentation from the and - /// returns it as a string - /// - /// - /// - public static string QueryRawDocumentation(this EModelElement eModelElement) - { - var annotation = eModelElement.EAnnotations.FirstOrDefault(x => x.Details.ContainsKey("documentation")); - if (annotation == null) - { - return string.Empty; - } - - if (annotation.Details.TryGetValue("documentation", out var documentation)) - { - var unwantedTags = new List { "p", "code", "em", "tt" }; - - var result = documentation.RemoveUnwantedHtmlTags(unwantedTags).ReplaceLineEndings(""); - - return result; - } - - return string.Empty; - } - - /// - /// removes the specified html tags from the - /// - /// - /// the string from which the unwanted html tags are to be removed - /// - /// - /// list of unwanted html tags - /// - /// - /// a cleaned up string - /// - public static string RemoveUnwantedHtmlTags(this string html, List unwantedTags) - { - if (string.IsNullOrEmpty(html)) - { - return html; - } - - var document = new HtmlDocument(); - document.LoadHtml(html); - - HtmlNodeCollection tryGetNodes = document.DocumentNode.SelectNodes("./*|./text()"); - - if (tryGetNodes == null || tryGetNodes.Count == 0) - { - return html; - } - - var nodes = new Queue(tryGetNodes); - - while (nodes.Count > 0) - { - var node = nodes.Dequeue(); - var parentNode = node.ParentNode; - - var childNodes = node.SelectNodes("./*|./text()"); - - if (childNodes != null) - { - foreach (var child in childNodes) - { - nodes.Enqueue(child); - } - } - - if (unwantedTags.Any(tag => tag == node.Name)) - { - if (childNodes != null) - { - foreach (var child in childNodes) - { - parentNode.InsertBefore(child, node); - } - } - - parentNode.RemoveChild(node); - - } - } - - return document.DocumentNode.InnerHtml; - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGenerator.cs deleted file mode 100644 index ae31c3956..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalFactoryGenerator.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based DAL Factory code generator - /// - public class CoreDalFactoryGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateElementDalFactory(package, outputDirectory); - await this.GeneratePocoFactories(package, outputDirectory); - } - - /// - /// Generates the Dal ElementFactory class for the es in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateElementDalFactory(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-element-dal-factory"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedElementDalFactory = template(eClasses); - - generatedElementDalFactory = CodeCleanup(generatedElementDalFactory); - - var fileName = "ElementFactory.cs"; - - await Write(generatedElementDalFactory, outputDirectory, fileName); - } - - /// - /// Generates the Dal PocoFactory classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GeneratePocoFactories(EPackage package, DirectoryInfo outputDirectory) - { - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - foreach (var eClass in eClasses) - { - await this.GeneratePocoFactory(package,outputDirectory, eClass.Name); - } - } - - /// - /// Generates the Dal PocoFactory class for the in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// name of tha that is to be generated. - /// - /// - /// string containing the generated code - /// - public async Task GeneratePocoFactory(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-poco-dal-factory"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - var generatedPocoFactory= template(eClass); - - generatedPocoFactory = CodeCleanup(generatedPocoFactory); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}Factory.cs"; - - await Write(generatedPocoFactory, outputDirectory, fileName); - - return generatedPocoFactory; - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-element-dal-factory"); - this.RegisterTemplate("core-poco-dal-factory"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGenerator.cs deleted file mode 100644 index e3b7894c4..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDalPocoExtensionsGenerator.cs +++ /dev/null @@ -1,161 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based DAL POCO Extensions code generator - /// - public class CoreDalPocoExtensionsGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static poco extensions for the DAL library - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateElementExtensions(package, outputDirectory); - await this.GenerateDalPocoExtensions(package, outputDirectory); - } - - /// - /// Generates the DAL.ElementExtensions class/> - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateElementExtensions(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dal-element-extensions"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedElementExtensions = template(eClasses); - - generatedElementExtensions = CodeCleanup(generatedElementExtensions); - - var fileName = "ElementExtensions.cs"; - - await Write(generatedElementExtensions, outputDirectory, fileName); - } - - /// - /// Generates the Dal PocoFactory classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDalPocoExtensions(EPackage package, DirectoryInfo outputDirectory) - { - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - foreach (var eClass in eClasses) - { - await this.GenerateDalPocoExtension(package, outputDirectory, eClass.Name); - } - } - - /// - /// Generates the Dal PocoFactory class for the in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// name of tha that is to be generated. - /// - /// - /// string containing the generated code - /// - public async Task GenerateDalPocoExtension(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-dal-poco-extensions"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - var generatedPocoExtensions = template(eClass); - - generatedPocoExtensions = CodeCleanup(generatedPocoExtensions); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}Extensions.cs"; - - await Write(generatedPocoExtensions, outputDirectory, fileName); - - return generatedPocoExtensions; - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-dal-element-extensions"); - this.RegisterTemplate("core-dal-poco-extensions"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGenerator.cs deleted file mode 100644 index 88999c1ce..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryReaderGenerator.cs +++ /dev/null @@ -1,164 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based Dictionary reader code generator - /// - public class CoreDtoDictionaryReaderGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateDtoDictionaryReaders(package, outputDirectory); - await this.GenerateDtoDictionaryReaderProvider(package, outputDirectory); - } - - /// - /// Generates the DeSerializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDtoDictionaryReaders(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dictionary-dto-serializer-reader-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DictionaryReader.cs"; - - await Write(generatedDeSerializer, outputDirectory, fileName); - } - } - - /// - /// Generates the DictionaryReader for the specified class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The name of the that needs to be generated - /// - /// - /// generated code - /// - public async Task GenerateDtoDictionaryReader(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-dictionary-dto-serializer-reader-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - var generateDtoDictionaryReader = template(eClass); - - generateDtoDictionaryReader = CodeCleanup(generateDtoDictionaryReader); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DictionaryReader.cs"; - - await Write(generateDtoDictionaryReader, outputDirectory, fileName); - - return generateDtoDictionaryReader; - } - - /// - /// Generates the SerializationProvider class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDtoDictionaryReaderProvider(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dictionary-dto-serializer-reader-provider-template"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedSerializationProvider = template(eClasses); - - generatedSerializationProvider = CodeCleanup(generatedSerializationProvider); - - var fileName = "DictionaryReaderProvider.cs"; - - await Write(generatedSerializationProvider, outputDirectory, fileName); - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-dictionary-dto-serializer-reader-template"); - this.RegisterTemplate("core-dictionary-dto-serializer-reader-provider-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGenerator.cs deleted file mode 100644 index 97a407a6a..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoDictionaryWriterGenerator.cs +++ /dev/null @@ -1,164 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based Dictionary writer code generator - /// - public class CoreDtoDictionaryWriterGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateDtoDictionaryWriters(package, outputDirectory); - await this.GenerateDtoDictionaryWriterProvider(package, outputDirectory); - } - - /// - /// Generates the DeSerializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDtoDictionaryWriters(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dictionary-dto-serializer-writer-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DictionaryWriter.cs"; - - await Write(generatedDeSerializer, outputDirectory, fileName); - } - } - - /// - /// Generates the DictionaryWriter for the specified class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The name of the that needs to be generated - /// - /// - /// generated code - /// - public async Task GenerateDtoDictionaryWriter(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-dictionary-dto-serializer-writer-template"]; - - var eClass = package.EClassifiers.OfType().Single(x =>x.Name == className); - - var generatedDictionaryWriter = template(eClass); - - generatedDictionaryWriter = CodeCleanup(generatedDictionaryWriter); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DictionaryWriter.cs"; - - await Write(generatedDictionaryWriter, outputDirectory, fileName); - - return generatedDictionaryWriter; - } - - /// - /// Generates the SerializationProvider class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDtoDictionaryWriterProvider(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dictionary-dto-serializer-writer-provider-template"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedSerializationProvider = template(eClasses); - - generatedSerializationProvider = CodeCleanup(generatedSerializationProvider); - - var fileName = "DictionaryWriterProvider.cs"; - - await Write(generatedSerializationProvider, outputDirectory, fileName); - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-dictionary-dto-serializer-writer-template"); - this.RegisterTemplate("core-dictionary-dto-serializer-writer-provider-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoGenerator.cs deleted file mode 100644 index fc913868c..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreDtoGenerator.cs +++ /dev/null @@ -1,207 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System; - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based DTO code generator - /// - public class CoreDtoGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the instances - /// that are in the provided - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateInterfaces(package, outputDirectory); - await this.GenerateClasses(package, outputDirectory); - } - - /// - /// Generates all the interfaces for instances n the - /// - /// - /// The that contains the instances - /// - /// - /// The directory where the output is to be generated - /// - /// - /// an awaitable - /// - public async Task GenerateInterfaces(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dto-interface-template"]; - - foreach (var eClass in package.EClassifiers.OfType()) - { - var generatedInterface = template(eClass); - - generatedInterface = CodeCleanup(generatedInterface); - - var fileName = $"I{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedInterface, outputDirectory, fileName); - } - } - - /// - /// Generates the interface C# class file using the name of the class - /// - /// - /// The that contains the instances - /// - /// - /// The directory where the output is to be generated - /// - /// - /// The name of the class for which the interface is to be generated - /// - /// - /// an awaitable - /// - public async Task GenerateInterface(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-dto-interface-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - var generatedInterface = template(eClass); - - generatedInterface = CodeCleanup(generatedInterface); - - var fileName = $"I{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedInterface, outputDirectory, fileName); - - return generatedInterface; - } - - /// - /// Generates all the classes for instances n the - /// - /// - /// The that contains the instances - /// - /// - /// The directory where the output is to be generated - /// - /// - /// an awaitable - /// - public async Task GenerateClasses(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-dto-class-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedClass = template(eClass); - - generatedClass = CodeCleanup(generatedClass); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedClass, outputDirectory, fileName); - } - } - - /// - /// Generates the C# class file using the name of the - /// - /// - /// The that contains the instances - /// - /// - /// The directory where the output is to be generated - /// - /// - /// The name of the class for which the interface is to be generated - /// - /// - /// an awaitable - /// - public async Task GenerateClass(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-dto-class-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - if (eClass.Abstract) - { - throw new InvalidOperationException("DTO should not be abstract"); - } - - var generatedClass = template(eClass); - - generatedClass = CodeCleanup(generatedClass); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedClass, outputDirectory, fileName); - - return generatedClass; - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.BooleanHelper.RegisterBooleanHelper(this.Handlebars); - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-dto-interface-template"); - this.RegisterTemplate("core-dto-class-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreEnumGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreEnumGenerator.cs deleted file mode 100644 index 72497cdd4..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreEnumGenerator.cs +++ /dev/null @@ -1,82 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.IO; - using System.Linq; - using System.Threading.Tasks; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based enum code generator - /// - public class CoreEnumGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the instances - /// that are in the provided - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-enum-template"]; - - foreach (var eEnum in package.EClassifiers.OfType()) - { - var generatedEnum = template(eEnum); - - generatedEnum = CodeCleanup(generatedEnum); - - var fileName = $"{eEnum.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedEnum, outputDirectory, fileName); - } - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - this.Handlebars.RegisteredDocumentationHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-enum-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGenerator.cs deleted file mode 100644 index 3818758fd..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreGraphQLSchemaGenerator.cs +++ /dev/null @@ -1,106 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based GraphQL Schema generator - /// - public class CoreGraphQLSchemaGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateGraphDbSchema(package, outputDirectory); - } - - /// - /// Generates the DeSerializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateGraphDbSchema(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-ogm-graphql-schema"]; - - var enums = package.EClassifiers.OfType().OrderBy(x => x.Name); - var dataTypes = package.EClassifiers.OfType().OrderBy(x => x.Name); - var eClasses = package.EClassifiers.OfType().OrderBy(x => x.Name); - - var payload = new GeneratorPayload(enums, dataTypes, eClasses); - - var generatedGraphQL = template(payload); - - var fileName = "schema.graphql"; - - await Write(generatedGraphQL, outputDirectory, fileName); - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-ogm-graphql-schema"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGenerator.cs deleted file mode 100644 index e0cb43767..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoDeSerializerGenerator.cs +++ /dev/null @@ -1,193 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - using System; - using System.IO; - using System.Linq; - using System.Threading.Tasks; - - /// - /// A Handlebars based DTO JSON deserializer code generator - /// - public class CoreJsonDtoDeSerializerGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateEnumDeSerializers(package, outputDirectory); - await this.GenerateDtoDeSerializers(package, outputDirectory); - await this.GenerateDeSerializationProvider(package, outputDirectory); - } - - /// - /// Generates the DeSerializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateEnumDeSerializers(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-json-enum-deserializer-template"]; - - foreach (var eClass in package.EClassifiers.OfType()) - { - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DeSerializer.cs"; - - await Write(generatedDeSerializer, outputDirectory, fileName); - } - } - - /// - /// Generates the DeSerializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDtoDeSerializers(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-json-dto-deserializer-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}DeSerializer.cs"; - - await Write(generatedDeSerializer, outputDirectory, fileName); - } - } - - /// - /// Generates a named Json Deserializer class - /// - /// - /// the that contains the to generate - /// - /// - /// The name of the class that is to be generated - /// - /// - /// a string representation of the generated class - /// - public string GenerateClass(EPackage package, string className) - { - var template = this.Templates["core-json-dto-deserializer-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - if (eClass.Abstract) - { - throw new InvalidOperationException("Json Deserializer should not be abstract"); - } - - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - return generatedDeSerializer; - } - - /// - /// Generates the DeSerializationProvider class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateDeSerializationProvider(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-json-dto-deserialization-provider-template"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedDeSerializationProvider = template(eClasses); - - generatedDeSerializationProvider = CodeCleanup(generatedDeSerializationProvider); - - var fileName = "DeSerializationProvider.cs"; - - await Write(generatedDeSerializationProvider, outputDirectory, fileName); - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-json-enum-deserializer-template"); - this.RegisterTemplate("core-json-dto-deserializer-template"); - this.RegisterTemplate("core-json-dto-deserialization-provider-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGenerator.cs deleted file mode 100644 index 9ae084c14..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CoreJsonDtoSerializerGenerator.cs +++ /dev/null @@ -1,163 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using ECoreNetto; - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - using System; - using System.IO; - using System.Linq; - using System.Threading.Tasks; - - /// - /// A Handlebars based DTO JSON serializer code generator - /// - public class CoreJsonDtoSerializerGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the static serializers - /// for each - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateSerializers(package, outputDirectory); - await this.GenerateSerializationProvider(package, outputDirectory); - } - - /// - /// Generates the Serializer classes for each in the provided - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateSerializers(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-json-dto-serializer-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedSerializer = template(eClass); - - generatedSerializer = CodeCleanup(generatedSerializer); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}Serializer.cs"; - - await Write(generatedSerializer, outputDirectory, fileName); - } - } - - /// - /// Generates a named Json Serializer class - /// - /// - /// the that contains the to generate - /// - /// - /// The name of the class that is to be generated - /// - /// - /// a string representation of the generated class - /// - public string GenerateClass(EPackage package, string className) - { - var template = this.Templates["core-json-dto-serializer-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - if (eClass.Abstract) - { - throw new InvalidOperationException("Json Serializer should not be abstract"); - } - - var generatedDeSerializer = template(eClass); - - generatedDeSerializer = CodeCleanup(generatedDeSerializer); - - return generatedDeSerializer; - } - - /// - /// Generates the SerializationProvider class - /// - /// - /// the that contains the classes that need to be generated - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public async Task GenerateSerializationProvider(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-json-dto-serialization-provider-template"]; - - var eClasses = package.EClassifiers.OfType().Where(x => !x.Abstract).OrderBy(x => x.Name).ToList(); - - var generatedSerializationProvider = template(eClasses); - - generatedSerializationProvider = CodeCleanup(generatedSerializationProvider); - - var fileName = "SerializationProvider.cs"; - - await Write(generatedSerializationProvider, outputDirectory, fileName); - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-json-dto-serializer-template"); - this.RegisterTemplate("core-json-dto-serialization-provider-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CorePocoGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CorePocoGenerator.cs deleted file mode 100644 index f17b3bd45..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/CorePocoGenerator.cs +++ /dev/null @@ -1,201 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System; - using System.Linq; - using System.Threading.Tasks; - - using System.IO; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Extensions; - using SysML2.NET.CodeGenerator.HandleBarHelpers; - - /// - /// A Handlebars based POCO code generator - /// - public class CorePocoGenerator : EcoreHandleBarsGenerator - { - /// - /// Generates the POCO instances - /// that are in the provided - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public override async Task Generate(EPackage package, DirectoryInfo outputDirectory) - { - await this.GenerateInterfaces(package, outputDirectory); - await this.GenerateClasses(package, outputDirectory); - } - - /// - /// Generates POCO interfaces - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable task - /// - public async Task GenerateInterfaces(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-poco-interface-template"]; - - foreach (var eClass in package.EClassifiers.OfType()) - { - var generatedInterface = template(eClass); - - generatedInterface = CodeCleanup(generatedInterface); - - var fileName = $"I{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedInterface, outputDirectory, fileName); - } - } - - /// - /// Generates POCO interfaces - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable task - /// - public async Task GenerateInterface(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-poco-interface-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - var generatedInterface = template(eClass); - - generatedInterface = CodeCleanup(generatedInterface); - - var fileName = $"I{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedInterface, outputDirectory, fileName); - - return generatedInterface; - } - - /// - /// Generates POCO classes - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable task - /// - public async Task GenerateClasses(EPackage package, DirectoryInfo outputDirectory) - { - var template = this.Templates["core-poco-class-template"]; - - foreach (var eClass in package.EClassifiers.OfType().Where(x => !x.Abstract)) - { - var generatedCode = template(eClass); - - generatedCode = CodeCleanup(generatedCode); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedCode, outputDirectory, fileName); - } - } - - /// - /// Generates a named POCO class - /// - /// - /// the that contains the to generate - /// - /// - /// The target - /// - /// - /// an awaitable task - /// - public async Task GenerateClass(EPackage package, DirectoryInfo outputDirectory, string className) - { - var template = this.Templates["core-poco-class-template"]; - - var eClass = package.EClassifiers.OfType().Single(x => x.Name == className); - - if (eClass.Abstract) - { - throw new InvalidOperationException("POCO should not be abstract"); - } - - var generatedCode = template(eClass); - - generatedCode = CodeCleanup(generatedCode); - - var fileName = $"{eClass.Name.CapitalizeFirstLetter()}.cs"; - - await Write(generatedCode, outputDirectory, fileName); - - return generatedCode; - } - - /// - /// Register the custom helpers - /// - protected override void RegisterHelpers() - { - ECoreNetto.HandleBars.BooleanHelper.RegisterBooleanHelper(this.Handlebars); - ECoreNetto.HandleBars.StringHelper.RegisterStringHelper(this.Handlebars); - ECoreNetto.HandleBars.StructuralFeatureHelper.RegisterStructuralFeatureHelper(this.Handlebars); - ECoreNetto.HandleBars.GeneralizationHelper.RegisterGeneralizationHelper(this.Handlebars); - - this.Handlebars.RegisteredDocumentationHelper(); - this.Handlebars.RegisterTypeNameHelper(); - this.Handlebars.RegisterStructuralFeatureHelper(); - } - - /// - /// Register the code templates - /// - protected override void RegisterTemplates() - { - this.RegisterTemplate("core-poco-interface-template"); - this.RegisterTemplate("core-poco-class-template"); - } - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/EcoreHandleBarsGenerator.cs b/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/EcoreHandleBarsGenerator.cs deleted file mode 100644 index d2133579c..000000000 --- a/SysML2.NET.CodeGenerator/Generators/EcoreHandleBarsGenerators/EcoreHandleBarsGenerator.cs +++ /dev/null @@ -1,59 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators.HandleBarsGenerators -{ - using System.IO; - using System.Threading.Tasks; - - using ECoreNetto; - - using SysML2.NET.CodeGenerator.Generators; - - /// - /// Abstract super class from which all ecore based generators - /// need to derive - /// - public abstract class EcoreHandleBarsGenerator : HandleBarsGenerator - { - /// - /// Gets an optional subfolder location path to locate templates - /// - /// An optional subfolder name - protected override string GetOptionalSubfolderTemplateLocation() - { - return "ecore"; - } - - /// - /// Generates code specific to the concrete implementation - /// - /// - /// the that contains the Ecore data to generate from - /// - /// - /// The target - /// - /// - /// an awaitable - /// - public abstract Task Generate(EPackage package, DirectoryInfo outputDirectory); - } -} diff --git a/SysML2.NET.CodeGenerator/Generators/GeneratorPayload.cs b/SysML2.NET.CodeGenerator/Generators/GeneratorPayload.cs deleted file mode 100644 index aa2ffd867..000000000 --- a/SysML2.NET.CodeGenerator/Generators/GeneratorPayload.cs +++ /dev/null @@ -1,68 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.Generators -{ - using System.Collections.Generic; - using System.Linq; - - using ECoreNetto; - - /// - /// represents the payload for the generators that require all , - /// and - /// - public class GeneratorPayload - { - /// - /// initializes an instance of the class. - /// - /// - /// the s in the data model - /// - /// - /// the s in the data model - /// - /// - /// the es in the data model - /// - public GeneratorPayload(IEnumerable enums, IEnumerable dataTypes, IEnumerable classes) - { - this.Enums = enums.ToArray(); - this.DataTypes = dataTypes.ToArray(); - this.Classes = classes.ToArray(); - } - - /// - /// Gets the array of - /// - public EEnum[] Enums { get; private set; } - - /// - /// Gets the array of - /// - public EDataType[] DataTypes { get; private set; } - - /// - /// Gets the array of - /// - public EClass[] Classes { get; private set; } - } -} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/DocumentationHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/DocumentationHelper.cs deleted file mode 100644 index bf0ca3386..000000000 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/DocumentationHelper.cs +++ /dev/null @@ -1,66 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.HandleBarHelpers -{ - using System; - - using ECoreNetto; - - using HandlebarsDotNet; - - using SysML2.NET.CodeGenerator.Extensions; - - /// - /// a block helper - /// - public static class DocumentationHelper - { - /// - /// Registers the - /// - /// - /// The context with which the helper needs to be registered - /// - public static void RegisteredDocumentationHelper(this IHandlebars handlebars) - { - handlebars.RegisterHelper("Documentation", (writer, context, parameters) => - { - if (!(context.Value is EModelElement eModelElement)) - throw new ArgumentException("supposed to be EModelElement"); - - writer.WriteSafeString($"/// {Environment.NewLine}"); - foreach (var line in eModelElement.QueryDocumentation()) - { - writer.WriteSafeString($"/// {line}{Environment.NewLine}"); - } - writer.WriteSafeString($"/// {Environment.NewLine}"); - }); - - handlebars.RegisterHelper("RawDocumentation", (writer, context, parameters) => - { - if (!(context.Value is EModelElement eModelElement)) - throw new ArgumentException("supposed to be EModelElement"); - - writer.WriteSafeString(eModelElement.QueryRawDocumentation()); - }); - } - } -} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/StructuralFeatureHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/StructuralFeatureHelper.cs deleted file mode 100644 index 590c153a7..000000000 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/StructuralFeatureHelper.cs +++ /dev/null @@ -1,171 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.HandleBarHelpers -{ - using System; - using System.Linq; - - using ECoreNetto; - using ECoreNetto.Extensions; - - using HandlebarsDotNet; - - using SysML2.NET.CodeGenerator.Extensions; - - /// - /// A handlebars block helper - /// - public static class StructuralFeatureHelper - { - /// - /// Registers the - /// - /// - /// The context with which the helper needs to be registered - /// - public static void RegisterStructuralFeatureHelper(this IHandlebars handlebars) - { - handlebars.RegisterHelper("StructuralFeature.QueryIsNullable", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsNullable}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsNullable(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsScalar", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsScalar}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsScalar(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsBool", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsBool}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsBool(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsNumeric", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsNumeric}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsNumeric(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsInteger", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsInteger}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsInt(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsDouble", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsDouble}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsDouble(); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsString", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsString}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - return eStructuralFeature.QueryIsString(); - }); - - handlebars.RegisterHelper("StructuralFeature.DefaultValue", (writer, context, parameters) => - { - if (!(context.Value is EStructuralFeature eStructuralFeature)) - throw new ArgumentException("supposed to be EStructuralFeature"); - - var defaultValue = eStructuralFeature.QueryDefaultValue(); - - writer.WriteSafeString($"{defaultValue}"); - }); - - handlebars.RegisterHelper("StructuralFeature.TypeName", (writer, context, parameters) => - { - if (!(context.Value is EStructuralFeature eStructuralFeature)) - throw new ArgumentException("supposed to be EStructuralFeature"); - - var typeName = eStructuralFeature.QueryCSharpTypeName(); - - writer.WriteSafeString($"{typeName}"); - }); - - handlebars.RegisterHelper("StructuralFeature.QueryIsAbstract", (context, arguments) => - { - if (arguments.Length != 1) - { - throw new HandlebarsException("{{#StructuralFeature.QueryIsAbstract}} helper must have exactly one argument"); - } - - var eStructuralFeature = arguments.Single() as EStructuralFeature; - - if (eStructuralFeature is EReference eReference) - { - var @class = eReference.QueryClass(); - - return @class.Abstract; - } - - return false; - - }); - } - } -} diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/TypeNameHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/TypeNameHelper.cs deleted file mode 100644 index 3b674ab98..000000000 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/TypeNameHelper.cs +++ /dev/null @@ -1,202 +0,0 @@ -// ------------------------------------------------------------------------------------------------- -// -// -// Copyright 2022-2025 Starion Group S.A. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// -// ------------------------------------------------------------------------------------------------ - -namespace SysML2.NET.CodeGenerator.HandleBarHelpers -{ - using System; - using System.Linq; - - using ECoreNetto; - using ECoreNetto.Extensions; - - using HandlebarsDotNet; - - using SysML2.NET.CodeGenerator.Extensions; - - /// - /// A block helper that prints the name of the type of a - /// - public static class TypeNameHelper - { - /// - /// Registers the - /// - /// - /// The context with which the helper needs to be registered - /// - public static void RegisterTypeNameHelper(this IHandlebars handlebars) - { - handlebars.RegisterHelper("DTO.TypeName", (writer, context, parameters) => - { - if (!(context.Value is EStructuralFeature eStructuralFeature)) - throw new ArgumentException("DTO.TypeName - supposed to be EStructuralFeature"); - - var typeName = eStructuralFeature.QueryCSharpTypeName(); - - var nullable = eStructuralFeature.QueryIsNullable(); - - var enumerable = eStructuralFeature.QueryIsEnumerable(); - - if (eStructuralFeature is EAttribute) - { - if (enumerable) - { - writer.WriteSafeString($"List<{typeName}>"); - } - else if (typeName != "string" && nullable) - { - writer.WriteSafeString($"{typeName}?"); - } - else - { - writer.WriteSafeString($"{typeName}"); - } - } - else if (eStructuralFeature is EReference) - { - if (enumerable) - { - writer.WriteSafeString($"List"); - } - else if (nullable) - { - writer.WriteSafeString($"Guid?"); - } - else - { - writer.WriteSafeString($"Guid"); - } - } - }); - - handlebars.RegisterHelper("POCO.TypeName", (writer, context, parameters) => - { - if (!(context.Value is EStructuralFeature eStructuralFeature)) - throw new ArgumentException("POCO.TypeName - supposed to be EStructuralFeature"); - - var typeName = eStructuralFeature.QueryCSharpTypeName(); - - var nullable = eStructuralFeature.QueryIsNullable(); - - var enumerable = eStructuralFeature.QueryIsEnumerable(); - - if (eStructuralFeature is EAttribute) - { - if (enumerable) - { - writer.WriteSafeString($"List<{typeName}>"); - } - else if (typeName != "string" && nullable) - { - writer.WriteSafeString($"{typeName}?"); - } - else - { - writer.WriteSafeString($"{typeName}"); - } - } - else if (eStructuralFeature is EReference) - { - var @class = eStructuralFeature.QueryClass(); - - if (@class.Abstract) - { - typeName = $"I{typeName}"; - } - - if (enumerable) - { - writer.WriteSafeString($"List<{typeName}>"); - } - else - { - writer.WriteSafeString($"{typeName}"); - } - } - }); - - handlebars.RegisterHelper("GRAPHQL.TypeName", (writer, context, parameters) => - { - if (!(context.Value is EStructuralFeature eStructuralFeature)) - throw new ArgumentException("GRAPHQL.TypeName - supposed to be EStructuralFeature"); - - var typeName = eStructuralFeature.QueryGraphQLTypeName(); - - var nullable = eStructuralFeature.QueryIsNullable(); - - var enumerable = eStructuralFeature.QueryIsEnumerable(); - - if (eStructuralFeature is EAttribute) - { - if (enumerable) - { - writer.WriteSafeString($"[{typeName}]!"); - } - else if (nullable) - { - writer.WriteSafeString($"{typeName}"); - } - else - { - writer.WriteSafeString($"{typeName}!"); - } - } - else if (eStructuralFeature is EReference) - { - typeName = $"I{typeName}"; - - if (enumerable) - { - writer.WriteSafeString($"[{typeName}]!"); - } - else if (nullable) - { - writer.WriteSafeString($"{typeName}"); - } - else - { - writer.WriteSafeString($"{typeName}!"); - } - } - }); - - handlebars.RegisterHelper("GRAPHQL.Implements", (writer, context, parameters) => - { - if (!(context.Value is EClass eClass)) - throw new ArgumentException("GRAPHQL.Implements - The context shall be an EClass"); - - var typeHierarchy = eClass.QueryTypeHierarchy().Distinct(); - - if (typeHierarchy.Any()) - { - var result = $"implements I{eClass.Name} & {string.Join(" & ", typeHierarchy.Select(x => $"I{x.Name}"))}"; - - writer.WriteSafeString(result); - } - else - { - var result = $"implements I{eClass.Name}"; - - writer.WriteSafeString(result); - } - }); - } - } -} diff --git a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj index 5e53a4ccb..cf766052a 100644 --- a/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj +++ b/SysML2.NET.CodeGenerator/SysML2.NET.CodeGenerator.csproj @@ -21,8 +21,7 @@ - - +