diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs index 1131d1c74..b740efa49 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs @@ -114,6 +114,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -475,10 +476,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -596,6 +599,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -720,10 +724,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AssociationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AssociationDeSerializer.cs index 11b80f685..5af9b69b7 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AssociationDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/AssociationDeSerializer.cs @@ -147,6 +147,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var unioningTypeSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1079,10 +1086,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Association {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Association {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1337,6 +1400,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1535,10 +1599,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/DependencyDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/DependencyDeSerializer.cs index c50d591ee..5fa8b592b 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/DependencyDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/DependencyDeSerializer.cs @@ -116,6 +116,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var supplierSeen = false; var textualRepresentationSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -508,10 +515,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!supplierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Dependency {Id} disagrees with supplier; the supplier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!clientSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Dependency {Id} disagrees with client; the client value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -642,6 +705,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var supplierSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -850,10 +920,66 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!supplierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Dependency {Id} disagrees with supplier; the supplier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!clientSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Dependency {Id} disagrees with client; the client value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs index 3d3d01d03..6077bfe63 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs @@ -173,6 +173,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var variantMembershipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1575,10 +1576,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1935,6 +1938,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2098,10 +2102,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureDeSerializer.cs index 0bdcc164e..cc3b15435 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureDeSerializer.cs @@ -165,6 +165,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1378,10 +1379,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1714,6 +1717,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1978,10 +1982,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs index 464bde2ed..b7cab075b 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs @@ -117,6 +117,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var typedFeatureSeen = false; + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -534,10 +547,112 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (generalRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -672,6 +787,19 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var typedFeatureSeen = false; + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -888,10 +1016,112 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (generalRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FlowDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FlowDeSerializer.cs index 619a9b0d7..beff247e6 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FlowDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FlowDeSerializer.cs @@ -177,6 +177,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var unioningTypeSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1595,10 +1602,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Flow {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Flow {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1982,6 +2045,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2294,10 +2358,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs index 8403837d0..57642c469 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs @@ -122,6 +122,22 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var visibilitySeen = false; + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -599,10 +615,129 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the FramedConcernMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedConcernSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the FramedConcernMembership {Id} disagrees with ownedConcern; the ownedConcern value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the FramedConcernMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedConcernSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FramedConcernMembership {Id} disagrees with ownedConcern; the ownedConcern value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FramedConcernMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -757,6 +892,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var visibilitySeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -949,10 +1085,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs index 268727968..28f463802 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs @@ -169,6 +169,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var valueSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1444,10 +1445,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1797,6 +1800,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var valueSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2071,10 +2075,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs index fdee94b79..de48a1735 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs @@ -169,6 +169,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var valueSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1444,10 +1445,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1797,6 +1800,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var valueSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2071,10 +2075,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MembershipDeSerializer.cs index 0cd4b4a6f..1e092f16b 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MembershipDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MembershipDeSerializer.cs @@ -120,6 +120,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var visibilitySeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -565,10 +572,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!memberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Membership {Id} disagrees with memberElement; the memberElement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Membership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -717,6 +780,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var visibilitySeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -941,10 +1008,39 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!memberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Membership {Id} disagrees with memberElement; the memberElement value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs index b935b1ed0..4758e8227 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs @@ -168,6 +168,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var upperBoundSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1438,10 +1439,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1786,6 +1789,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2050,10 +2054,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs index e38d2656c..c7d44c3d9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs @@ -120,6 +120,22 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var visibilitySeen = false; + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -565,10 +581,129 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the OwningMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the OwningMembership {Id} disagrees with ownedMemberElement; the ownedMemberElement value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the OwningMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the OwningMembership {Id} disagrees with ownedMemberElement; the ownedMemberElement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the OwningMembership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -714,6 +849,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var visibilitySeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -896,10 +1032,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs index 046041b64..516b8e711 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs @@ -116,6 +116,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var subsettingFeatureRedefinitionSeen = false; + Guid? subsettingFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -516,10 +535,158 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("subsettingFeature"u8)) + { + subsettingFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettingFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (subsettedFeatureRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (subsettingFeatureRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature = (subsettingFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature != (subsettingFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettingFeature Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -649,6 +816,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var referencedFeatureSeen = false; + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -843,10 +1020,85 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (subsettedFeatureRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs index aabfb2e15..003e86f24 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs @@ -213,6 +213,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2268,10 +2275,52 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); reader.Skip(); } + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the RequirementUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) @@ -2798,6 +2847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var portionKindSeen = false; var reqIdSeen = false; + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -3085,10 +3138,32 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); reader.Skip(); } + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs index 5312eca53..071388bc4 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs @@ -171,6 +171,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1491,10 +1492,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1852,6 +1855,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2131,10 +2135,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs index ce30bee27..b845e1b0a 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs @@ -117,6 +117,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var superclassifierSeen = false; var textualRepresentationSeen = false; + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -534,10 +547,112 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (generalRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -672,6 +787,19 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var subclassifierSeen = false; var superclassifierSeen = false; + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -888,10 +1016,112 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (generalRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs index ce31101b5..106d3c4ff 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs @@ -116,6 +116,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -511,10 +512,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -642,6 +645,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -796,10 +800,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/UsageDeSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/UsageDeSerializer.cs index aa34c4b9f..1e1075dbb 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/UsageDeSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDeSerializer/UsageDeSerializer.cs @@ -200,6 +200,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2031,10 +2035,32 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); reader.Skip(); } + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the Usage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -2507,6 +2533,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2771,10 +2798,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Association.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Association.cs index cf6e50047..2ff6669a1 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Association.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Association.cs @@ -523,12 +523,15 @@ public partial class Association : IAssociation /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -545,12 +548,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Flow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Flow.cs index ae51b33c3..7409321d9 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Flow.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Flow.cs @@ -804,12 +804,15 @@ public partial class Flow : IFlow /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -834,12 +837,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/FramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/FramedConcernMembership.cs index 0a53c88e4..d3f0872b7 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/FramedConcernMembership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/FramedConcernMembership.cs @@ -132,12 +132,15 @@ RequirementConstraintKind IRequirementConstraintMembership.Kind /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedConcern = value; + } } /// @@ -152,12 +155,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -175,12 +181,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -395,12 +404,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -408,7 +420,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Membership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Membership.cs index 1b97d2f91..7c7f7f8cb 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Membership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Membership.cs @@ -269,12 +269,15 @@ public partial class Membership : IMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/OwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/OwningMembership.cs index d70675679..40bf812c1 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/OwningMembership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/OwningMembership.cs @@ -108,12 +108,15 @@ public partial class OwningMembership : IOwningMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid IMembership.MemberElement { get => this.ownedMemberElement; - set { } + set + { + this.ownedMemberElement = value; + } } /// @@ -128,12 +131,15 @@ Guid IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -150,12 +156,15 @@ string IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -313,12 +322,15 @@ string IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -326,7 +338,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/ReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/ReferenceSubsetting.cs index 944b2f100..fe84b90a3 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/ReferenceSubsetting.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/ReferenceSubsetting.cs @@ -280,7 +280,7 @@ Guid Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -300,7 +300,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] Guid Core.Types.ISpecialization.Specific { @@ -332,12 +332,15 @@ Guid ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature")] + [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] Guid ISubsetting.SubsettingFeature { get => this.referencingFeature; - set { } + set + { + this.referencingFeature = value; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/RequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/RequirementUsage.cs index f01b48a30..9b94a4b00 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/RequirementUsage.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/RequirementUsage.cs @@ -455,12 +455,15 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Usage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Usage.cs index 7c7b305f3..1d7eff71f 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Usage.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDto/Usage.cs @@ -368,12 +368,15 @@ public partial class Usage : IUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs index 1880e9501..ef4486004 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/DependencyComparer.cs @@ -93,8 +93,12 @@ public bool Equals(IDependency x, IDependency y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Supplier, y.Supplier)) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs index 09f136aa0..9ca785184 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/FeatureTypingComparer.cs @@ -79,6 +79,8 @@ public bool Equals(IFeatureTyping x, IFeatureTyping y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -91,6 +93,12 @@ public bool Equals(IFeatureTyping x, IFeatureTyping y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Type != y.Type) return false; if (x.TypedFeature != y.TypedFeature) return false; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs index 57d9ec70c..7959c4bb7 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/MembershipComparer.cs @@ -98,6 +98,8 @@ public bool Equals(IMembership x, IMembership y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs index 62bf98132..9dbc7af45 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs @@ -79,6 +79,8 @@ public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -93,6 +95,10 @@ public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) if (x.ReferencedFeature != y.ReferencedFeature) return false; + if (x.SubsettedFeature != y.SubsettedFeature) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs index a7751f143..81e5799c6 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/RequirementUsageComparer.cs @@ -77,6 +77,8 @@ public bool Equals(IRequirementUsage x, IRequirementUsage y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (x.Direction != y.Direction) return false; if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs index 7aad40ba9..f01236127 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenDtoComparers/SubclassificationComparer.cs @@ -79,6 +79,8 @@ public bool Equals(ISubclassification x, ISubclassification y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -91,10 +93,16 @@ public bool Equals(ISubclassification x, ISubclassification y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + if (x.Subclassifier != y.Subclassifier) return false; if (x.Superclassifier != y.Superclassifier) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs index b7342c501..725df3e16 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Association.cs @@ -558,7 +558,7 @@ public Association() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -580,7 +580,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs index 48990b603..7b10c3b2b 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Flow.cs @@ -841,7 +841,7 @@ public Flow() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -871,7 +871,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs index 817eb9687..4ef712ae8 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/FramedConcernMembership.cs @@ -155,7 +155,7 @@ RequirementConstraintKind IRequirementConstraintMembership.Kind /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -175,7 +175,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -198,7 +198,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -430,7 +430,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -443,7 +443,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs index b35edfaa6..e118011e2 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Membership.cs @@ -299,7 +299,7 @@ public Membership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs index d81d46a08..1e66c0cae 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/OwningMembership.cs @@ -127,7 +127,7 @@ public OwningMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement IMembership.MemberElement { @@ -147,7 +147,7 @@ IElement IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string IMembership.MemberName { @@ -169,7 +169,7 @@ string IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string IMembership.MemberShortName { @@ -344,7 +344,7 @@ string IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -357,7 +357,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs index b98740512..c772915f3 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/ReferenceSubsetting.cs @@ -316,7 +316,7 @@ IType Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -335,7 +335,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] IType Core.Types.ISpecialization.Specific { @@ -370,7 +370,7 @@ IFeature ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature")] + [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] IFeature ISubsetting.SubsettingFeature { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs index fd7787e9b..e78de3f86 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/RequirementUsage.cs @@ -498,7 +498,7 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs index c143830a2..19002ce50 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPoco/Usage.cs @@ -408,7 +408,7 @@ public Usage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs index 5eb9b064e..01291a4e1 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/DependencyExtensions.cs @@ -234,7 +234,9 @@ public static Core.DTO.Root.Dependencies.Dependency ToDto(this Core.POCO.Root.De dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); dto.Supplier = poco.Supplier.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs index 838cd2691..ee31eaa65 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs @@ -207,12 +207,16 @@ public static Core.DTO.Core.Features.FeatureTyping ToDto(this Core.POCO.Core.Fea dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Type = poco.Type.Id; dto.TypedFeature = poco.TypedFeature.Id; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs index 8c6a92fa6..584c7547a 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/MembershipExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Root.Namespaces.Membership ToDto(this Core.POCO.Root.Name dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs index c31b7495f..b44dc220c 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs @@ -198,6 +198,7 @@ public static Core.DTO.Core.Features.ReferenceSubsetting ToDto(this Core.POCO.Co dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)poco).General.Id; dto.IsImplied = poco.IsImplied; dto.IsImpliedIncluded = poco.IsImpliedIncluded; dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); @@ -205,6 +206,8 @@ public static Core.DTO.Core.Features.ReferenceSubsetting ToDto(this Core.POCO.Co dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; dto.ReferencedFeature = poco.ReferencedFeature.Id; + ((Core.DTO.Core.Features.ISubsetting)dto).SubsettedFeature = ((Core.POCO.Core.Features.ISubsetting)poco).SubsettedFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs index 539196a2f..603af8e9d 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs @@ -182,6 +182,7 @@ public static Core.DTO.Systems.Requirements.RequirementUsage ToDto(this Core.POC dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.Direction = poco.Direction; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs index dc1627574..49655cc09 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenPocoExtension/SubclassificationExtensions.cs @@ -207,14 +207,18 @@ public static Core.DTO.Core.Classifiers.Subclassification ToDto(this Core.POCO.C dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; dto.Subclassifier = poco.Subclassifier.Id; dto.Superclassifier = poco.Superclassifier.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/AssociationSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/AssociationSerializer.cs index 74b6ef03b..cbfb54d99 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/AssociationSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/AssociationSerializer.cs @@ -788,30 +788,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAssociation iAssoci 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(); - } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FlowSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FlowSerializer.cs index c80f3aeb6..2256d47f2 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FlowSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FlowSerializer.cs @@ -1172,30 +1172,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFlow iFlow, Utf8Jso 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(); - } } } diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs index 89600c030..c06ce1549 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs @@ -412,18 +412,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFramedConcernMember 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) @@ -476,30 +464,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFramedConcernMember 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()); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/MembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/MembershipSerializer.cs index cfff53a48..d6862e023 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/MembershipSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/MembershipSerializer.cs @@ -419,18 +419,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMembership iMembers 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) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/OwningMembershipSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/OwningMembershipSerializer.cs index 4ec54b36e..f064f03b0 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/OwningMembershipSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/OwningMembershipSerializer.cs @@ -370,18 +370,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IOwningMembership iO 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) @@ -434,30 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IOwningMembership iO 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()); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs index 743cebe11..4979d7cb1 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs @@ -459,36 +459,12 @@ private static void SerializeAsJsonWithoutDerivedProperties(IReferenceSubsetting 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) diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/RequirementUsageSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/RequirementUsageSerializer.cs index 149418ef4..d09e6730f 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/RequirementUsageSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/RequirementUsageSerializer.cs @@ -1502,9 +1502,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementUsage iR writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iRequirementUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iRequirementUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iRequirementUsage.IsVariation); diff --git a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/UsageSerializer.cs b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/UsageSerializer.cs index 84e3295d6..717971529 100644 --- a/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/UsageSerializer.cs +++ b/SysML2.NET.CodeGenerator.Tests/Expected/UML/Core/AutoGenSerializer/UsageSerializer.cs @@ -1292,9 +1292,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IUsage iUsage, Utf8J writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iUsage.IsVariation); diff --git a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs index fbfb9d1c6..d048afddc 100644 --- a/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs +++ b/SysML2.NET.CodeGenerator/Extensions/PropertyExtension.cs @@ -199,5 +199,62 @@ public static IEnumerable QueryOwnedConstraints(this IOperation ope return operation.OwnedRule; } + + /// The to inspect + extension(IProperty property) + { + /// + /// Queries whether the , redefined in the , is still serialized under its own name. + /// + /// The being generated + /// true when the property is non-derived and is redefined in the context by a property of another name + /// + /// KerML §10.4.5 serializes a redefined property when its name differs from the redefining one. + /// + public bool QueryIsSerializedRedefinition(IClass classContext) + { + return !property.IsDerived && !property.IsDerivedUnion + && property.TryQueryRedefinedByProperty(classContext, out var redefinition) + && redefinition.Name != property.Name; + } + + /// + /// Queries whether the is redefined in the by a chain that ends on a derived property. + /// + /// The being generated + /// true when the value of the is derived in the context + /// + /// A derived redefinition makes the redefined property derived, as SysML states for Usage::mayTimeVary over Feature::isVariable; + /// such a value is therefore neither computed nor exchanged without derived properties (KerML §10.3 Note 4). + /// + public bool QueryHasDerivedValueIn(IClass classContext) + { + if (!property.TryQueryRedefinedByProperty(classContext, out _)) + { + return false; + } + + var chainEnd = property.QueryRedefinitionChainEnd(classContext); + + return chainEnd.IsDerived || chainEnd.IsDerivedUnion; + } + + /// + /// Returns the property that ends the redefinition chain of the in the . + /// + /// The being generated + /// The last redefinition, or the itself when the context does not redefine it + public IProperty QueryRedefinitionChainEnd(IClass classContext) + { + var chainEnd = property; + + while (chainEnd.TryQueryRedefinedByProperty(classContext, out var redefinition)) + { + chainEnd = redefinition; + } + + return chainEnd; + } + } } } diff --git a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs index 7aecaebd0..e9de0176c 100644 --- a/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs +++ b/SysML2.NET.CodeGenerator/HandleBarHelpers/PropertyHelper.cs @@ -31,6 +31,21 @@ namespace SysML2.NET.CodeGenerator.HandleBarHelpers /// public static class PropertyHelper { + /// + /// The placeholder for the local holding a deserialized redefined value in a + /// + private const string ValuePlaceholder = "{value}"; + + /// + /// The placeholder for the left operand of a comparison + /// + private const string LeftPlaceholder = "{left}"; + + /// + /// The placeholder for the right operand of a comparison + /// + private const string RightPlaceholder = "{right}"; + /// /// Registers the /// @@ -812,6 +827,65 @@ public static void RegisterPropertyHelper(this IHandlebars handlebars) return property.TryQueryRedefinedByProperty(generatedClass, out _); }); + handlebars.RegisterHelper("Property.IsSerializedRedefinition", (_, arguments) => + { + if (arguments.Length != 2 || arguments[0] is not IProperty property || arguments[1] is not IClass generatedClass) + { + throw new ArgumentException("The #Property.IsSerializedRedefinition helper expects an IProperty and an IClass"); + } + + return property.QueryIsSerializedRedefinition(generatedClass); + }); + + handlebars.RegisterHelper("Property.WriteRedefinedByPropertyAttribute", (writer, _, arguments) => + { + if (arguments.Length != 2 || arguments[0] is not IProperty property || arguments[1] is not IClass generatedClass) + { + throw new HandlebarsException("{{#Property.WriteRedefinedByPropertyAttribute}} expects an IProperty and an IClass"); + } + + if (!property.TryQueryRedefinedByProperty(generatedClass, out var redefinition)) + { + return; + } + + var owner = (INamedElement)redefinition.Owner; + var isDerivedByRedefinition = !property.IsDerived && !property.IsDerivedUnion && property.QueryHasDerivedValueIn(generatedClass); + var derivedFlag = isDerivedByRedefinition ? ", IsDerivedByRedefinition = true" : string.Empty; + + writer.WriteSafeString($"[RedefinedByProperty(\"I{owner.Name}.{redefinition.Name.CapitalizeFirstLetter()}\"{derivedFlag})]"); + }); + + handlebars.RegisterHelper("Property.HasDerivedValueIn", (_, arguments) => + { + if (arguments.Length != 2 || arguments[0] is not IProperty property || arguments[1] is not IClass generatedClass) + { + throw new ArgumentException("The #Property.HasDerivedValueIn helper expects an IProperty and an IClass"); + } + + return property.QueryHasDerivedValueIn(generatedClass); + }); + + handlebars.RegisterHelper("Property.WriteRedefinedToDto", (writer, _, arguments) => + { + if (arguments.Length != 1 || arguments[0] is not IProperty property) + { + throw new HandlebarsException("{{#Property.WriteRedefinedToDto}} expects an IProperty"); + } + + writer.WriteSafeString(WriteRedefinedToDto(property)); + }); + + handlebars.RegisterHelper("Property.WriteRedefinedDeserialization", (writer, _, arguments) => + { + if (arguments.Length != 3 || arguments[0] is not IClass generatedClass || arguments[1] is not string section || arguments[2] is not bool includeDerivedProperties) + { + throw new HandlebarsException("{{#Property.WriteRedefinedDeserialization}} expects an IClass, a section name and an include-derived flag"); + } + + writer.WriteSafeString(WriteRedefinedDeserialization(generatedClass, section, includeDerivedProperties)); + }); + handlebars.RegisterHelper("Property.IsRedefinedOrRedifines", (context, arguments) => { if (context.Value is not IProperty property) @@ -1188,9 +1262,9 @@ private static void WriteForDtoComparer(EncodedTextWriter writer, Arguments para var property = (IProperty)parameters[0]; var classContext = (IClass)parameters[1]; - if (property.TryQueryRedefinedByProperty(classContext, out _)) + if (property.TryQueryRedefinedByProperty(classContext, out _) && !property.QueryIsSerializedRedefinition(classContext)) { - throw new InvalidOperationException("Property.WriteForDTOComparer is invalid for redefined properties"); + throw new InvalidOperationException("Property.WriteForDTOComparer is invalid for redefined properties that are not serialized under their own name"); } if (property.IsDerived || property.IsDerivedUnion) @@ -1384,7 +1458,12 @@ private static string GetRedefinedPropertyGetterImplementationForPoco(IProperty /// The setter implementation private static string GetRedefinedPropertySetterImplementationForDto(IProperty redefinedProperty, IProperty redefinition, IClass context) { - if (redefinition.IsDerived || redefinition.IsDerivedUnion || redefinition.IsReadOnly) + if (redefinition.IsDerived || redefinition.IsDerivedUnion) + { + return GetSetterIntoDerivedStorageForDto(redefinedProperty, redefinition, context); + } + + if (redefinition.IsReadOnly) { return string.Empty; } @@ -1414,6 +1493,205 @@ private static string GetRedefinedPropertySetterImplementationForDto(IProperty r return stringBuilder.ToString(); } + /// + /// Writes one section of the JSON deserialization of the properties that the redefines but that are + /// still serialized under their own name. + /// + /// The whose deserializer is generated + /// Either declarations, reads or assignments + /// Whether the generated method also reads derived properties + /// The generated code + /// If the is unknown or a property has an unsupported type + private static string WriteRedefinedDeserialization(IClass generatedClass, string section, bool includeDerivedProperties) + { + var sb = new StringBuilder(); + + var redefinedProperties = generatedClass.QueryAllProperties() + .Where(property => property.QueryIsSerializedRedefinition(generatedClass) && (includeDerivedProperties || !property.QueryHasDerivedValueIn(generatedClass))); + + foreach (var property in redefinedProperties) + { + var shape = QueryRedefinedDeserializationShape(property); + + switch (section) + { + case "declarations": + sb.AppendLine($"var {property.Name}RedefinitionSeen = false;"); + sb.AppendLine($"{shape.LocalType} {property.Name}RedefinitionValue = {shape.LocalDefault};"); + break; + case "reads": + sb.AppendLine($"if (reader.ValueTextEquals(\"{property.Name}\"u8))"); + sb.AppendLine("{"); + sb.AppendLine($"{property.Name}RedefinitionSeen = true;"); + sb.AppendLine("reader.Read();"); + sb.AppendLine(shape.Read.Replace(ValuePlaceholder, $"{property.Name}RedefinitionValue")); + sb.AppendLine("continue;"); + sb.AppendLine("}"); + break; + case "assignments": + AppendRedefinedAssignment(sb, property, generatedClass, shape, includeDerivedProperties); + break; + default: + throw new HandlebarsException($"Unknown redefined-deserialization section '{section}'"); + } + + sb.AppendLine(); + } + + return sb.ToString(); + } + + /// + /// Writes the DAL statement that copies a redefined property still serialized under its own name from a POCO to its DTO. + /// + /// The redefined + /// The generated statement + private static string WriteRedefinedToDto(IProperty property) + { + var owner = (INamedElement)property.Owner; + var ownerNamespace = Extensions.NamedElementExtensions.QueryNamespace(owner); + var propertyName = property.QueryPropertyNameBasedOnUmlProperties(); + var target = $"((Core.DTO.{ownerNamespace}.I{owner.Name})dto).{propertyName}"; + var source = $"((Core.POCO.{ownerNamespace}.I{owner.Name})poco).{propertyName}"; + + if (!property.QueryIsReferenceType()) + { + return property.QueryIsEnumerable() ? $"{target} = [.. {source}];{Environment.NewLine}" : $"{target} = {source};{Environment.NewLine}"; + } + + if (property.QueryIsEnumerable()) + { + return $"{target} = {source}.Select(x => x.Id).ToList();{Environment.NewLine}"; + } + + return uml4net.Extensions.PropertyExtensions.QueryIsNullableAndNotString(property) + ? $"{target} = {source}?.Id;{Environment.NewLine}" + : $"{target} = {source}.Id;{Environment.NewLine}"; + } + + /// + /// Appends the code that stores a deserialized redefined property, warning when the value disagrees with the one of its redefinition. + /// + /// The to append to + /// The redefined + /// The whose deserializer is generated + /// The deserialization shape of the + /// Whether the generated method also reads derived properties + private static void AppendRedefinedAssignment(StringBuilder sb, IProperty property, IClass generatedClass, RedefinedDeserializationShape shape, bool includeDerivedProperties) + { + var owner = (INamedElement)property.Owner; + var accessor = $"((SysML2.NET.Core.DTO.{Extensions.NamedElementExtensions.QueryNamespace(owner)}.I{owner.Name})dtoInstance).{property.QueryPropertyNameBasedOnUmlProperties()}"; + var localValue = $"{property.Name}RedefinitionValue"; + var value = shape.Convert.Replace(ValuePlaceholder, localValue); + var storage = property.QueryRedefinitionChainEnd(generatedClass); + var isStorageRead = includeDerivedProperties || !(storage.IsDerived || storage.IsDerivedUnion); + + sb.AppendLine($"if ({property.Name}RedefinitionSeen{shape.HasValueCondition.Replace(ValuePlaceholder, localValue)})"); + sb.AppendLine("{"); + + if (isStorageRead) + { + sb.AppendLine($"if (!{storage.Name}Seen)"); + sb.AppendLine("{"); + sb.AppendLine($"{accessor} = {value};"); + sb.AppendLine("}"); + sb.AppendLine($"else if ({shape.Differs.Replace(LeftPlaceholder, accessor).Replace(RightPlaceholder, value)} && logger.IsEnabled(LogLevel.Warning))"); + sb.AppendLine("{"); + sb.AppendLine($"logger.LogWarning(\"The {property.Name} Json property of the {generatedClass.Name} {{Id}} disagrees with {storage.Name}; the {storage.Name} value is kept\", dtoInstance.Id);"); + sb.AppendLine("}"); + } + else + { + sb.AppendLine($"{accessor} = {value};"); + } + + sb.AppendLine("}"); + } + + /// + /// Gets the code fragments that deserialize a redefined property according to its type and multiplicity. + /// + /// The redefined + /// The + /// If the type of the is not supported + private static RedefinedDeserializationShape QueryRedefinedDeserializationShape(IProperty property) + { + const string sequenceDiffers = "!System.Linq.Enumerable.SequenceEqual({left}, {right})"; + const string scalarDiffers = "{left} != {right}"; + + if (property.QueryIsReferenceType()) + { + if (property.QueryIsEnumerable()) + { + return new RedefinedDeserializationShape("System.Collections.Generic.List", "[]", + "Utf8JsonReaderHelper.ExpectArrayStart(ref reader);\nwhile (reader.Read() && reader.TokenType != JsonTokenType.EndArray)\n{\nif (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem))\n{\n{value}.Add(redefinitionItem);\n}\n}", + ValuePlaceholder, string.Empty, sequenceDiffers); + } + + var convert = uml4net.Extensions.PropertyExtensions.QueryIsNullableAndNotString(property) ? ValuePlaceholder : "({value} ?? Guid.Empty)"; + + return new RedefinedDeserializationShape("Guid?", "null", + "if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem))\n{\n{value} = redefinitionItem;\n}", + convert, string.Empty, scalarDiffers); + } + + if (property.QueryIsString() && !property.QueryIsEnumerable()) + { + return new RedefinedDeserializationShape("string", "null", "{value} = Utf8JsonReaderHelper.ReadStringOrNull(ref reader);", + ValuePlaceholder, string.Empty, "!string.Equals({left}, {right}, StringComparison.Ordinal)"); + } + + if (property.QueryIsBool() && !property.QueryIsEnumerable()) + { + return new RedefinedDeserializationShape("bool?", "null", "{value} = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader);", + "{value}.Value", " && {value}.HasValue", scalarDiffers); + } + + throw new HandlebarsException($"The redefined property {property.Name} of type {property.Type.Name} cannot be deserialized under its own name"); + } + + /// + /// Gets the DTO setter body that stores the value of a non-derived property, redefined by a derived one, in the member that holds the + /// end of the redefinition chain in the class context. + /// + /// The non-derived redefined property + /// The derived property that redefines + /// The context + /// The setter implementation + private static string GetSetterIntoDerivedStorageForDto(IProperty redefinedProperty, IProperty redefinition, IClass context) + { + var storage = redefinition.QueryRedefinitionChainEnd(context); + var storageName = $"this.{storage.QueryPropertyNameBasedOnUmlProperties()}"; + + if (redefinedProperty.QueryIsEnumerable() && storage.QueryIsEnumerable()) + { + return $"{storageName} = [.. value];"; + } + + if (!redefinedProperty.QueryIsEnumerable() && storage.QueryIsEnumerable()) + { + return $"{storageName} = [value];"; + } + + if (!redefinedProperty.QueryIsEnumerable()) + { + return $"{storageName} = value;"; + } + + string emptyValue; + + if (uml4net.Extensions.PropertyExtensions.QueryIsNullableAndNotString(storage) || storage.QueryIsString()) + { + emptyValue = "null"; + } + else + { + emptyValue = storage.QueryIsReferenceType() ? "Guid.Empty" : "default"; + } + + return $"{storageName} = value.Count != 0 ? value[0] : {emptyValue};"; + } + /// /// Gets the setter implementation for an that has been redefined, for POCO generation /// @@ -1505,5 +1783,16 @@ private static string GetSetterFromSingleValueForPoco(string redefinitionPropert return stringBuilder.ToString(); } + + /// + /// The code fragments that deserialize a redefined property; {value}, {left} and {right} are placeholders. + /// + /// The C# type of the local holding the read value + /// The initial value of that local + /// The statements that read the Json value into the local + /// The expression that converts the local to the type of the property + /// The extra condition under which the local holds a value to store + /// The expression that tells whether two values of the property differ + private sealed record RedefinedDeserializationShape(string LocalType, string LocalDefault, string Read, string Convert, string HasValueCondition, string Differs); } } diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dal-poco-uml-extensions.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dal-poco-uml-extensions.hbs index 08861aea8..6a52dc945 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dal-poco-uml-extensions.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dal-poco-uml-extensions.hbs @@ -246,6 +246,11 @@ namespace SysML2.NET.Dal {{#unless (Property.IsPropertyRedefinedInClass this class)}} {{> core-dal-poco-uml-partial-extensions property}} {{/unless}} + {{#if (Property.IsSerializedRedefinition property class)}} + {{#unless (Property.HasDerivedValueIn property class)}} + {{ #Property.WriteRedefinedToDto property }} + {{/unless}} + {{/if}} {{/unless}} {{/unless}} {{/each}} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-class-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-class-uml-template.hbs index c04f388bb..995739ce8 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-class-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-class-uml-template.hbs @@ -39,7 +39,7 @@ namespace SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace this {{ #Decorator.WritePropertyAttribute property }} {{ #Decorator.WriteSubsettedPropertyAttribute property }} {{ #Decorator.WriteRedefinedPropertyAttribute property }} - {{ #Decorator.WriteRedefinedByPropertyAttribute property ../ }} + {{ #Property.WriteRedefinedByPropertyAttribute property ../ }} {{ #Decorator.WriteImplementsAttribute property }} {{ #Property.WriteForDTOClass property ../ }} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs index e2d5d541e..e307f3d76 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-comparer-class-uml-template.hbs @@ -76,6 +76,11 @@ namespace SysML2.NET.Extensions.Core.DTO.Comparers {{#unless (Property.IsPropertyRedefinedInClass this ../)}} {{ #Property.WriteForDTOComparer property ../ }} {{/unless}} + {{#if (Property.IsSerializedRedefinition property ../)}} + {{#unless (Property.HasDerivedValueIn property ../)}} + {{ #Property.WriteForDTOComparer property ../ }} + {{/unless}} + {{/if}} {{/each}} return true; } diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-interface-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-interface-uml-template.hbs index f3264c63e..b2654b62d 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-interface-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-dto-interface-uml-template.hbs @@ -32,7 +32,7 @@ namespace SysML2.NET.Core.DTO.{{ #NamedElement.WriteFullyQualifiedNameSpace this {{ #Decorator.WritePropertyAttribute property }} {{ #Decorator.WriteSubsettedPropertyAttribute property }} {{ #Decorator.WriteRedefinedPropertyAttribute property }} - {{ #Decorator.WriteRedefinedByPropertyAttribute property ../ }} + {{ #Property.WriteRedefinedByPropertyAttribute property ../ }} {{ #Property.WriteForDTOInterface property }} {{/each}} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-deserializer-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-deserializer-uml-template.hbs index d66194569..30aad5c2c 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-deserializer-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-deserializer-uml-template.hbs @@ -100,6 +100,8 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{/unless}} {{/each}} + {{ #Property.WriteRedefinedDeserialization class "declarations" true }} + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -130,10 +132,14 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{/unless}} {{/each}} + {{ #Property.WriteRedefinedDeserialization class "reads" true }} + reader.Read(); reader.Skip(); } + {{ #Property.WriteRedefinedDeserialization class "assignments" true }} + if (logger.IsEnabled(LogLevel.Debug)) { {{ #each (Class.QueryAllProperties this) as | property | }} @@ -177,6 +183,8 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{/unless}} {{/each}} + {{ #Property.WriteRedefinedDeserialization class "declarations" false }} + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -209,10 +217,14 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{/unless}} {{/each}} + {{ #Property.WriteRedefinedDeserialization class "reads" false }} + reader.Read(); reader.Skip(); } + {{ #Property.WriteRedefinedDeserialization class "assignments" false }} + if (logger.IsEnabled(LogLevel.Debug)) { {{ #each (Class.QueryAllProperties this) as | property | }} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-serializer-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-serializer-uml-template.hbs index d67f0e024..253c3b02c 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-serializer-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-json-dto-serializer-uml-template.hbs @@ -109,10 +109,12 @@ namespace SysML2.NET.Serializer.Json.Core.DTO {{#unless this.IsDerived}} {{#unless this.IsTransient}} {{#unless (Property.IsRedefinedByPropertyWithSameName this class)}} + {{#unless (Property.HasDerivedValueIn property class)}} {{#withPropertyClassContext property class}} {{> core-json-dto-serializer-uml-partial-template this}} {{/withPropertyClassContext}} {{/unless}} + {{/unless}} {{/unless}} {{/unless}} {{/each}} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-class-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-class-uml-template.hbs index 9a9989562..9dabb2aad 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-class-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-class-uml-template.hbs @@ -51,7 +51,7 @@ namespace SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace thi {{ #Decorator.WritePropertyAttribute property }} {{ #Decorator.WriteSubsettedPropertyAttribute property }} {{ #Decorator.WriteRedefinedPropertyAttribute property }} - {{ #Decorator.WriteRedefinedByPropertyAttribute property ../ }} + {{ #Property.WriteRedefinedByPropertyAttribute property ../ }} {{ #Decorator.WriteImplementsAttribute property }} {{ #Property.WriteForPOCOClass property ../ }} diff --git a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-interface-uml-template.hbs b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-interface-uml-template.hbs index f4fa1d11f..98aa05001 100644 --- a/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-interface-uml-template.hbs +++ b/SysML2.NET.CodeGenerator/Templates/Uml/core-poco-interface-uml-template.hbs @@ -32,7 +32,7 @@ namespace SysML2.NET.Core.POCO.{{ #NamedElement.WriteFullyQualifiedNameSpace thi {{ #Decorator.WritePropertyAttribute property }} {{ #Decorator.WriteSubsettedPropertyAttribute property }} {{ #Decorator.WriteRedefinedPropertyAttribute property }} - {{ #Decorator.WriteRedefinedByPropertyAttribute property ../ }} + {{ #Property.WriteRedefinedByPropertyAttribute property ../ }} {{ #Property.WriteForPOCOInterface property }} {{/each}} diff --git a/SysML2.NET.Dal.Tests/OwningMembershipExtensionsTestFixture.cs b/SysML2.NET.Dal.Tests/OwningMembershipExtensionsTestFixture.cs new file mode 100644 index 000000000..65e91f646 --- /dev/null +++ b/SysML2.NET.Dal.Tests/OwningMembershipExtensionsTestFixture.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------ +// +// +// Copyright (C) 2022-2026 Starion Group S.A. +// SPDX-License-Identifier: Apache-2.0 +// +// +// ------------------------------------------------------------------------------------------------ + +namespace SysML2.NET.Dal.Tests +{ + using System; + + using NUnit.Framework; + + using SysML2.NET.Core.POCO.Kernel.Packages; + using SysML2.NET.Core.POCO.Root.Namespaces; + using SysML2.NET.Dal; + using SysML2.NET.Extensions; + + using DtoElements = SysML2.NET.Core.DTO.Root.Elements; + using DtoNamespaces = SysML2.NET.Core.DTO.Root.Namespaces; + + [TestFixture] + public class OwningMembershipExtensionsTestFixture + { + [Test] + public void VerifyToDto() + { + var detached = new OwningMembership { Id = Guid.NewGuid() }; + + Assert.That(() => detached.ToDto(), Throws.Nothing); + + var detachedDto = detached.ToDto(); + + using (Assert.EnterMultipleScope()) + { + Assert.That(((DtoNamespaces.IMembership)detachedDto).MemberElement, Is.EqualTo(Guid.Empty)); + Assert.That(((DtoNamespaces.IMembership)detachedDto).MemberName, Is.Null); + } + + var owningNamespace = new Namespace { Id = Guid.NewGuid() }; + var membership = new OwningMembership { Id = Guid.NewGuid() }; + var member = new Package { Id = Guid.NewGuid(), DeclaredName = "Nested" }; + owningNamespace.AssignOwnership(membership, member); + + var withoutDerived = membership.ToDto(); + + using (Assert.EnterMultipleScope()) + { + Assert.That(((DtoNamespaces.IMembership)withoutDerived).MemberElement, Is.EqualTo(Guid.Empty)); + Assert.That(withoutDerived.OwnedRelatedElement, Is.EqualTo([member.Id])); + Assert.That(withoutDerived.OwningRelatedElement, Is.EqualTo(owningNamespace.Id)); + } + + var withDerived = membership.ToDto(true); + + using (Assert.EnterMultipleScope()) + { + Assert.That(((DtoNamespaces.IMembership)withDerived).MemberElement, Is.EqualTo(member.Id)); + Assert.That(((DtoNamespaces.IMembership)withDerived).MemberName, Is.EqualTo("Nested")); + Assert.That(((DtoElements.IRelationship)withDerived).Source, Is.EqualTo([owningNamespace.Id])); + Assert.That(((DtoElements.IRelationship)withDerived).Target, Is.EqualTo([member.Id])); + } + } + } +} diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/AnnotationExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/AnnotationExtensions.cs index df0c5d7cd..f10f144ac 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/AnnotationExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/AnnotationExtensions.cs @@ -205,6 +205,7 @@ public static Core.DTO.Root.Annotations.Annotation ToDto(this Core.POCO.Root.Ann dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernDefinitionExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernDefinitionExtensions.cs index 2cb445a0c..951a9bb0d 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernDefinitionExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernDefinitionExtensions.cs @@ -164,6 +164,7 @@ public static Core.DTO.Systems.Requirements.ConcernDefinition ToDto(this Core.PO dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; dto.IsImpliedIncluded = poco.IsImpliedIncluded; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernUsageExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernUsageExtensions.cs index 80017928e..678ced0db 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernUsageExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConcernUsageExtensions.cs @@ -182,6 +182,7 @@ public static Core.DTO.Systems.Requirements.ConcernUsage ToDto(this Core.POCO.Sy dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.Direction = poco.Direction; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugatedPortTypingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugatedPortTypingExtensions.cs index 3850b071a..e89843e19 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugatedPortTypingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugatedPortTypingExtensions.cs @@ -208,12 +208,17 @@ public static Core.DTO.Systems.Ports.ConjugatedPortTyping ToDto(this Core.POCO.S dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Features.IFeatureTyping)dto).Type = ((Core.POCO.Core.Features.IFeatureTyping)poco).Type.Id; dto.TypedFeature = poco.TypedFeature.Id; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugationExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugationExtensions.cs index 7457452d5..5ec9f385c 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugationExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ConjugationExtensions.cs @@ -215,6 +215,8 @@ public static Core.DTO.Core.Types.Conjugation ToDto(this Core.POCO.Core.Types.Co dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/CrossSubsettingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/CrossSubsettingExtensions.cs index 3f4f708f6..eaacc93c1 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/CrossSubsettingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/CrossSubsettingExtensions.cs @@ -199,12 +199,15 @@ public static Core.DTO.Core.Features.CrossSubsetting ToDto(this Core.POCO.Core.F dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Core.Features.ISubsetting)dto).SubsettedFeature = ((Core.POCO.Core.Features.ISubsetting)poco).SubsettedFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DependencyExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DependencyExtensions.cs index e369f631a..81a1734ac 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DependencyExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DependencyExtensions.cs @@ -234,7 +234,9 @@ public static Core.DTO.Root.Dependencies.Dependency ToDto(this Core.POCO.Root.De dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); dto.Supplier = poco.Supplier.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DifferencingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DifferencingExtensions.cs index d8eff7c7f..122e25d4d 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DifferencingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DifferencingExtensions.cs @@ -205,6 +205,7 @@ public static Core.DTO.Core.Types.Differencing ToDto(this Core.POCO.Core.Types.D dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DisjoiningExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DisjoiningExtensions.cs index bb37a801c..abef9e52e 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/DisjoiningExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/DisjoiningExtensions.cs @@ -214,6 +214,8 @@ public static Core.DTO.Core.Types.Disjoining ToDto(this Core.POCO.Core.Types.Dis dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.TypeDisjoined = poco.TypeDisjoined.Id; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureChainingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureChainingExtensions.cs index 64d2ce64f..5cb265961 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureChainingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureChainingExtensions.cs @@ -205,6 +205,7 @@ public static Core.DTO.Core.Features.FeatureChaining ToDto(this Core.POCO.Core.F dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureInvertingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureInvertingExtensions.cs index 5d24002c6..a1350b58a 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureInvertingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureInvertingExtensions.cs @@ -215,6 +215,8 @@ public static Core.DTO.Core.Features.FeatureInverting ToDto(this Core.POCO.Core. dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs index 7a5a901a9..c15291103 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/FeatureTypingExtensions.cs @@ -207,12 +207,16 @@ public static Core.DTO.Core.Features.FeatureTyping ToDto(this Core.POCO.Core.Fea dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Type = poco.Type.Id; dto.TypedFeature = poco.TypedFeature.Id; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/IntersectingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/IntersectingExtensions.cs index 7440265d6..03927332c 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/IntersectingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/IntersectingExtensions.cs @@ -205,6 +205,7 @@ public static Core.DTO.Core.Types.Intersecting ToDto(this Core.POCO.Core.Types.I dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExposeExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExposeExtensions.cs index 11383f8ad..25e764516 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExposeExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExposeExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Systems.Views.MembershipExpose ToDto(this Core.POCO.Syste dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExtensions.cs index de967f34e..c240c068c 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Root.Namespaces.Membership ToDto(this Core.POCO.Root.Name dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipImportExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipImportExtensions.cs index fd5681605..a04514e62 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipImportExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/MembershipImportExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Root.Namespaces.MembershipImport ToDto(this Core.POCO.Roo dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceExposeExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceExposeExtensions.cs index b69c9f322..2567b3318 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceExposeExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceExposeExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Systems.Views.NamespaceExpose ToDto(this Core.POCO.System dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceImportExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceImportExtensions.cs index 45dca1b12..dab5c2cfb 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceImportExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/NamespaceImportExtensions.cs @@ -213,6 +213,7 @@ public static Core.DTO.Root.Namespaces.NamespaceImport ToDto(this Core.POCO.Root dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.Visibility = poco.Visibility; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/PortConjugationExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/PortConjugationExtensions.cs index c4e6033e0..7a475add1 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/PortConjugationExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/PortConjugationExtensions.cs @@ -211,10 +211,13 @@ public static Core.DTO.Systems.Ports.PortConjugation ToDto(this Core.POCO.System dto.IsImplied = poco.IsImplied; dto.IsImpliedIncluded = poco.IsImpliedIncluded; dto.OriginalPortDefinition = poco.OriginalPortDefinition.Id; + ((Core.DTO.Core.Types.IConjugation)dto).OriginalType = ((Core.POCO.Core.Types.IConjugation)poco).OriginalType.Id; 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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RedefinitionExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RedefinitionExtensions.cs index a6efa1954..d287cda40 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RedefinitionExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RedefinitionExtensions.cs @@ -207,6 +207,7 @@ public static Core.DTO.Core.Features.Redefinition ToDto(this Core.POCO.Core.Feat dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)poco).General.Id; dto.IsImplied = poco.IsImplied; dto.IsImpliedIncluded = poco.IsImpliedIncluded; dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); @@ -215,6 +216,11 @@ public static Core.DTO.Core.Features.Redefinition ToDto(this Core.POCO.Core.Feat dto.OwningRelationship = poco.OwningRelationship?.Id; dto.RedefinedFeature = poco.RedefinedFeature.Id; dto.RedefiningFeature = poco.RedefiningFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; + ((Core.DTO.Core.Features.ISubsetting)dto).SubsettedFeature = ((Core.POCO.Core.Features.ISubsetting)poco).SubsettedFeature.Id; + ((Core.DTO.Core.Features.ISubsetting)dto).SubsettingFeature = ((Core.POCO.Core.Features.ISubsetting)poco).SubsettingFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs index 2d51439e3..ef575c9cb 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ReferenceSubsettingExtensions.cs @@ -198,6 +198,7 @@ public static Core.DTO.Core.Features.ReferenceSubsetting ToDto(this Core.POCO.Co dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)poco).General.Id; dto.IsImplied = poco.IsImplied; dto.IsImpliedIncluded = poco.IsImpliedIncluded; dto.OwnedRelatedElement = poco.OwnedRelatedElement.Select(x => x.Id).ToList(); @@ -205,6 +206,8 @@ public static Core.DTO.Core.Features.ReferenceSubsetting ToDto(this Core.POCO.Co dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; dto.ReferencedFeature = poco.ReferencedFeature.Id; + ((Core.DTO.Core.Features.ISubsetting)dto).SubsettedFeature = ((Core.POCO.Core.Features.ISubsetting)poco).SubsettedFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementDefinitionExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementDefinitionExtensions.cs index bd07581fa..914436ff9 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementDefinitionExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementDefinitionExtensions.cs @@ -164,6 +164,7 @@ public static Core.DTO.Systems.Requirements.RequirementDefinition ToDto(this Cor dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; dto.IsImpliedIncluded = poco.IsImpliedIncluded; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs index 9f3dba858..f1834bc9e 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/RequirementUsageExtensions.cs @@ -182,6 +182,7 @@ public static Core.DTO.Systems.Requirements.RequirementUsage ToDto(this Core.POC dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.Direction = poco.Direction; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SatisfyRequirementUsageExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SatisfyRequirementUsageExtensions.cs index 0b73848b9..aa4c8f2b7 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SatisfyRequirementUsageExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SatisfyRequirementUsageExtensions.cs @@ -184,6 +184,7 @@ public static Core.DTO.Systems.Requirements.SatisfyRequirementUsage ToDto(this C dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.Direction = poco.Direction; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SpecializationExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SpecializationExtensions.cs index a3cdb825b..ae2e52dae 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SpecializationExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SpecializationExtensions.cs @@ -214,7 +214,9 @@ public static Core.DTO.Core.Types.Specialization ToDto(this Core.POCO.Core.Types dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); dto.Specific = poco.Specific.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubclassificationExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubclassificationExtensions.cs index 01de27e90..fbf0e415a 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubclassificationExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubclassificationExtensions.cs @@ -207,14 +207,18 @@ public static Core.DTO.Core.Classifiers.Subclassification ToDto(this Core.POCO.C dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; dto.Subclassifier = poco.Subclassifier.Id; dto.Superclassifier = poco.Superclassifier.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubsettingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubsettingExtensions.cs index 62d38f31e..c6b5f4571 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubsettingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/SubsettingExtensions.cs @@ -207,14 +207,18 @@ public static Core.DTO.Core.Features.Subsetting ToDto(this Core.POCO.Core.Featur dto.DeclaredName = poco.DeclaredName; dto.DeclaredShortName = poco.DeclaredShortName; dto.ElementId = poco.ElementId; + ((Core.DTO.Core.Types.ISpecialization)dto).General = ((Core.POCO.Core.Types.ISpecialization)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; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Core.Types.ISpecialization)dto).Specific = ((Core.POCO.Core.Types.ISpecialization)poco).Specific.Id; dto.SubsettedFeature = poco.SubsettedFeature.Id; dto.SubsettingFeature = poco.SubsettingFeature.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/TypeFeaturingExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/TypeFeaturingExtensions.cs index 1616292c9..94857c5cd 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/TypeFeaturingExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/TypeFeaturingExtensions.cs @@ -215,6 +215,8 @@ public static Core.DTO.Core.Features.TypeFeaturing ToDto(this Core.POCO.Core.Fea dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Source = ((Core.POCO.Root.Elements.IRelationship)poco).Source.Select(x => x.Id).ToList(); + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); if (includeDerivedProperties) { diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/UnioningExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/UnioningExtensions.cs index 2d305969d..78aee5bf8 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/UnioningExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/UnioningExtensions.cs @@ -204,6 +204,7 @@ public static Core.DTO.Core.Types.Unioning ToDto(this Core.POCO.Core.Types.Union dto.OwnedRelationship = poco.OwnedRelationship.Select(x => x.Id).ToList(); dto.OwningRelatedElement = poco.OwningRelatedElement?.Id; dto.OwningRelationship = poco.OwningRelationship?.Id; + ((Core.DTO.Root.Elements.IRelationship)dto).Target = ((Core.POCO.Root.Elements.IRelationship)poco).Target.Select(x => x.Id).ToList(); dto.UnioningType = poco.UnioningType.Id; if (includeDerivedProperties) diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointDefinitionExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointDefinitionExtensions.cs index 38f2761f9..1ac406dff 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointDefinitionExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointDefinitionExtensions.cs @@ -164,6 +164,7 @@ public static Core.DTO.Systems.Views.ViewpointDefinition ToDto(this Core.POCO.Sy dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; dto.IsImpliedIncluded = poco.IsImpliedIncluded; diff --git a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointUsageExtensions.cs b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointUsageExtensions.cs index ec4f5dca3..f7cebdb67 100644 --- a/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointUsageExtensions.cs +++ b/SysML2.NET.Dal/Core/AutoGenPocoExtension/ViewpointUsageExtensions.cs @@ -182,6 +182,7 @@ public static Core.DTO.Systems.Views.ViewpointUsage ToDto(this Core.POCO.Systems dto.Id = poco.Id; dto.AliasIds = [.. poco.AliasIds]; dto.DeclaredName = poco.DeclaredName; + ((Core.DTO.Root.Elements.IElement)dto).DeclaredShortName = ((Core.POCO.Root.Elements.IElement)poco).DeclaredShortName; dto.Direction = poco.Direction; dto.ElementId = poco.ElementId; dto.IsAbstract = poco.IsAbstract; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs index a32aa41c6..263eacba0 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/AnnotationComparer.cs @@ -93,6 +93,8 @@ public bool Equals(IAnnotation x, IAnnotation y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs index 38c6f0e90..9f37af3b7 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernDefinitionComparer.cs @@ -75,6 +75,8 @@ public bool Equals(IConcernDefinition x, IConcernDefinition y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; if (x.IsAbstract != y.IsAbstract) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs index 1cb3f0b9c..4c4f91fce 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConcernUsageComparer.cs @@ -77,6 +77,8 @@ public bool Equals(IConcernUsage x, IConcernUsage y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (x.Direction != y.Direction) return false; if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs index 630f43e0f..876f5ad19 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugatedPortTypingComparer.cs @@ -81,6 +81,8 @@ public bool Equals(IConjugatedPortTyping x, IConjugatedPortTyping y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -93,6 +95,14 @@ public bool Equals(IConjugatedPortTyping x, IConjugatedPortTyping y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + + if (x.Type != y.Type) return false; + if (x.TypedFeature != y.TypedFeature) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs index 065d9c10c..068c661f0 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ConjugationComparer.cs @@ -95,6 +95,10 @@ public bool Equals(IConjugation x, IConjugation y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs index f3e1b0ad3..a21cb6c40 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/CrossSubsettingComparer.cs @@ -81,6 +81,8 @@ public bool Equals(ICrossSubsetting x, ICrossSubsetting y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -93,6 +95,10 @@ public bool Equals(ICrossSubsetting x, ICrossSubsetting y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (x.SubsettedFeature != y.SubsettedFeature) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs index 1880e9501..ef4486004 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DependencyComparer.cs @@ -93,8 +93,12 @@ public bool Equals(IDependency x, IDependency y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Supplier, y.Supplier)) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs index 273c3b3cf..f4b9a07bc 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DifferencingComparer.cs @@ -93,6 +93,8 @@ public bool Equals(IDifferencing x, IDifferencing y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs index 616210759..17fec3905 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/DisjoiningComparer.cs @@ -93,6 +93,10 @@ public bool Equals(IDisjoining x, IDisjoining y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.TypeDisjoined != y.TypeDisjoined) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs index 03d43ffd1..c02cae7cc 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureChainingComparer.cs @@ -93,6 +93,8 @@ public bool Equals(IFeatureChaining x, IFeatureChaining y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs index 1e0b8860a..b46288295 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureInvertingComparer.cs @@ -95,6 +95,10 @@ public bool Equals(IFeatureInverting x, IFeatureInverting y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs index 09f136aa0..9ca785184 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/FeatureTypingComparer.cs @@ -79,6 +79,8 @@ public bool Equals(IFeatureTyping x, IFeatureTyping y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -91,6 +93,12 @@ public bool Equals(IFeatureTyping x, IFeatureTyping y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Type != y.Type) return false; if (x.TypedFeature != y.TypedFeature) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs index 6064b2762..00ed763f4 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/IntersectingComparer.cs @@ -93,6 +93,8 @@ public bool Equals(IIntersecting x, IIntersecting y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs index 57d9ec70c..7959c4bb7 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipComparer.cs @@ -98,6 +98,8 @@ public bool Equals(IMembership x, IMembership y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs index bd435c04c..158330a34 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipExposeComparer.cs @@ -98,6 +98,8 @@ public bool Equals(IMembershipExpose x, IMembershipExpose y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs index 680e31dd2..33239d0ac 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/MembershipImportComparer.cs @@ -98,6 +98,8 @@ public bool Equals(IMembershipImport x, IMembershipImport y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs index 5eab08756..63c4ff7f5 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceExposeComparer.cs @@ -98,6 +98,8 @@ public bool Equals(INamespaceExpose x, INamespaceExpose y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs index 37677c96c..94f8abac1 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/NamespaceImportComparer.cs @@ -98,6 +98,8 @@ public bool Equals(INamespaceImport x, INamespaceImport y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.Visibility != y.Visibility) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs index 7a570d236..0e859e8d6 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/PortConjugationComparer.cs @@ -87,6 +87,8 @@ public bool Equals(IPortConjugation x, IPortConjugation y) if (x.OriginalPortDefinition != y.OriginalPortDefinition) return false; + if (x.OriginalType != y.OriginalType) return false; + if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelatedElement, y.OwnedRelatedElement)) return false; if (!GuidSequenceEquality.OrderedEqual(x.OwnedRelationship, y.OwnedRelationship)) return false; @@ -95,6 +97,10 @@ public bool Equals(IPortConjugation x, IPortConjugation y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs index 2f1056b61..830fb018f 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RedefinitionComparer.cs @@ -79,6 +79,8 @@ public bool Equals(IRedefinition x, IRedefinition y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -95,6 +97,16 @@ public bool Equals(IRedefinition x, IRedefinition y) if (x.RedefiningFeature != y.RedefiningFeature) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + + if (x.SubsettedFeature != y.SubsettedFeature) return false; + + if (x.SubsettingFeature != y.SubsettingFeature) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs index 62bf98132..9dbc7af45 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ReferenceSubsettingComparer.cs @@ -79,6 +79,8 @@ public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -93,6 +95,10 @@ public bool Equals(IReferenceSubsetting x, IReferenceSubsetting y) if (x.ReferencedFeature != y.ReferencedFeature) return false; + if (x.SubsettedFeature != y.SubsettedFeature) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs index 444c82867..1ca638865 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementDefinitionComparer.cs @@ -75,6 +75,8 @@ public bool Equals(IRequirementDefinition x, IRequirementDefinition y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; if (x.IsAbstract != y.IsAbstract) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs index a7751f143..81e5799c6 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/RequirementUsageComparer.cs @@ -77,6 +77,8 @@ public bool Equals(IRequirementUsage x, IRequirementUsage y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (x.Direction != y.Direction) return false; if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs index 7aeac32ba..1e3a314d7 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SatisfyRequirementUsageComparer.cs @@ -77,6 +77,8 @@ public bool Equals(ISatisfyRequirementUsage x, ISatisfyRequirementUsage y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (x.Direction != y.Direction) return false; if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs index c198b9cc3..92cf68b33 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SpecializationComparer.cs @@ -93,8 +93,12 @@ public bool Equals(ISpecialization x, ISpecialization y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + if (x.Specific != y.Specific) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs index 7aad40ba9..f01236127 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubclassificationComparer.cs @@ -79,6 +79,8 @@ public bool Equals(ISubclassification x, ISubclassification y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -91,10 +93,16 @@ public bool Equals(ISubclassification x, ISubclassification y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + if (x.Subclassifier != y.Subclassifier) return false; if (x.Superclassifier != y.Superclassifier) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs index 41e84e66f..6f982105b 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/SubsettingComparer.cs @@ -79,6 +79,8 @@ public bool Equals(ISubsetting x, ISubsetting y) if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; + if (x.General != y.General) return false; + if (x.IsImplied != y.IsImplied) return false; if (x.IsImpliedIncluded != y.IsImpliedIncluded) return false; @@ -91,10 +93,16 @@ public bool Equals(ISubsetting x, ISubsetting y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (x.Specific != y.Specific) return false; + if (x.SubsettedFeature != y.SubsettedFeature) return false; if (x.SubsettingFeature != y.SubsettingFeature) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs index ceffafb36..4540c5ff0 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/TypeFeaturingComparer.cs @@ -95,6 +95,10 @@ public bool Equals(ITypeFeaturing x, ITypeFeaturing y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Source, y.Source)) return false; + + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + return true; } diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs index 8d03870c5..835e2f5a5 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/UnioningComparer.cs @@ -91,6 +91,8 @@ public bool Equals(IUnioning x, IUnioning y) if (x.OwningRelationship != y.OwningRelationship) return false; + if (!GuidSequenceEquality.OrderedEqual(x.Target, y.Target)) return false; + if (x.UnioningType != y.UnioningType) return false; return true; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs index c4d6d1b7b..ae42330b6 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointDefinitionComparer.cs @@ -75,6 +75,8 @@ public bool Equals(IViewpointDefinition x, IViewpointDefinition y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; if (x.IsAbstract != y.IsAbstract) return false; diff --git a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs index 0d45c7c1c..255ccd4c4 100644 --- a/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs +++ b/SysML2.NET.Extensions/Core/AutoGenDtoComparers/ViewpointUsageComparer.cs @@ -77,6 +77,8 @@ public bool Equals(IViewpointUsage x, IViewpointUsage y) if (!OrdinalStringComparer.Equals(x.DeclaredName, y.DeclaredName)) return false; + if (!OrdinalStringComparer.Equals(x.DeclaredShortName, y.DeclaredShortName)) return false; + if (x.Direction != y.Direction) return false; if (!OrdinalStringComparer.Equals(x.ElementId, y.ElementId)) return false; diff --git a/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs b/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs index 7a876dffd..bb8c19594 100644 --- a/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs +++ b/SysML2.NET.Serializer.Json.Tests/JsonSerializeAndDeserializeTestFixture.cs @@ -9,13 +9,22 @@ namespace SysML2.NET.Serializer.Json.Tests { + using System; + using System.Collections.Generic; using System.IO; using System.Linq; + using System.Text; using System.Text.Json; using NUnit.Framework; using SysML2.NET.Common; + using SysML2.NET.Core.DTO.Core.Features; + using SysML2.NET.Core.DTO.Core.Types; + using SysML2.NET.Core.DTO.Kernel.Connectors; + using SysML2.NET.Core.DTO.Root.Elements; + using SysML2.NET.Core.DTO.Root.Namespaces; + using SysML2.NET.Core.DTO.Systems.Parts; using SysML2.NET.Extensions.Core.DTO.Comparers; using SysML2.NET.Serializer.Json; @@ -82,5 +91,92 @@ public void Verify_that_Deserialize_Serialize_and_Deserialize_yields_equal_objec } } } + + [Test] + public void SerializeAndDeSerialize_WithPropertiesRedefinedByDerivedOnes_ExchangesThemOnlyWithDerivedProperties() + { + var owningNamespace = Guid.NewGuid(); + var member = Guid.NewGuid(); + + var membership = new Membership { Id = Guid.NewGuid() }; + ((IRelationship)membership).Target = [member]; + + var owningMembership = new OwningMembership { Id = Guid.NewGuid() }; + ((IMembership)owningMembership).MemberElement = member; + ((IMembership)owningMembership).MemberName = "Nested"; + ((IRelationship)owningMembership).Source = [owningNamespace]; + + var featureMembership = new FeatureMembership { Id = Guid.NewGuid() }; + ((IMembership)featureMembership).MemberElement = member; + + var namespaceImport = new NamespaceImport { Id = Guid.NewGuid(), ImportedNamespace = Guid.NewGuid() }; + ((IRelationship)namespaceImport).Source = [owningNamespace]; + + var connector = new Connector { Id = Guid.NewGuid() }; + ((IRelationship)connector).Target = [member, owningNamespace]; + + var referenceSubsetting = new ReferenceSubsetting { Id = Guid.NewGuid(), ReferencedFeature = Guid.NewGuid() }; + ((ISubsetting)referenceSubsetting).SubsettingFeature = member; + + var partUsage = new PartUsage { Id = Guid.NewGuid() }; + ((IFeature)partUsage).IsVariable = true; + + List elements = [membership, owningMembership, featureMembership, namespaceImport, connector, referenceSubsetting, partUsage]; + + var withDerived = this.RoundTrip(elements, true); + + using (Assert.EnterMultipleScope()) + { + Assert.That(((IRelationship)withDerived[membership.Id]).Target, Is.EqualTo([member])); + Assert.That(((IMembership)withDerived[owningMembership.Id]).MemberElement, Is.EqualTo(member)); + Assert.That(((IMembership)withDerived[owningMembership.Id]).MemberName, Is.EqualTo("Nested")); + Assert.That(((IRelationship)withDerived[owningMembership.Id]).Source, Is.EqualTo([owningNamespace])); + Assert.That(((IMembership)withDerived[featureMembership.Id]).MemberElement, Is.EqualTo(member)); + Assert.That(((IRelationship)withDerived[namespaceImport.Id]).Source, Is.EqualTo([owningNamespace])); + Assert.That(((IRelationship)withDerived[connector.Id]).Target, Is.EqualTo([member, owningNamespace])); + Assert.That(((ISubsetting)withDerived[referenceSubsetting.Id]).SubsettingFeature, Is.EqualTo(member)); + Assert.That(((IFeature)withDerived[partUsage.Id]).IsVariable, Is.True); + Assert.That(elements.All(element => ComparerProvider.Resolve(element).Equals(element, withDerived[element.Id])), Is.True); + } + + var withoutDerived = this.RoundTrip(elements, false); + + using (Assert.EnterMultipleScope()) + { + Assert.That(((IRelationship)withoutDerived[membership.Id]).Target, Is.EqualTo([member])); + Assert.That(((IMembership)withoutDerived[owningMembership.Id]).MemberElement, Is.EqualTo(Guid.Empty)); + Assert.That(((IMembership)withoutDerived[owningMembership.Id]).MemberName, Is.Null); + Assert.That(((IMembership)withoutDerived[featureMembership.Id]).MemberElement, Is.EqualTo(Guid.Empty)); + Assert.That(((IRelationship)withoutDerived[connector.Id]).Target, Is.Empty); + Assert.That(((ISubsetting)withoutDerived[referenceSubsetting.Id]).SubsettingFeature, Is.EqualTo(Guid.Empty)); + Assert.That(((IFeature)withoutDerived[partUsage.Id]).IsVariable, Is.False); + Assert.That(elements.All(element => ComparerProvider.Resolve(element).Equals(element, withoutDerived[element.Id])), Is.True); + } + } + + [Test] + public void DeSerialize_WithRedefinedAndRedefiningKeysThatDisagree_KeepsTheRedefiningValue() + { + var membershipId = Guid.NewGuid(); + var ownedMember = Guid.NewGuid(); + var json = $$$""" + [{"@id": "{{{membershipId}}}", "@type": "OwningMembership", "memberElement": {"@id": "{{{Guid.NewGuid()}}}"}, "ownedMemberElement": {"@id": "{{{ownedMember}}}"}}] + """; + + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(json)); + + var membership = (IMembership)this.deSerializer.DeSerialize(stream, SerializationModeKind.JSON, SerializationTargetKind.CORE, true).Single(); + + Assert.That(membership.MemberElement, Is.EqualTo(ownedMember)); + } + + private Dictionary RoundTrip(IEnumerable elements, bool includeDerivedProperties) + { + using var stream = new MemoryStream(); + this.serializer.Serialize(elements, SerializationModeKind.JSON, includeDerivedProperties, stream, new JsonWriterOptions()); + stream.Position = 0; + + return this.deSerializer.DeSerialize(stream, SerializationModeKind.JSON, SerializationTargetKind.CORE, includeDerivedProperties).ToDictionary(element => element.Id, element => (IData)element); + } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AcceptActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AcceptActionUsageDeSerializer.cs index b7ac886de..acebd60d9 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AcceptActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AcceptActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AcceptActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAcceptActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AcceptActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AcceptActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAcceptActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AcceptActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2133,11 +2137,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AcceptActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2594,25 +2620,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AcceptActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2633,9 +2659,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2922,97 +2949,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the AcceptActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionDefinitionDeSerializer.cs index d22518a68..87c62dc5f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ActionDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IActionDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActionDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ActionDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IActionDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActionDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var aliasIdsSeen = false; @@ -174,9 +174,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1627,11 +1628,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -1968,25 +1971,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1998,9 +2001,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2176,61 +2180,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ActionDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionUsageDeSerializer.cs index bfb522e5e..193468b45 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActorMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActorMembershipDeSerializer.cs index 9b6b8c96c..c3bd7583e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActorMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ActorMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ActorMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IActorMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActorMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ActorMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IActorMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ActorMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ActorMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedActorParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ActorMembership {Id} disagrees with ownedActorParameter; the ownedActorParameter value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ActorMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedActorParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ActorMembership {Id} disagrees with ownedActorParameter; the ownedActorParameter value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ActorMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ActorMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ActorMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationDefinitionDeSerializer.cs index ca97af000..fae2c6d89 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Allocations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AllocationDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAllocationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AllocationDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Allocations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AllocationDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAllocationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AllocationDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var allocationSeen = false; @@ -179,9 +179,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1715,11 +1722,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the AllocationDefinition {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the AllocationDefinition {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2076,25 +2139,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2109,9 +2172,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2335,73 +2399,75 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AllocationDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationUsageDeSerializer.cs index dfb9f20d9..12146ab77 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AllocationUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Allocations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AllocationUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAllocationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AllocationUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Allocations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AllocationUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAllocationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AllocationUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var allocationDefinitionSeen = false; @@ -211,9 +211,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2256,11 +2266,87 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AllocationUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the AllocationUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the AllocationUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2745,25 +2831,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Allocations.AllocationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2787,9 +2873,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3124,109 +3211,111 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the AllocationUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseDefinitionDeSerializer.cs index 3e15e9033..1da573257 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.AnalysisCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AnalysisCaseDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAnalysisCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnalysisCaseDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.AnalysisCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AnalysisCaseDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAnalysisCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnalysisCaseDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var actorParameterSeen = false; @@ -182,9 +182,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1780,11 +1781,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2153,25 +2156,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2183,9 +2186,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2361,61 +2365,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AnalysisCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseUsageDeSerializer.cs index 559e22dcc..7b44215a2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnalysisCaseUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.AnalysisCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AnalysisCaseUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAnalysisCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnalysisCaseUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.AnalysisCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AnalysisCaseUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAnalysisCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnalysisCaseUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -207,9 +207,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2188,11 +2192,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AnalysisCaseUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2661,25 +2687,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.AnalysisCases.AnalysisCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2700,9 +2726,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2989,97 +3016,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the AnalysisCaseUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs index e9ae356d4..a1bd06011 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotatingElementDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Annotations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AnnotatingElementDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAnnotatingElement DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnnotatingElementDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Annotations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AnnotatingElementDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAnnotatingElement DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnnotatingElementDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -112,9 +112,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -475,11 +476,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -568,25 +571,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.AnnotatingElement dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -594,9 +597,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var elementIdSeen = false; var isImpliedIncludedSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -720,45 +724,47 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AnnotatingElement: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotationDeSerializer.cs index f4578080b..9c90ffa54 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AnnotationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Annotations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AnnotationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAnnotation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnnotationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Annotation(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Annotation dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Annotations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AnnotationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAnnotation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AnnotationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Annotation(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Annotation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -117,9 +117,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -570,11 +577,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!annotatedElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Annotation {Id} disagrees with annotatedElement; the annotatedElement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!annotatingElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Annotation {Id} disagrees with annotatingElement; the annotatingElement value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -683,25 +746,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Annotation: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Annotation dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Annotation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -713,9 +776,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -909,61 +976,90 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!annotatedElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Annotation {Id} disagrees with annotatedElement; the annotatedElement value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!annotatedElementSeen) - { + { logger.LogDebug("the annotatedElement Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Annotation: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Annotation: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssertConstraintUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssertConstraintUsageDeSerializer.cs index 29b1ae019..ccb9386cc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssertConstraintUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssertConstraintUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Constraints; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AssertConstraintUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAssertConstraintUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssertConstraintUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Constraints; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AssertConstraintUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAssertConstraintUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssertConstraintUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var assertedConstraintSeen = false; @@ -206,9 +206,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2166,11 +2170,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AssertConstraintUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2635,25 +2661,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.AssertConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2675,9 +2701,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2977,101 +3004,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isNegatedSeen) - { + { logger.LogDebug("the isNegated Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the AssertConstraintUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssignmentActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssignmentActionUsageDeSerializer.cs index 5b6fe1965..a64ad460b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssignmentActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssignmentActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AssignmentActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAssignmentActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssignmentActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AssignmentActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAssignmentActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssignmentActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var valueExpressionSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2133,11 +2137,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AssignmentActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2594,25 +2620,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.AssignmentActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2633,9 +2659,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2922,97 +2949,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the AssignmentActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationDeSerializer.cs index 1b934d765..c0f9f1b94 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Associations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AssociationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAssociation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssociationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Associations.Association(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.Association dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Associations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AssociationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAssociation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssociationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Associations.Association(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.Association dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationEndSeen = false; @@ -145,9 +145,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var sourceTypeSeen = false; var targetTypeSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1079,11 +1086,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Association {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Association {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1304,25 +1367,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Association: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.Association dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.Association dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1335,9 +1398,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1535,65 +1599,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Association: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Association: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationStructureDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationStructureDeSerializer.cs index 30637de31..733bc8a85 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationStructureDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AssociationStructureDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Associations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AssociationStructureDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAssociationStructure DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssociationStructureDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Associations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AssociationStructureDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAssociationStructure DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AssociationStructureDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationEndSeen = false; @@ -145,9 +145,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var sourceTypeSeen = false; var targetTypeSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1079,11 +1086,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the AssociationStructure {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the AssociationStructure {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1304,25 +1367,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Associations.AssociationStructure dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1335,9 +1398,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1535,65 +1599,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AssociationStructure: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeDefinitionDeSerializer.cs index e7ab0e147..cd970ff0f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Attributes; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AttributeDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAttributeDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AttributeDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Attributes; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AttributeDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAttributeDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AttributeDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -171,9 +171,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1575,11 +1576,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1904,25 +1907,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1933,9 +1936,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2098,57 +2102,59 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AttributeDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeUsageDeSerializer.cs index aba8d3302..5cbe236fa 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/AttributeUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Attributes; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class AttributeUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IAttributeUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AttributeUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Attributes; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class AttributeUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IAttributeUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("AttributeUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var attributeDefinitionSeen = false; @@ -198,9 +198,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2031,11 +2035,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the AttributeUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2468,25 +2494,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Attributes.AttributeUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2505,9 +2531,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2771,89 +2798,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the AttributeUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BehaviorDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BehaviorDeSerializer.cs index e6c9b478c..8349114f0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BehaviorDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BehaviorDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Behaviors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class BehaviorDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IBehavior DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BehaviorDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Behaviors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class BehaviorDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IBehavior DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BehaviorDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -140,9 +140,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var stepSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -991,11 +992,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1196,25 +1199,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Behavior: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Behavior dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1224,9 +1227,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1376,53 +1380,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Behavior: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Behavior: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorAsUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorAsUsageDeSerializer.cs index 33229eb67..f394a8113 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorAsUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorAsUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Connections; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class BindingConnectorAsUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IBindingConnectorAsUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BindingConnectorAsUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Connections; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class BindingConnectorAsUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IBindingConnectorAsUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BindingConnectorAsUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationSeen = false; @@ -206,9 +206,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2175,11 +2185,87 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the BindingConnectorAsUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the BindingConnectorAsUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the BindingConnectorAsUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2644,25 +2730,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.BindingConnectorAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2684,9 +2770,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2998,101 +3085,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the BindingConnectorAsUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorDeSerializer.cs index af3736a64..88e3488cc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BindingConnectorDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Connectors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class BindingConnectorDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IBindingConnector DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BindingConnectorDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Connectors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class BindingConnectorDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IBindingConnector DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BindingConnectorDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationSeen = false; @@ -170,9 +170,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var sourceFeatureSeen = false; var targetFeatureSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1503,11 +1510,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the BindingConnector {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the BindingConnector {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1828,25 +1891,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.BindingConnector dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1868,9 +1931,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2182,101 +2246,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the BindingConnector: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BooleanExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BooleanExpressionDeSerializer.cs index 2cc6fc8cf..e5c639cf0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BooleanExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/BooleanExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class BooleanExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IBooleanExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BooleanExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class BooleanExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IBooleanExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("BooleanExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1433,11 +1434,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1742,25 +1745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.BooleanExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1779,9 +1782,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2045,89 +2049,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the BooleanExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationDefinitionDeSerializer.cs index cabff2770..6a3241267 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Calculations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CalculationDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ICalculationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CalculationDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Calculations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CalculationDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ICalculationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CalculationDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var aliasIdsSeen = false; @@ -178,9 +178,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1702,11 +1703,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2059,25 +2062,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2089,9 +2092,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2267,61 +2271,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the CalculationDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationUsageDeSerializer.cs index c620276ee..468cdc70f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CalculationUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Calculations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CalculationUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ICalculationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CalculationUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Calculations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CalculationUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ICalculationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CalculationUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var calculationDefinitionSeen = false; @@ -203,9 +203,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2110,11 +2114,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the CalculationUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2567,25 +2593,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Calculations.CalculationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2606,9 +2632,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2895,97 +2922,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the CalculationUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseDefinitionDeSerializer.cs index d9359cc6c..8b72c518f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Cases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CaseDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ICaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CaseDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Cases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CaseDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ICaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CaseDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var actorParameterSeen = false; @@ -181,9 +181,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1762,11 +1763,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2131,25 +2134,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2161,9 +2164,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2339,61 +2343,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the CaseDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseUsageDeSerializer.cs index 07d847512..ce2267b60 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CaseUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Cases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CaseUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ICaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CaseUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.CaseUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Cases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CaseUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ICaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CaseUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.CaseUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -206,9 +206,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2170,11 +2174,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the CaseUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2639,25 +2665,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.CaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2678,9 +2704,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2967,97 +2994,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the CaseUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassDeSerializer.cs index 32147d343..65c58fe94 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Classes; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ClassDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IClass DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ClassDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Classes.Class(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Classes.Class dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Classes; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ClassDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IClass DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ClassDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Classes.Class(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Classes.Class dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -139,9 +139,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -972,11 +973,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1173,25 +1176,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Class: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Classes.Class dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Classes.Class dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1201,9 +1204,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1353,53 +1357,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Class: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Class: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassifierDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassifierDeSerializer.cs index a9827feca..4c94ca5c5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassifierDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ClassifierDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Classifiers; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ClassifierDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IClassifier DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ClassifierDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Classifiers.Classifier(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Classifier dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Classifiers; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ClassifierDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IClassifier DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ClassifierDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Classifiers.Classifier(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Classifier dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -139,9 +139,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -972,11 +973,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1173,25 +1176,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Classifier: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Classifier dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Classifier dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1201,9 +1204,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1353,53 +1357,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Classifier: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Classifier: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CollectExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CollectExpressionDeSerializer.cs index 16b197c85..e68a3cdfc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CollectExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CollectExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CollectExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ICollectExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CollectExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CollectExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ICollectExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CollectExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -169,9 +169,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1491,11 +1492,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1812,25 +1815,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.CollectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1850,9 +1853,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var operatorSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2131,93 +2135,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!operatorSeen) - { + { logger.LogDebug("the operator Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the CollectExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CommentDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CommentDeSerializer.cs index 6bb64107a..bafec236a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CommentDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CommentDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Annotations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class CommentDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IComment DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CommentDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Comment(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Comment dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Annotations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class CommentDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IComment DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("CommentDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Comment(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Comment dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -114,9 +114,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -502,11 +503,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -603,25 +606,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Comment: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Comment dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Comment dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var bodySeen = false; @@ -631,9 +634,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var localeSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -782,53 +786,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!bodySeen) - { + { logger.LogDebug("the body Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!localeSeen) - { + { logger.LogDebug("the locale Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Comment: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Comment: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernDefinitionDeSerializer.cs index 137990e05..9b5293d06 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConcernDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConcernDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConcernDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConcernDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConcernDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConcernDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -183,9 +183,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1803,11 +1807,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ConcernDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2180,25 +2206,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2210,9 +2236,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2388,61 +2418,83 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ConcernDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the ConcernDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernUsageDeSerializer.cs index 4fe5f3585..a1840901e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConcernUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConcernUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConcernUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConcernUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConcernUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConcernUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConcernUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -211,9 +211,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2268,11 +2275,53 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ConcernUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ConcernUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2757,25 +2806,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.ConcernUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2796,9 +2845,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; var portionKindSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3085,97 +3138,119 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ConcernUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the ConcernUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortDefinitionDeSerializer.cs index 1af0b6dfa..398608ded 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Ports; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConjugatedPortDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConjugatedPortDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugatedPortDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Ports; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConjugatedPortDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConjugatedPortDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugatedPortDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedPortDefinitionSeen = false; @@ -173,9 +173,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1617,11 +1618,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1954,25 +1957,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1984,9 +1987,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2162,61 +2166,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConjugatedPortDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortTypingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortTypingDeSerializer.cs index 2dd3aba0d..2186e0677 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortTypingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugatedPortTypingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Ports; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConjugatedPortTypingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConjugatedPortTyping DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugatedPortTypingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Ports; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConjugatedPortTypingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConjugatedPortTyping DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugatedPortTypingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedPortDefinitionSeen = false; @@ -116,9 +116,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var typedFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typedFeatureSeen = false; + + var typeRedefinitionSeen = false; + Guid? typeRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -557,11 +573,136 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("type"u8)) + { + typeRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + typeRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (typeRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeatureTyping)dtoInstance).Type = (typeRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeatureTyping)dtoInstance).Type != (typeRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The type Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the ConjugatedPortTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ConjugatedPortTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -666,25 +807,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!typedFeatureSeen) { logger.LogDebug("the typedFeature Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.ConjugatedPortTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedPortDefinitionSeen = false; @@ -697,9 +838,25 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var typedFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typedFeatureSeen = false; + + var typeRedefinitionSeen = false; + Guid? typeRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -915,65 +1072,190 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("type"u8)) + { + typeRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + typeRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (typeRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeatureTyping)dtoInstance).Type = (typeRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeatureTyping)dtoInstance).Type != (typeRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The type Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the ConjugatedPortTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!conjugatedPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ConjugatedPortTyping {Id} disagrees with conjugatedPortDefinition; the conjugatedPortDefinition value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ConjugatedPortTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!conjugatedPortDefinitionSeen) - { + { logger.LogDebug("the conjugatedPortDefinition Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); } if (!typedFeatureSeen) - { + { logger.LogDebug("the typedFeature Json property was not found in the ConjugatedPortTyping: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugationDeSerializer.cs index 57ecebc04..bf5d0860a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConjugationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConjugationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConjugation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Conjugation(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Conjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConjugationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConjugation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConjugationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Conjugation(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Conjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedTypeSeen = false; @@ -115,9 +115,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +541,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!originalTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Conjugation {Id} disagrees with originalType; the originalType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!conjugatedTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Conjugation {Id} disagrees with conjugatedType; the conjugatedType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +702,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Conjugation: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Conjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Conjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedTypeSeen = false; @@ -670,9 +733,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +958,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!originalTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Conjugation {Id} disagrees with originalType; the originalType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!conjugatedTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Conjugation {Id} disagrees with conjugatedType; the conjugatedType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!conjugatedTypeSeen) - { + { logger.LogDebug("the conjugatedType Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!originalTypeSeen) - { + { logger.LogDebug("the originalType Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Conjugation: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Conjugation: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionDefinitionDeSerializer.cs index 81936b567..c29c79e0e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Connections; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConnectionDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConnectionDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectionDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Connections; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConnectionDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConnectionDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectionDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var connectionEndSeen = false; @@ -178,9 +178,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1696,11 +1703,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ConnectionDefinition {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ConnectionDefinition {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2053,25 +2116,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2086,9 +2149,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2312,73 +2376,75 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConnectionDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionUsageDeSerializer.cs index afd1786dd..8a22b436a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Connections; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConnectionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConnectionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Connections; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConnectionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConnectionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -211,9 +211,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2256,11 +2266,87 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ConnectionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ConnectionUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ConnectionUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2745,25 +2831,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.ConnectionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2787,9 +2873,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3124,109 +3211,111 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ConnectionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectorDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectorDeSerializer.cs index 42309ea72..63e52c3f6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectorDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConnectorDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Connectors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConnectorDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConnector DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectorDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.Connector(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Connector dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Connectors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConnectorDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConnector DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConnectorDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.Connector(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Connector dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationSeen = false; @@ -170,9 +170,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var sourceFeatureSeen = false; var targetFeatureSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1503,11 +1510,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Connector {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Connector {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1828,25 +1891,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Connector: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Connector dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Connector dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1868,9 +1931,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2182,101 +2246,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Connector: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Connector: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintDefinitionDeSerializer.cs index 813fef31b..7d5e65406 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Constraints; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConstraintDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConstraintDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConstraintDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Constraints; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConstraintDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConstraintDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConstraintDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -176,9 +176,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1664,11 +1665,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2013,25 +2016,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2043,9 +2046,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2221,61 +2225,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConstraintDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintUsageDeSerializer.cs index e61f84ba4..435a0f794 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstraintUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Constraints; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ConstraintUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IConstraintUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConstraintUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Constraints; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ConstraintUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IConstraintUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ConstraintUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2129,11 +2133,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ConstraintUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2590,25 +2616,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Constraints.ConstraintUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2629,9 +2655,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2918,97 +2945,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ConstraintUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstructorExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstructorExpressionDeSerializer.cs index 4d5b18e10..d242ed2ff 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstructorExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ConstructorExpressionDeSerializer.cs @@ -170,6 +170,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1475,10 +1476,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1831,6 +1834,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2095,10 +2099,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CrossSubsettingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CrossSubsettingDeSerializer.cs index 6ca999bb6..8705d1cef 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CrossSubsettingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/CrossSubsettingDeSerializer.cs @@ -116,6 +116,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var subsettingFeatureRedefinitionSeen = false; + Guid? subsettingFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -516,10 +535,158 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("subsettingFeature"u8)) + { + subsettingFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettingFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (subsettedFeatureRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (subsettingFeatureRedefinitionSeen) + { + if (!crossingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature = (subsettingFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature != (subsettingFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettingFeature Json property of the CrossSubsetting {Id} disagrees with crossingFeature; the crossingFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!crossingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the CrossSubsetting {Id} disagrees with crossingFeature; the crossingFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!crossingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the CrossSubsetting {Id} disagrees with crossingFeature; the crossingFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -649,6 +816,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -843,10 +1020,85 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (subsettedFeatureRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!crossedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the CrossSubsetting {Id} disagrees with crossedFeature; the crossedFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DataTypeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DataTypeDeSerializer.cs index 4c6a123d9..7217dcce9 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DataTypeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DataTypeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.DataTypes; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DataTypeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDataType DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DataTypeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.DataTypes.DataType(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.DataTypes.DataType dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.DataTypes; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DataTypeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDataType DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DataTypeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.DataTypes.DataType(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.DataTypes.DataType dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -139,9 +139,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -972,11 +973,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1173,25 +1176,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the DataType: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.DataTypes.DataType dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.DataTypes.DataType dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1201,9 +1204,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1353,53 +1357,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the DataType: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the DataType: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DecisionNodeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DecisionNodeDeSerializer.cs index 83525cf6a..bd43559b4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DecisionNodeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DecisionNodeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DecisionNodeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDecisionNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DecisionNodeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.DecisionNode(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.DecisionNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DecisionNodeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDecisionNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DecisionNodeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.DecisionNode(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.DecisionNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the DecisionNode {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.DecisionNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.DecisionNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the DecisionNode: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DefinitionDeSerializer.cs index afb8b217b..802ab56ef 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.DefinitionAndUsage; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.DefinitionAndUsage; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -171,9 +171,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1575,11 +1576,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1904,25 +1907,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the Definition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Definition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1933,9 +1936,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2098,57 +2102,59 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Definition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Definition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DependencyDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DependencyDeSerializer.cs index 5d524267c..32bc194d1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DependencyDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DependencyDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Dependencies; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DependencyDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDependency DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DependencyDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Dependencies.Dependency(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Dependencies.Dependency dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Dependencies; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DependencyDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDependency DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DependencyDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Dependencies.Dependency(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Dependencies.Dependency dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var clientSeen = false; @@ -114,9 +114,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var supplierSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -508,11 +515,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!supplierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Dependency {Id} disagrees with supplier; the supplier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!clientSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Dependency {Id} disagrees with client; the client value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -609,25 +672,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Dependency: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Dependencies.Dependency dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Dependencies.Dependency dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var clientSeen = false; @@ -640,9 +703,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var supplierSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var supplierSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -850,65 +920,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!supplierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Dependency {Id} disagrees with supplier; the supplier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!clientSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Dependency {Id} disagrees with client; the client value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!clientSeen) - { + { logger.LogDebug("the client Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Dependency: {Id}", dtoInstance.Id); } if (!supplierSeen) - { + { logger.LogDebug("the supplier Json property was not found in the Dependency: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DifferencingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DifferencingDeSerializer.cs index e6ed9282e..6cfa51dca 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DifferencingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DifferencingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DifferencingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDifferencing DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DifferencingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Differencing(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Differencing dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DifferencingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDifferencing DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DifferencingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Differencing(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Differencing dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -114,9 +114,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var typeDifferencedSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typeDifferencedSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -516,11 +523,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!differencingTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Differencing {Id} disagrees with differencingType; the differencingType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typeDifferencedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Differencing {Id} disagrees with typeDifferenced; the typeDifferenced value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -617,25 +680,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!typeDifferencedSeen) { logger.LogDebug("the typeDifferenced Json property was not found in the Differencing: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Differencing dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Differencing dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -647,9 +710,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -843,61 +910,90 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!differencingTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Differencing {Id} disagrees with differencingType; the differencingType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!differencingTypeSeen) - { + { logger.LogDebug("the differencingType Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Differencing: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Differencing: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DisjoiningDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DisjoiningDeSerializer.cs index 9f73a0182..88908a1ef 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DisjoiningDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DisjoiningDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DisjoiningDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDisjoining DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DisjoiningDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Disjoining(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Disjoining dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DisjoiningDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDisjoining DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DisjoiningDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Disjoining(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Disjoining dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var typeDisjoinedSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typeDisjoinedSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +541,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!disjoiningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Disjoining {Id} disagrees with disjoiningType; the disjoiningType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typeDisjoinedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Disjoining {Id} disagrees with typeDisjoined; the typeDisjoined value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +702,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!typeDisjoinedSeen) { logger.LogDebug("the typeDisjoined Json property was not found in the Disjoining: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Disjoining dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Disjoining dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +733,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var typeDisjoinedSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typeDisjoinedSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +958,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!disjoiningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Disjoining {Id} disagrees with disjoiningType; the disjoiningType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typeDisjoinedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Disjoining {Id} disagrees with typeDisjoined; the typeDisjoined value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!disjoiningTypeSeen) - { + { logger.LogDebug("the disjoiningType Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Disjoining: {Id}", dtoInstance.Id); } if (!typeDisjoinedSeen) - { + { logger.LogDebug("the typeDisjoined Json property was not found in the Disjoining: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DocumentationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DocumentationDeSerializer.cs index 940e2d31c..65f9cd469 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DocumentationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/DocumentationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Annotations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class DocumentationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IDocumentation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DocumentationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Documentation(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Documentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Annotations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class DocumentationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IDocumentation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("DocumentationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.Documentation(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Documentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotationSeen = false; @@ -114,9 +114,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -506,11 +507,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -607,25 +610,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Documentation: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Documentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.Documentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var bodySeen = false; @@ -635,9 +638,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var localeSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -786,53 +790,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!bodySeen) - { + { logger.LogDebug("the body Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!localeSeen) - { + { logger.LogDebug("the locale Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Documentation: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Documentation: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ElementFilterMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ElementFilterMembershipDeSerializer.cs index e0d778f9b..3cc86d6d2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ElementFilterMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ElementFilterMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Packages; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ElementFilterMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IElementFilterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ElementFilterMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Packages; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ElementFilterMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IElementFilterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ElementFilterMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conditionSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ElementFilterMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!conditionSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ElementFilterMembership {Id} disagrees with condition; the condition value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ElementFilterMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!conditionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ElementFilterMembership {Id} disagrees with condition; the condition value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ElementFilterMembership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.ElementFilterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ElementFilterMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EndFeatureMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EndFeatureMembershipDeSerializer.cs index c932a46f3..84d894146 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EndFeatureMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EndFeatureMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class EndFeatureMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IEndFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EndFeatureMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class EndFeatureMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IEndFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EndFeatureMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the EndFeatureMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the EndFeatureMembership {Id} disagrees with ownedMemberFeature; the ownedMemberFeature value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the EndFeatureMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the EndFeatureMembership {Id} disagrees with ownedMemberFeature; the ownedMemberFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the EndFeatureMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.EndFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the EndFeatureMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs index ca8a4774d..b2c466aef 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Enumerations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class EnumerationDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IEnumerationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EnumerationDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Enumerations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class EnumerationDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IEnumerationDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EnumerationDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -171,9 +171,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var unioningTypeSeen = false; var usageSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1575,11 +1576,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1904,25 +1907,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1933,9 +1936,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2098,57 +2102,59 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the EnumerationDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationUsageDeSerializer.cs index bc094d839..9021eb23d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EnumerationUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Enumerations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class EnumerationUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IEnumerationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EnumerationUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Enumerations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class EnumerationUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IEnumerationUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EnumerationUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -198,9 +198,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2035,11 +2039,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the EnumerationUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2472,25 +2498,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Enumerations.EnumerationUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2509,9 +2535,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2775,89 +2802,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the EnumerationUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EventOccurrenceUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EventOccurrenceUsageDeSerializer.cs index 587c01ed5..ad99cdeb1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EventOccurrenceUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/EventOccurrenceUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Occurrences; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class EventOccurrenceUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IEventOccurrenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EventOccurrenceUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Occurrences; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class EventOccurrenceUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IEventOccurrenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("EventOccurrenceUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -202,9 +202,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2097,11 +2101,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the EventOccurrenceUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2550,25 +2576,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.EventOccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2589,9 +2615,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2878,97 +2905,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the EventOccurrenceUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExhibitStateUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExhibitStateUsageDeSerializer.cs index ddb765cc3..c95932d77 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExhibitStateUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExhibitStateUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ExhibitStateUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IExhibitStateUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ExhibitStateUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ExhibitStateUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IExhibitStateUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ExhibitStateUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -206,9 +206,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2165,11 +2169,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ExhibitStateUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2634,25 +2660,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.ExhibitStateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2674,9 +2700,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2976,101 +3003,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isParallelSeen) - { + { logger.LogDebug("the isParallel Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ExhibitStateUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExpressionDeSerializer.cs index 78ca24d6b..cb7f29935 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Expression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Expression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Expression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Expression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1433,11 +1434,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1742,25 +1745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Expression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Expression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Expression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1779,9 +1782,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2045,89 +2049,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Expression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Expression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainExpressionDeSerializer.cs index 0fc4ecc11..62e61bfe9 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureChainExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureChainExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureChainExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureChainExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureChainExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureChainExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -170,9 +170,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var targetFeatureSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1514,11 +1515,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1839,25 +1842,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureChainExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1877,9 +1880,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var operatorSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2158,93 +2162,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!operatorSeen) - { + { logger.LogDebug("the operator Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureChainExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainingDeSerializer.cs index ebf63cab8..d430d62a8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureChainingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureChainingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureChaining DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureChainingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureChaining(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureChaining dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureChainingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureChaining DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureChainingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureChaining(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureChaining dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -114,9 +114,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -516,11 +523,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!chainingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureChaining {Id} disagrees with chainingFeature; the chainingFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!featureChainedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureChaining {Id} disagrees with featureChained; the featureChained value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -617,25 +680,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureChaining dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureChaining dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -647,9 +710,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -843,61 +910,90 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!chainingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureChaining {Id} disagrees with chainingFeature; the chainingFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!chainingFeatureSeen) - { + { logger.LogDebug("the chainingFeature Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureChaining: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureDeSerializer.cs index 39298de56..017000500 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeature DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Feature(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Feature dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeature DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Feature(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Feature dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -163,9 +163,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1378,11 +1379,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1675,25 +1678,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Feature: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Feature dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Feature dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1712,9 +1715,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1978,89 +1982,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Feature: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Feature: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureInvertingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureInvertingDeSerializer.cs index bc7f55c15..3ffa1bbd8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureInvertingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureInvertingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureInvertingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureInverting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureInvertingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureInverting(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureInverting dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureInvertingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureInverting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureInvertingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureInverting(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureInverting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +541,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!invertingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureInverting {Id} disagrees with invertingFeature; the invertingFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!featureInvertedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureInverting {Id} disagrees with featureInverted; the featureInverted value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +702,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureInverting dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureInverting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +733,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +958,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!invertingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureInverting {Id} disagrees with invertingFeature; the invertingFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!featureInvertedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureInverting {Id} disagrees with featureInverted; the featureInverted value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!featureInvertedSeen) - { + { logger.LogDebug("the featureInverted Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!invertingFeatureSeen) - { + { logger.LogDebug("the invertingFeature Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureInverting: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureMembershipDeSerializer.cs index ac1bdd999..3f40056f7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.FeatureMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.FeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.FeatureMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.FeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the FeatureMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the FeatureMembership {Id} disagrees with ownedMemberFeature; the ownedMemberFeature value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the FeatureMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureMembership {Id} disagrees with ownedMemberFeature; the ownedMemberFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.FeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.FeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the FeatureMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureReferenceExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureReferenceExpressionDeSerializer.cs index 295e9e097..482ce2000 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureReferenceExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureReferenceExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureReferenceExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureReferenceExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureReferenceExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureReferenceExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureReferenceExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureReferenceExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1456,11 +1457,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1769,25 +1772,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.FeatureReferenceExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1806,9 +1809,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2072,89 +2076,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureReferenceExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs index d87e46fcd..fb2953829 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureTypingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureTypingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureTyping DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureTypingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureTyping(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureTypingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureTyping DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureTypingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.FeatureTyping(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,22 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var typedFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typedFeatureSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +547,113 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +754,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!typedFeatureSeen) { logger.LogDebug("the typedFeature Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.FeatureTyping dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +785,22 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; var typeSeen = false; - var typedFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typedFeatureSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +1016,167 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!typeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureTyping {Id} disagrees with type; the type value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureTyping {Id} disagrees with typedFeature; the typedFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!typeSeen) - { + { logger.LogDebug("the type Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); } if (!typedFeatureSeen) - { + { logger.LogDebug("the typedFeature Json property was not found in the FeatureTyping: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureValueDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureValueDeSerializer.cs index 5a983f620..b2207d52e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureValueDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FeatureValueDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.FeatureValues; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FeatureValueDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFeatureValue DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureValueDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.FeatureValues; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FeatureValueDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFeatureValue DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FeatureValueDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -121,9 +121,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var valueSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -616,11 +632,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the FeatureValue {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!valueSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the FeatureValue {Id} disagrees with value; the value value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the FeatureValue {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!valueSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FeatureValue {Id} disagrees with value; the value value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FeatureValue {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -745,25 +880,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.FeatureValues.FeatureValue dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -777,9 +912,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -987,69 +1123,71 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!isDefaultSeen) - { + { logger.LogDebug("the isDefault Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!isInitialSeen) - { + { logger.LogDebug("the isInitial Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the FeatureValue: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDeSerializer.cs index 619a9b0d7..beff247e6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDeSerializer.cs @@ -177,6 +177,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var unioningTypeSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1595,10 +1602,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Flow {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Flow {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1982,6 +2045,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2294,10 +2358,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDefinitionDeSerializer.cs index 6964154a0..bfc36ae54 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowDefinitionDeSerializer.cs @@ -182,6 +182,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1734,10 +1741,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FlowDefinition {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FlowDefinition {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) @@ -2134,6 +2197,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2358,10 +2422,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowEndDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowEndDeSerializer.cs index 0ad880e1c..db939cc1b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowEndDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowEndDeSerializer.cs @@ -165,6 +165,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1378,10 +1379,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1714,6 +1717,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1978,10 +1982,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowUsageDeSerializer.cs index 5f204e98c..b632d9d4b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FlowUsageDeSerializer.cs @@ -215,6 +215,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2291,10 +2301,86 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the FlowUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FlowUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FlowUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -2832,6 +2918,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var portionKindSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -3167,10 +3254,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForLoopActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForLoopActionUsageDeSerializer.cs index 4b042dc04..5b18f73a1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForLoopActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForLoopActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ForLoopActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IForLoopActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ForLoopActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ForLoopActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IForLoopActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ForLoopActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2143,11 +2147,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ForLoopActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2604,25 +2630,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2643,9 +2669,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2932,97 +2959,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ForLoopActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForkNodeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForkNodeDeSerializer.cs index 74148bdcb..27d71a0bf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForkNodeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ForkNodeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ForkNodeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IForkNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ForkNodeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ForkNode(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForkNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ForkNodeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IForkNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ForkNodeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.ForkNode(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForkNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ForkNode {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ForkNode: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForkNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.ForkNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ForkNode: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ForkNode: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs index 68ccb2f3b..7e4f6e192 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FramedConcernMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FramedConcernMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFramedConcernMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FramedConcernMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FramedConcernMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFramedConcernMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FramedConcernMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -120,9 +120,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -599,11 +615,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the FramedConcernMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedConcernSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the FramedConcernMembership {Id} disagrees with ownedConcern; the ownedConcern value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the FramedConcernMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedConcernSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the FramedConcernMembership {Id} disagrees with ownedConcern; the ownedConcern value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the FramedConcernMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -724,25 +859,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.FramedConcernMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -755,9 +890,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -949,65 +1085,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the FramedConcernMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FunctionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FunctionDeSerializer.cs index 0331ed5f2..db3547212 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FunctionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/FunctionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class FunctionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IFunction DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FunctionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Function(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Function dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class FunctionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IFunction DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("FunctionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Function(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Function dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -143,9 +143,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var stepSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1047,11 +1048,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1264,25 +1267,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Function: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Function dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Function dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1292,9 +1295,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1444,53 +1448,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Function: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Function: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IfActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IfActionUsageDeSerializer.cs index 59158b42e..d7043ca0b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IfActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IfActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class IfActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IIfActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IfActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class IfActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IIfActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IfActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2138,11 +2142,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the IfActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2599,25 +2625,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.IfActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2638,9 +2664,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2927,97 +2954,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the IfActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IncludeUseCaseUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IncludeUseCaseUsageDeSerializer.cs index 47519305f..2f85adcfc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IncludeUseCaseUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IncludeUseCaseUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.UseCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class IncludeUseCaseUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IIncludeUseCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IncludeUseCaseUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.UseCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class IncludeUseCaseUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IIncludeUseCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IncludeUseCaseUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -208,9 +208,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var useCaseDefinitionSeen = false; var useCaseIncludedSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2212,11 +2216,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the IncludeUseCaseUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2689,25 +2715,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.IncludeUseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2728,9 +2754,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3017,97 +3044,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the IncludeUseCaseUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IndexExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IndexExpressionDeSerializer.cs index d84189485..a50d6a140 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IndexExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IndexExpressionDeSerializer.cs @@ -171,6 +171,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1491,10 +1492,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1852,6 +1855,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2131,10 +2135,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InteractionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InteractionDeSerializer.cs index 8fa70034f..4a5a50993 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InteractionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InteractionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Interactions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class InteractionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IInteraction DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InteractionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Interactions.Interaction(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Interactions.Interaction dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Interactions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class InteractionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IInteraction DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InteractionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Interactions.Interaction(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Interactions.Interaction dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationEndSeen = false; @@ -146,9 +146,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var stepSeen = false; var targetTypeSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1098,11 +1105,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Interaction {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Interaction {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1327,25 +1390,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Interaction: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Interactions.Interaction dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Interactions.Interaction dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1358,9 +1421,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1558,65 +1622,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Interaction: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Interaction: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceDefinitionDeSerializer.cs index e4a3e665c..7cbe61abd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Interfaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class InterfaceDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IInterfaceDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InterfaceDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Interfaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class InterfaceDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IInterfaceDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InterfaceDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -178,9 +178,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1696,11 +1703,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the InterfaceDefinition {Id} disagrees with targetType; the targetType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the InterfaceDefinition {Id} disagrees with sourceType; the sourceType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2053,25 +2116,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2086,9 +2149,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2312,73 +2376,75 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the InterfaceDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceUsageDeSerializer.cs index 5087dc2a2..3f11164f2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InterfaceUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Interfaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class InterfaceUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IInterfaceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InterfaceUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Interfaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class InterfaceUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IInterfaceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InterfaceUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -211,9 +211,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2256,11 +2266,87 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the InterfaceUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the InterfaceUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the InterfaceUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2745,25 +2831,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Interfaces.InterfaceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2787,9 +2873,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3124,109 +3211,111 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the InterfaceUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IntersectingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IntersectingDeSerializer.cs index 43c7e8d5e..66484b74b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IntersectingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/IntersectingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class IntersectingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IIntersecting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IntersectingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Intersecting(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Intersecting dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class IntersectingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IIntersecting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("IntersectingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Intersecting(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Intersecting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -114,9 +114,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var typeIntersectedSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var typeIntersectedSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -516,11 +523,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!intersectingTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Intersecting {Id} disagrees with intersectingType; the intersectingType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typeIntersectedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Intersecting {Id} disagrees with typeIntersected; the typeIntersected value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -617,25 +680,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!typeIntersectedSeen) { logger.LogDebug("the typeIntersected Json property was not found in the Intersecting: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Intersecting dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Intersecting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -647,9 +710,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -843,61 +910,90 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!intersectingTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Intersecting {Id} disagrees with intersectingType; the intersectingType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!intersectingTypeSeen) - { + { logger.LogDebug("the intersectingType Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Intersecting: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Intersecting: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvariantDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvariantDeSerializer.cs index 062147293..39314c888 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvariantDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvariantDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class InvariantDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IInvariant DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InvariantDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Invariant(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Invariant dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class InvariantDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IInvariant DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InvariantDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Invariant(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Invariant dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1447,11 +1448,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1760,25 +1763,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Invariant: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Invariant dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Invariant dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1798,9 +1801,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2077,93 +2081,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isNegatedSeen) - { + { logger.LogDebug("the isNegated Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Invariant: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Invariant: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvocationExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvocationExpressionDeSerializer.cs index 630416494..78bd52e95 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvocationExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/InvocationExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class InvocationExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IInvocationExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InvocationExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class InvocationExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IInvocationExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("InvocationExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -168,9 +168,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1475,11 +1476,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1792,25 +1795,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.InvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1829,9 +1832,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2095,89 +2099,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the InvocationExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemDefinitionDeSerializer.cs index 6603d95fc..b071539dd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Items; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ItemDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IItemDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ItemDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Items.ItemDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Items; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ItemDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IItemDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ItemDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Items.ItemDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -172,9 +172,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1589,11 +1590,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1922,25 +1925,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1952,9 +1955,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2130,61 +2134,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ItemDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemUsageDeSerializer.cs index 27814a327..ecb664c6a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ItemUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Items; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ItemUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IItemUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ItemUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Items.ItemUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Items; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ItemUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IItemUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ItemUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Items.ItemUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -202,9 +202,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2093,11 +2097,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ItemUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2546,25 +2572,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Items.ItemUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2585,9 +2611,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2874,97 +2901,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ItemUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/JoinNodeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/JoinNodeDeSerializer.cs index 6b4deada0..0188cb459 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/JoinNodeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/JoinNodeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class JoinNodeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IJoinNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("JoinNodeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.JoinNode(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.JoinNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class JoinNodeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IJoinNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("JoinNodeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.JoinNode(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.JoinNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the JoinNode {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the JoinNode: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.JoinNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.JoinNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the JoinNode: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the JoinNode: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LibraryPackageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LibraryPackageDeSerializer.cs index 14a5faa61..cc2c820ad 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LibraryPackageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LibraryPackageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Packages; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LibraryPackageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILibraryPackage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LibraryPackageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Packages; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LibraryPackageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILibraryPackage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LibraryPackageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -116,9 +116,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -547,11 +548,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -656,25 +659,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.LibraryPackage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -683,9 +686,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isStandardSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -822,49 +826,51 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!isStandardSeen) - { + { logger.LogDebug("the isStandard Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LibraryPackage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralBooleanDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralBooleanDeSerializer.cs index 252914d61..ad54b1e7b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralBooleanDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralBooleanDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralBooleanDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralBoolean DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralBooleanDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralBooleanDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralBoolean DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralBooleanDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var typeSeen = false; var unioningTypeSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1447,11 +1448,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1760,25 +1763,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!valueSeen) { logger.LogDebug("the value Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralBoolean dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1798,9 +1801,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2077,93 +2081,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); } if (!valueSeen) - { + { logger.LogDebug("the value Json property was not found in the LiteralBoolean: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralExpressionDeSerializer.cs index f006be058..f8263e377 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1433,11 +1434,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1742,25 +1745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1779,9 +1782,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2045,89 +2049,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralInfinityDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralInfinityDeSerializer.cs index 737858c55..a9a4e7b40 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralInfinityDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralInfinityDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralInfinityDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralInfinity DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralInfinityDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralInfinityDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralInfinity DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralInfinityDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1433,11 +1434,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1742,25 +1745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInfinity dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1779,9 +1782,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2045,89 +2049,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralInfinity: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs index cdc979020..80f0810d8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralIntegerDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralIntegerDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralInteger DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralIntegerDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralIntegerDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralInteger DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralIntegerDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var typeSeen = false; var unioningTypeSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1444,11 +1445,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1757,25 +1760,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!valueSeen) { logger.LogDebug("the value Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralInteger dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1795,9 +1798,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2071,93 +2075,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); } if (!valueSeen) - { + { logger.LogDebug("the value Json property was not found in the LiteralInteger: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs index 040d2df14..baebf0d32 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralRationalDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralRationalDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralRational DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralRationalDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralRationalDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralRational DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralRationalDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var typeSeen = false; var unioningTypeSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1444,11 +1445,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1757,25 +1760,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!valueSeen) { logger.LogDebug("the value Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralRational dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1795,9 +1798,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2071,93 +2075,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); } if (!valueSeen) - { + { logger.LogDebug("the value Json property was not found in the LiteralRational: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralStringDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralStringDeSerializer.cs index 37391df2e..4f5ebe68b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralStringDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/LiteralStringDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class LiteralStringDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ILiteralString DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralStringDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class LiteralStringDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ILiteralString DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("LiteralStringDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var typeSeen = false; var unioningTypeSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1449,11 +1450,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1762,25 +1765,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!valueSeen) { logger.LogDebug("the value Json property was not found in the LiteralString: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.LiteralString dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1800,9 +1803,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var valueSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var valueSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2081,93 +2085,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the LiteralString: {Id}", dtoInstance.Id); } if (!valueSeen) - { + { logger.LogDebug("the value Json property was not found in the LiteralString: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipDeSerializer.cs index 103e9dfe8..c8f12fcd9 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Namespaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.Membership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Membership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Namespaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.Membership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Membership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +572,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!memberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Membership {Id} disagrees with memberElement; the memberElement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Membership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the Membership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Membership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Membership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -715,9 +778,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -941,73 +1008,102 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!memberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Membership {Id} disagrees with memberElement; the memberElement value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!memberElementSeen) - { + { logger.LogDebug("the memberElement Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!memberNameSeen) - { + { logger.LogDebug("the memberName Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!memberShortNameSeen) - { + { logger.LogDebug("the memberShortName Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Membership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the Membership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipExposeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipExposeDeSerializer.cs index 4aaff1198..7c2d155cc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipExposeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipExposeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MembershipExposeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMembershipExpose DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipExposeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.MembershipExpose(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.MembershipExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MembershipExposeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMembershipExpose DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipExposeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.MembershipExpose(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.MembershipExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -578,11 +585,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedMembershipSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the MembershipExpose {Id} disagrees with importedMembership; the importedMembership value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!importOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the MembershipExpose {Id} disagrees with importOwningNamespace; the importOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -695,25 +758,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.MembershipExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.MembershipExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +791,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -960,73 +1027,102 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedMembershipSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the MembershipExpose {Id} disagrees with importedMembership; the importedMembership value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!importedMembershipSeen) - { + { logger.LogDebug("the importedMembership Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!isImportAllSeen) - { + { logger.LogDebug("the isImportAll Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!isRecursiveSeen) - { + { logger.LogDebug("the isRecursive Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the MembershipExpose: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipImportDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipImportDeSerializer.cs index 1f2159a94..97f840206 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipImportDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MembershipImportDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Namespaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MembershipImportDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMembershipImport DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipImportDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Namespaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MembershipImportDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMembershipImport DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MembershipImportDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -578,11 +585,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedMembershipSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the MembershipImport {Id} disagrees with importedMembership; the importedMembership value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!importOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the MembershipImport {Id} disagrees with importOwningNamespace; the importOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -695,25 +758,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.MembershipImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +791,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -960,73 +1027,102 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedMembershipSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the MembershipImport {Id} disagrees with importedMembership; the importedMembership value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!importedMembershipSeen) - { + { logger.LogDebug("the importedMembership Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!isImportAllSeen) - { + { logger.LogDebug("the isImportAll Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!isRecursiveSeen) - { + { logger.LogDebug("the isRecursive Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the MembershipImport: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MergeNodeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MergeNodeDeSerializer.cs index e57936129..f7590340d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MergeNodeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MergeNodeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MergeNodeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMergeNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MergeNodeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.MergeNode(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.MergeNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MergeNodeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMergeNode DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MergeNodeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.MergeNode(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.MergeNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the MergeNode {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the MergeNode: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.MergeNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.MergeNode dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MergeNode: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the MergeNode: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetaclassDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetaclassDeSerializer.cs index 93714041c..1aa1a9c4f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetaclassDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetaclassDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Metadata; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MetaclassDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMetaclass DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetaclassDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Metadata; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MetaclassDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMetaclass DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetaclassDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -139,9 +139,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -972,11 +973,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1173,25 +1176,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Metaclass: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.Metaclass dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1201,9 +1204,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1353,53 +1357,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Metaclass: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Metaclass: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataAccessExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataAccessExpressionDeSerializer.cs index beceb2419..84246b8ca 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataAccessExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataAccessExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MetadataAccessExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMetadataAccessExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataAccessExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MetadataAccessExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMetadataAccessExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataAccessExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -167,9 +167,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1456,11 +1457,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1769,25 +1772,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.MetadataAccessExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1806,9 +1809,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2072,89 +2076,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MetadataAccessExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataDefinitionDeSerializer.cs index bafa81a2e..b19fa9cda 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Metadata; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MetadataDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMetadataDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Metadata; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MetadataDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMetadataDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -172,9 +172,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1589,11 +1590,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1922,25 +1925,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1952,9 +1955,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2130,61 +2134,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MetadataDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataFeatureDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataFeatureDeSerializer.cs index c742277db..4fa0766d7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataFeatureDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataFeatureDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Metadata; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MetadataFeatureDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMetadataFeature DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataFeatureDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Metadata; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MetadataFeatureDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMetadataFeature DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataFeatureDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -168,9 +168,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1471,11 +1472,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1788,25 +1791,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Metadata.MetadataFeature dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1825,9 +1828,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2091,89 +2095,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MetadataFeature: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataUsageDeSerializer.cs index 191ab2033..927aad20e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MetadataUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Metadata; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MetadataUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMetadataUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Metadata; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MetadataUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMetadataUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MetadataUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotatedElementSeen = false; @@ -206,9 +206,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2167,11 +2171,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the MetadataUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2636,25 +2662,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Metadata.MetadataUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2675,9 +2701,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2964,97 +2991,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the MetadataUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityDeSerializer.cs index e8f48dd53..ad5858230 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MultiplicityDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMultiplicity DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MultiplicityDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Multiplicity(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Multiplicity dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MultiplicityDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMultiplicity DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MultiplicityDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Multiplicity(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Multiplicity dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -163,9 +163,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1378,11 +1379,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1675,25 +1678,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Multiplicity dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Multiplicity dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1712,9 +1715,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1978,89 +1982,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Multiplicity: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs index 3fddfac13..8e913291c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/MultiplicityRangeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Multiplicities; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class MultiplicityRangeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IMultiplicityRange DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MultiplicityRangeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Multiplicities; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class MultiplicityRangeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IMultiplicityRange DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("MultiplicityRangeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var boundSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var typeSeen = false; var unioningTypeSeen = false; - var upperBoundSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var upperBoundSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1438,11 +1439,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1747,25 +1750,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!upperBoundSeen) { logger.LogDebug("the upperBound Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Multiplicities.MultiplicityRange dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1784,9 +1787,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2050,89 +2054,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the MultiplicityRange: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceDeSerializer.cs index f99c214c6..aa3b64430 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Namespaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class NamespaceDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static INamespace DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.Namespace(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Namespace dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Namespaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class NamespaceDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static INamespace DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.Namespace(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Namespace dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -114,9 +114,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -514,11 +515,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -615,25 +618,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Namespace: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Namespace dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.Namespace dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -641,9 +644,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var elementIdSeen = false; var isImpliedIncludedSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -767,45 +771,47 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Namespace: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Namespace: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceExposeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceExposeDeSerializer.cs index aa387f002..0843c90aa 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceExposeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceExposeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class NamespaceExposeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static INamespaceExpose DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceExposeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class NamespaceExposeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static INamespaceExpose DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceExposeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -578,11 +585,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the NamespaceExpose {Id} disagrees with importedNamespace; the importedNamespace value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!importOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the NamespaceExpose {Id} disagrees with importOwningNamespace; the importOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -695,25 +758,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.NamespaceExpose dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +791,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -960,73 +1027,102 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the NamespaceExpose {Id} disagrees with importedNamespace; the importedNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!importedNamespaceSeen) - { + { logger.LogDebug("the importedNamespace Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!isImportAllSeen) - { + { logger.LogDebug("the isImportAll Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!isRecursiveSeen) - { + { logger.LogDebug("the isRecursive Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the NamespaceExpose: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceImportDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceImportDeSerializer.cs index 746477024..22b53849a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceImportDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NamespaceImportDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Namespaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class NamespaceImportDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static INamespaceImport DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceImportDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Namespaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class NamespaceImportDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static INamespaceImport DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NamespaceImportDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -578,11 +585,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the NamespaceImport {Id} disagrees with importedNamespace; the importedNamespace value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!importOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the NamespaceImport {Id} disagrees with importOwningNamespace; the importOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -695,25 +758,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.NamespaceImport dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +791,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -960,73 +1027,102 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!importedNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the NamespaceImport {Id} disagrees with importedNamespace; the importedNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!importedNamespaceSeen) - { + { logger.LogDebug("the importedNamespace Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!isImportAllSeen) - { + { logger.LogDebug("the isImportAll Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!isRecursiveSeen) - { + { logger.LogDebug("the isRecursive Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the NamespaceImport: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NullExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NullExpressionDeSerializer.cs index bba84b7d1..b1f550a2d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NullExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/NullExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class NullExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static INullExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NullExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class NullExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static INullExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("NullExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -166,9 +166,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1433,11 +1434,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1742,25 +1745,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the NullExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.NullExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1779,9 +1782,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2045,89 +2049,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the NullExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the NullExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ObjectiveMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ObjectiveMembershipDeSerializer.cs index 880c8b030..0b7f9859f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ObjectiveMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ObjectiveMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Cases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ObjectiveMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IObjectiveMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ObjectiveMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Cases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ObjectiveMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IObjectiveMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ObjectiveMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ObjectiveMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedObjectiveRequirementSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ObjectiveMembership {Id} disagrees with ownedObjectiveRequirement; the ownedObjectiveRequirement value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ObjectiveMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedObjectiveRequirementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ObjectiveMembership {Id} disagrees with ownedObjectiveRequirement; the ownedObjectiveRequirement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ObjectiveMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Cases.ObjectiveMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ObjectiveMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceDefinitionDeSerializer.cs index d03eb1226..91e006de3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Occurrences; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class OccurrenceDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IOccurrenceDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OccurrenceDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Occurrences; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class OccurrenceDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IOccurrenceDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OccurrenceDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -172,9 +172,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1589,11 +1590,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1922,25 +1925,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1952,9 +1955,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2130,61 +2134,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the OccurrenceDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceUsageDeSerializer.cs index e2f5f8af5..7d599e6fa 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OccurrenceUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Occurrences; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class OccurrenceUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IOccurrenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OccurrenceUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Occurrences; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class OccurrenceUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IOccurrenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OccurrenceUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the OccurrenceUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Occurrences.OccurrenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the OccurrenceUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OperatorExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OperatorExpressionDeSerializer.cs index 641bb15d3..a57f527fd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OperatorExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OperatorExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class OperatorExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IOperatorExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OperatorExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class OperatorExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IOperatorExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OperatorExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -169,9 +169,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1491,11 +1492,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1812,25 +1815,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.OperatorExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1850,9 +1853,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var operatorSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2131,93 +2135,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!operatorSeen) - { + { logger.LogDebug("the operator Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the OperatorExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs index 07692cd2e..6d1436330 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/OwningMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Namespaces; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class OwningMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IOwningMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OwningMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Namespaces; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class OwningMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IOwningMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("OwningMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the OwningMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the OwningMembership {Id} disagrees with ownedMemberElement; the ownedMemberElement value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the OwningMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberElementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the OwningMembership {Id} disagrees with ownedMemberElement; the ownedMemberElement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the OwningMembership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Namespaces.OwningMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the OwningMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PackageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PackageDeSerializer.cs index 6f6aff59b..be46a8819 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PackageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PackageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Packages; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PackageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPackage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PackageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.Package(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.Package dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Packages; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PackageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPackage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PackageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Packages.Package(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.Package dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var qualifiedNameSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -533,11 +534,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -638,25 +641,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Package: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.Package dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Packages.Package dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -664,9 +667,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var elementIdSeen = false; var isImpliedIncludedSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -790,45 +794,47 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Package: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Package: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ParameterMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ParameterMembershipDeSerializer.cs index 4df6fbc4f..f052e185c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ParameterMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ParameterMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Behaviors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ParameterMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IParameterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ParameterMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Behaviors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ParameterMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IParameterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ParameterMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ParameterMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ParameterMembership {Id} disagrees with ownedMemberParameter; the ownedMemberParameter value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ParameterMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ParameterMembership {Id} disagrees with ownedMemberParameter; the ownedMemberParameter value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ParameterMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.ParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ParameterMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartDefinitionDeSerializer.cs index cb122ff92..8f9079d03 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Parts; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PartDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPartDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PartDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Parts.PartDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Parts; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PartDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPartDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PartDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Parts.PartDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -172,9 +172,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1589,11 +1590,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1922,25 +1925,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1952,9 +1955,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2130,61 +2134,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PartDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartUsageDeSerializer.cs index 9e07cfa92..7f0069bcf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PartUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Parts; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PartUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPartUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PartUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Parts.PartUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Parts; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PartUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPartUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PartUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Parts.PartUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -203,9 +203,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2112,11 +2116,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the PartUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2569,25 +2595,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the PartUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Parts.PartUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2608,9 +2634,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2897,97 +2924,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PartUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the PartUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PayloadFeatureDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PayloadFeatureDeSerializer.cs index 454a58db3..575616b75 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PayloadFeatureDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PayloadFeatureDeSerializer.cs @@ -165,6 +165,7 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var typeSeen = false; var unioningTypeSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1378,10 +1379,12 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1714,6 +1717,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1978,10 +1982,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PerformActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PerformActionUsageDeSerializer.cs index cd91496d3..93f4e715e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PerformActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PerformActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PerformActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPerformActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PerformActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PerformActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPerformActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PerformActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -202,9 +202,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2097,11 +2101,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the PerformActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2550,25 +2576,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.PerformActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2589,9 +2615,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2878,97 +2905,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the PerformActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortConjugationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortConjugationDeSerializer.cs index 2663d0c13..acfe0cb7d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortConjugationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortConjugationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Ports; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PortConjugationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPortConjugation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortConjugationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortConjugation(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortConjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Ports; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PortConjugationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPortConjugation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortConjugationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortConjugation(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortConjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedPortDefinitionSeen = false; @@ -115,9 +115,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var originalTypeRedefinitionSeen = false; + Guid? originalTypeRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -539,11 +549,90 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("originalType"u8)) + { + originalTypeRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + originalTypeRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (originalTypeRedefinitionSeen) + { + if (!originalPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.IConjugation)dtoInstance).OriginalType = (originalTypeRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.IConjugation)dtoInstance).OriginalType != (originalTypeRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The originalType Json property of the PortConjugation {Id} disagrees with originalPortDefinition; the originalPortDefinition value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!originalPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the PortConjugation {Id} disagrees with originalPortDefinition; the originalPortDefinition value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!conjugatedTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the PortConjugation {Id} disagrees with conjugatedType; the conjugatedType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -644,25 +733,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortConjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortConjugation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedTypeSeen = false; @@ -675,9 +764,19 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var originalTypeRedefinitionSeen = false; + Guid? originalTypeRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -893,65 +992,144 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("originalType"u8)) + { + originalTypeRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + originalTypeRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (originalTypeRedefinitionSeen) + { + if (!originalPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.IConjugation)dtoInstance).OriginalType = (originalTypeRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.IConjugation)dtoInstance).OriginalType != (originalTypeRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The originalType Json property of the PortConjugation {Id} disagrees with originalPortDefinition; the originalPortDefinition value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!originalPortDefinitionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the PortConjugation {Id} disagrees with originalPortDefinition; the originalPortDefinition value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!conjugatedTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the PortConjugation {Id} disagrees with conjugatedType; the conjugatedType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!conjugatedTypeSeen) - { + { logger.LogDebug("the conjugatedType Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!originalPortDefinitionSeen) - { + { logger.LogDebug("the originalPortDefinition Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PortConjugation: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortDefinitionDeSerializer.cs index d77afb586..a868d1d33 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Ports; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PortDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPortDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Ports; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PortDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPortDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var conjugatedPortDefinitionSeen = false; @@ -173,9 +173,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1607,11 +1608,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1944,25 +1947,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1974,9 +1977,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2152,61 +2156,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PortDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortUsageDeSerializer.cs index 82cb4da03..9da3af995 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PortUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Ports; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PortUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPortUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Ports; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PortUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPortUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PortUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Ports.PortUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -201,9 +201,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2074,11 +2078,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the PortUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2523,25 +2549,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the PortUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Ports.PortUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2562,9 +2588,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2851,97 +2878,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the PortUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the PortUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PredicateDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PredicateDeSerializer.cs index 93966e5e9..1ee4955cf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PredicateDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/PredicateDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class PredicateDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IPredicate DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PredicateDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Predicate(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Predicate dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class PredicateDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IPredicate DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("PredicateDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.Predicate(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Predicate dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -143,9 +143,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var stepSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1047,11 +1048,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1264,25 +1267,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Predicate: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Predicate dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.Predicate dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1292,9 +1295,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1444,53 +1448,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Predicate: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Predicate: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RedefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RedefinitionDeSerializer.cs index da29e4ad7..99a053dea 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RedefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RedefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RedefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRedefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RedefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Redefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Redefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RedefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRedefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RedefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Redefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Redefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,28 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var redefiningFeatureSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var subsettingFeatureRedefinitionSeen = false; + Guid? subsettingFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +553,159 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("subsettingFeature"u8)) + { + subsettingFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettingFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (subsettedFeatureRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (subsettingFeatureRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature = (subsettingFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature != (subsettingFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettingFeature Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +806,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Redefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Redefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Redefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +837,28 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; var redefinedFeatureSeen = false; - var redefiningFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var redefiningFeatureSeen = false; + + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var subsettingFeatureRedefinitionSeen = false; + Guid? subsettingFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +1074,213 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("subsettingFeature"u8)) + { + subsettingFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettingFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (subsettedFeatureRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (subsettingFeatureRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature = (subsettingFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature != (subsettingFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettingFeature Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!redefinedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Redefinition {Id} disagrees with redefinedFeature; the redefinedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!redefiningFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Redefinition {Id} disagrees with redefiningFeature; the redefiningFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!redefinedFeatureSeen) - { + { logger.LogDebug("the redefinedFeature Json property was not found in the Redefinition: {Id}", dtoInstance.Id); } if (!redefiningFeatureSeen) - { + { logger.LogDebug("the redefiningFeature Json property was not found in the Redefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs index 231f927a8..37e7d676c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceSubsettingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ReferenceSubsettingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IReferenceSubsetting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReferenceSubsettingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ReferenceSubsettingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IReferenceSubsetting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReferenceSubsettingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -114,9 +114,28 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var referencingFeatureSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var subsettingFeatureRedefinitionSeen = false; + Guid? subsettingFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -516,11 +535,159 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("subsettingFeature"u8)) + { + subsettingFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettingFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (subsettedFeatureRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (subsettingFeatureRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature = (subsettingFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettingFeature != (subsettingFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettingFeature Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!referencingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ReferenceSubsetting {Id} disagrees with referencingFeature; the referencingFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -617,25 +784,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.ReferenceSubsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -647,9 +814,19 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var referencedFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var referencedFeatureSeen = false; + + var subsettedFeatureRedefinitionSeen = false; + Guid? subsettedFeatureRedefinitionValue = null; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -843,61 +1020,136 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("subsettedFeature"u8)) + { + subsettedFeatureRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + subsettedFeatureRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (subsettedFeatureRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature = (subsettedFeatureRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Features.ISubsetting)dtoInstance).SubsettedFeature != (subsettedFeatureRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The subsettedFeature Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (generalRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!referencedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ReferenceSubsetting {Id} disagrees with referencedFeature; the referencedFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); } if (!referencedFeatureSeen) - { + { logger.LogDebug("the referencedFeature Json property was not found in the ReferenceSubsetting: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceUsageDeSerializer.cs index aefdb328d..2b28c0c9b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReferenceUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.DefinitionAndUsage; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ReferenceUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IReferenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReferenceUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.DefinitionAndUsage; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ReferenceUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IReferenceUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReferenceUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -198,9 +198,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2031,11 +2035,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ReferenceUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2468,25 +2494,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.ReferenceUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2505,9 +2531,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2771,89 +2798,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ReferenceUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingDefinitionDeSerializer.cs index df2a4de8e..64909d07e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RenderingDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRenderingDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RenderingDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RenderingDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRenderingDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RenderingDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -173,9 +173,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1608,11 +1609,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1945,25 +1948,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1975,9 +1978,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2153,61 +2157,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RenderingDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingUsageDeSerializer.cs index a8cd05b2b..0631b40bf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RenderingUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RenderingUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRenderingUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RenderingUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.RenderingUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RenderingUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRenderingUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RenderingUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.RenderingUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -203,9 +203,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2111,11 +2115,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the RenderingUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2568,25 +2594,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.RenderingUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2607,9 +2633,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2896,97 +2923,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the RenderingUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementConstraintMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementConstraintMembershipDeSerializer.cs index eb95b3b87..8d4ccf583 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementConstraintMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementConstraintMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RequirementConstraintMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRequirementConstraintMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementConstraintMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RequirementConstraintMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRequirementConstraintMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementConstraintMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -120,9 +120,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -599,11 +615,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the RequirementConstraintMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedConstraintSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the RequirementConstraintMembership {Id} disagrees with ownedConstraint; the ownedConstraint value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the RequirementConstraintMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedConstraintSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the RequirementConstraintMembership {Id} disagrees with ownedConstraint; the ownedConstraint value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the RequirementConstraintMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -724,25 +859,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementConstraintMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -755,9 +890,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -949,65 +1085,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the RequirementConstraintMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementDefinitionDeSerializer.cs index 925a07c48..93fe0bbb1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RequirementDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRequirementDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RequirementDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRequirementDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -183,9 +183,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1803,11 +1807,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2180,25 +2206,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2210,9 +2236,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2388,61 +2418,83 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the RequirementDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs index ef29b8d05..dfa8bafdb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RequirementUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRequirementUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RequirementUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRequirementUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -211,9 +211,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2268,11 +2275,53 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the RequirementUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2757,25 +2806,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.RequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2796,9 +2845,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; var portionKindSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3085,97 +3138,119 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the RequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the RequirementUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementVerificationMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementVerificationMembershipDeSerializer.cs index c3f0da92a..3852a721d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementVerificationMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/RequirementVerificationMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.VerificationCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class RequirementVerificationMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IRequirementVerificationMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementVerificationMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.VerificationCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class RequirementVerificationMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IRequirementVerificationMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("RequirementVerificationMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -120,9 +120,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var verifiedRequirementSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -599,11 +615,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the RequirementVerificationMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedRequirementSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the RequirementVerificationMembership {Id} disagrees with ownedRequirement; the ownedRequirement value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the RequirementVerificationMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedRequirementSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the RequirementVerificationMembership {Id} disagrees with ownedRequirement; the ownedRequirement value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the RequirementVerificationMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -724,25 +859,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.RequirementVerificationMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -755,9 +890,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -949,65 +1085,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the RequirementVerificationMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ResultExpressionMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ResultExpressionMembershipDeSerializer.cs index 95a70fb64..9576ebabf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ResultExpressionMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ResultExpressionMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ResultExpressionMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IResultExpressionMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ResultExpressionMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ResultExpressionMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IResultExpressionMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ResultExpressionMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ResultExpressionMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedResultExpressionSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ResultExpressionMembership {Id} disagrees with ownedResultExpression; the ownedResultExpression value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ResultExpressionMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedResultExpressionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ResultExpressionMembership {Id} disagrees with ownedResultExpression; the ownedResultExpression value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ResultExpressionMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ResultExpressionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ResultExpressionMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReturnParameterMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReturnParameterMembershipDeSerializer.cs index aab14ff5f..c379b788b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReturnParameterMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ReturnParameterMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Functions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ReturnParameterMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IReturnParameterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReturnParameterMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Functions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ReturnParameterMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IReturnParameterMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ReturnParameterMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ReturnParameterMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedMemberParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ReturnParameterMembership {Id} disagrees with ownedMemberParameter; the ownedMemberParameter value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ReturnParameterMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedMemberParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ReturnParameterMembership {Id} disagrees with ownedMemberParameter; the ownedMemberParameter value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ReturnParameterMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Functions.ReturnParameterMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ReturnParameterMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SatisfyRequirementUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SatisfyRequirementUsageDeSerializer.cs index 6bee86efd..bd485caa6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SatisfyRequirementUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SatisfyRequirementUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SatisfyRequirementUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISatisfyRequirementUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SatisfyRequirementUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SatisfyRequirementUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISatisfyRequirementUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SatisfyRequirementUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -214,9 +214,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2328,11 +2335,53 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the SatisfyRequirementUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the SatisfyRequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2829,25 +2878,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SatisfyRequirementUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2869,9 +2918,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; var portionKindSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3171,101 +3224,123 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the SatisfyRequirementUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isNegatedSeen) - { + { logger.LogDebug("the isNegated Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the SatisfyRequirementUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs index adf62ea85..f8fe78e9a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SelectExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Expressions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SelectExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISelectExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SelectExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Expressions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SelectExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISelectExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SelectExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -169,9 +169,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1491,11 +1492,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1812,25 +1815,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Expressions.SelectExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1850,9 +1853,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var operatorSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2131,93 +2135,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!operatorSeen) - { + { logger.LogDebug("the operator Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the SelectExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SendActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SendActionUsageDeSerializer.cs index b1c4deb23..a9bd97791 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SendActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SendActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SendActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISendActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SendActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SendActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISendActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SendActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2128,11 +2132,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the SendActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2589,25 +2615,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.SendActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2628,9 +2654,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2917,97 +2944,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the SendActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SpecializationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SpecializationDeSerializer.cs index d9c570a04..0bf931d02 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SpecializationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SpecializationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SpecializationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISpecialization DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SpecializationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Specialization(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Specialization dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SpecializationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISpecialization DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SpecializationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Specialization(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Specialization dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var specificSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +541,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!generalSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Specialization {Id} disagrees with general; the general value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!specificSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Specialization {Id} disagrees with specific; the specific value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +702,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Specialization: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Specialization dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Specialization dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +733,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var specificSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var specificSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +958,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!generalSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Specialization {Id} disagrees with general; the general value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!specificSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Specialization {Id} disagrees with specific; the specific value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!generalSeen) - { + { logger.LogDebug("the general Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Specialization: {Id}", dtoInstance.Id); } if (!specificSeen) - { + { logger.LogDebug("the specific Json property was not found in the Specialization: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StakeholderMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StakeholderMembershipDeSerializer.cs index ebb18ec5c..d6a373d07 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StakeholderMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StakeholderMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StakeholderMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStakeholderMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StakeholderMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StakeholderMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStakeholderMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StakeholderMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the StakeholderMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedStakeholderParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the StakeholderMembership {Id} disagrees with ownedStakeholderParameter; the ownedStakeholderParameter value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the StakeholderMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedStakeholderParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the StakeholderMembership {Id} disagrees with ownedStakeholderParameter; the ownedStakeholderParameter value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the StakeholderMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.StakeholderMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the StakeholderMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateDefinitionDeSerializer.cs index d7d2a70d2..a7709d9e1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StateDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStateDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StateDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStateDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var aliasIdsSeen = false; @@ -179,9 +179,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1714,11 +1715,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2075,25 +2078,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2106,9 +2109,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2297,65 +2301,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isParallelSeen) - { + { logger.LogDebug("the isParallel Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the StateDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateSubactionMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateSubactionMembershipDeSerializer.cs index 8c9e239f4..a0144b175 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateSubactionMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateSubactionMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StateSubactionMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStateSubactionMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateSubactionMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StateSubactionMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStateSubactionMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateSubactionMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var aliasIdsSeen = false; @@ -119,9 +119,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -576,11 +592,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the StateSubactionMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!actionSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the StateSubactionMembership {Id} disagrees with action; the action value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the StateSubactionMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!actionSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the StateSubactionMembership {Id} disagrees with action; the action value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the StateSubactionMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -697,25 +832,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateSubactionMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +863,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -922,65 +1058,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the StateSubactionMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateUsageDeSerializer.cs index ccaca1ff3..65900d6f3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StateUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StateUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStateUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StateUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStateUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StateUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.StateUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -205,9 +205,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2142,11 +2146,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the StateUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2607,25 +2633,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the StateUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.StateUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2647,9 +2673,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2949,101 +2976,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isParallelSeen) - { + { logger.LogDebug("the isParallel Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the StateUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the StateUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StepDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StepDeSerializer.cs index ebaefa9ed..8fbde6a1b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StepDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StepDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Behaviors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StepDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStep DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StepDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.Step(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Step dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Behaviors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StepDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStep DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StepDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Behaviors.Step(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Step dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var behaviorSeen = false; @@ -164,9 +164,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1397,11 +1398,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1698,25 +1701,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Step: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Step dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Behaviors.Step dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1735,9 +1738,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariableSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2001,89 +2005,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Step: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Step: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StructureDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StructureDeSerializer.cs index ecc7c1f32..b008ed296 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StructureDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/StructureDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Structures; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class StructureDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IStructure DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StructureDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Structures.Structure(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Structures.Structure dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Structures; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class StructureDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IStructure DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("StructureDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Structures.Structure(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Structures.Structure dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -139,9 +139,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -972,11 +973,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1173,25 +1176,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Structure: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Structures.Structure dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Structures.Structure dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1201,9 +1204,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1353,53 +1357,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Structure: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Structure: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs index 425390465..2163d9b42 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubclassificationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Classifiers; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SubclassificationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISubclassification DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubclassificationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Classifiers.Subclassification(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Subclassification dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Classifiers; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SubclassificationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISubclassification DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubclassificationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Classifiers.Subclassification(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Subclassification dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,22 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var subclassifierSeen = false; var superclassifierSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +547,113 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +754,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Subclassification: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Subclassification dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Classifiers.Subclassification dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +785,22 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; var subclassifierSeen = false; - var superclassifierSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var superclassifierSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +1016,167 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!superclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subclassification {Id} disagrees with superclassifier; the superclassifier value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subclassifierSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subclassification {Id} disagrees with subclassifier; the subclassifier value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!subclassifierSeen) - { + { logger.LogDebug("the subclassifier Json property was not found in the Subclassification: {Id}", dtoInstance.Id); } if (!superclassifierSeen) - { + { logger.LogDebug("the superclassifier Json property was not found in the Subclassification: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubjectMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubjectMembershipDeSerializer.cs index e9c09a635..d26a40aae 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubjectMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubjectMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Requirements; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SubjectMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISubjectMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubjectMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Requirements; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SubjectMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISubjectMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubjectMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the SubjectMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedSubjectParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the SubjectMembership {Id} disagrees with ownedSubjectParameter; the ownedSubjectParameter value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the SubjectMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedSubjectParameterSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the SubjectMembership {Id} disagrees with ownedSubjectParameter; the ownedSubjectParameter value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the SubjectMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Requirements.SubjectMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the SubjectMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubsettingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubsettingDeSerializer.cs index ec78801c9..c385583bb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubsettingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SubsettingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SubsettingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISubsetting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubsettingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Subsetting(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Subsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SubsettingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISubsetting DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SubsettingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.Subsetting(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Subsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,22 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var subsettedFeatureSeen = false; var subsettingFeatureSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +547,113 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!subsettedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subsetting {Id} disagrees with subsettedFeature; the subsettedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subsettingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subsetting {Id} disagrees with subsettingFeature; the subsettingFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!subsettedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subsetting {Id} disagrees with subsettedFeature; the subsettedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subsettingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subsetting {Id} disagrees with subsettingFeature; the subsettingFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +754,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the Subsetting: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Subsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.Subsetting dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +785,22 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; var subsettedFeatureSeen = false; - var subsettingFeatureSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var subsettingFeatureSeen = false; + + var generalRedefinitionSeen = false; + Guid? generalRedefinitionValue = null; + + var specificRedefinitionSeen = false; + Guid? specificRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +1016,167 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("general"u8)) + { + generalRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + generalRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("specific"u8)) + { + specificRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + specificRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (generalRedefinitionSeen) + { + if (!subsettedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General = (generalRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).General != (generalRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The general Json property of the Subsetting {Id} disagrees with subsettedFeature; the subsettedFeature value is kept", dtoInstance.Id); + } + } + + if (specificRedefinitionSeen) + { + if (!subsettingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific = (specificRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Core.Types.ISpecialization)dtoInstance).Specific != (specificRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The specific Json property of the Subsetting {Id} disagrees with subsettingFeature; the subsettingFeature value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!subsettedFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Subsetting {Id} disagrees with subsettedFeature; the subsettedFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!subsettingFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Subsetting {Id} disagrees with subsettingFeature; the subsettingFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!subsettedFeatureSeen) - { + { logger.LogDebug("the subsettedFeature Json property was not found in the Subsetting: {Id}", dtoInstance.Id); } if (!subsettingFeatureSeen) - { + { logger.LogDebug("the subsettingFeature Json property was not found in the Subsetting: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionAsUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionAsUsageDeSerializer.cs index b16b76227..138c8192d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionAsUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionAsUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Connections; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SuccessionAsUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISuccessionAsUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SuccessionAsUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Connections; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SuccessionAsUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISuccessionAsUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SuccessionAsUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationSeen = false; @@ -206,9 +206,19 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2175,11 +2185,87 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the SuccessionAsUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the SuccessionAsUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the SuccessionAsUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2644,25 +2730,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Connections.SuccessionAsUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2684,9 +2770,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2998,101 +3085,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the SuccessionAsUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionDeSerializer.cs index ec6593280..b89016636 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Kernel.Connectors; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class SuccessionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ISuccession DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SuccessionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.Succession(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Succession dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Kernel.Connectors; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class SuccessionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ISuccession DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("SuccessionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Kernel.Connectors.Succession(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Succession dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var associationSeen = false; @@ -170,9 +170,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var sourceFeatureSeen = false; var targetFeatureSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1503,11 +1510,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Succession {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Succession {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1828,25 +1891,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Succession: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Succession dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Kernel.Connectors.Succession dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1868,9 +1931,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2182,101 +2246,103 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Succession: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Succession: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowDeSerializer.cs index 1a06c79b3..bcebce311 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowDeSerializer.cs @@ -177,6 +177,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var textualRepresentationSeen = false; var unioningTypeSeen = false; + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -1595,10 +1602,66 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the SuccessionFlow {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the SuccessionFlow {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -1982,6 +2045,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelatedElementSeen = false; var owningRelationshipSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2294,10 +2358,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowUsageDeSerializer.cs index 16915415a..2d7d97e9b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/SuccessionFlowUsageDeSerializer.cs @@ -215,6 +215,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2291,10 +2301,86 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); reader.Skip(); } + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the SuccessionFlowUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!targetFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the SuccessionFlowUsage {Id} disagrees with targetFeature; the targetFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!sourceFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the SuccessionFlowUsage {Id} disagrees with sourceFeature; the sourceFeature value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) @@ -2832,6 +2918,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var portionKindSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -3167,10 +3254,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TerminateActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TerminateActionUsageDeSerializer.cs index 1be89c09a..1eb32ddf8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TerminateActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TerminateActionUsageDeSerializer.cs @@ -204,6 +204,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2092,10 +2096,32 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); reader.Skip(); } + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the TerminateActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) @@ -2586,6 +2612,7 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var owningRelationshipSeen = false; var portionKindSeen = false; + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) @@ -2873,10 +2900,12 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); reader.Skip(); } + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs index 1fe525dc4..d8c8ae2a7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TextualRepresentationDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Root.Annotations; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TextualRepresentationDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ITextualRepresentation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TextualRepresentationDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Root.Annotations; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TextualRepresentationDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ITextualRepresentation DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TextualRepresentationDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var annotationSeen = false; @@ -114,9 +114,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var representedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -511,11 +512,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -612,25 +615,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Root.Annotations.TextualRepresentation dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var bodySeen = false; @@ -640,9 +643,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var languageSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -796,53 +800,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!bodySeen) - { + { logger.LogDebug("the body Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!languageSeen) - { + { logger.LogDebug("the language Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the TextualRepresentation: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionFeatureMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionFeatureMembershipDeSerializer.cs index ff48ec2e4..59512b621 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionFeatureMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionFeatureMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TransitionFeatureMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ITransitionFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TransitionFeatureMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TransitionFeatureMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ITransitionFeatureMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TransitionFeatureMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -119,9 +119,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var transitionFeatureSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -576,11 +592,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the TransitionFeatureMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!transitionFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the TransitionFeatureMembership {Id} disagrees with transitionFeature; the transitionFeature value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the TransitionFeatureMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!transitionFeatureSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the TransitionFeatureMembership {Id} disagrees with transitionFeature; the transitionFeature value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the TransitionFeatureMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -697,25 +832,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionFeatureMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -728,9 +863,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -922,65 +1058,67 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the TransitionFeatureMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionUsageDeSerializer.cs index 19964e5d6..2272ebd48 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TransitionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.States; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TransitionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ITransitionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TransitionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.TransitionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.States; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TransitionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ITransitionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TransitionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.States.TransitionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -207,9 +207,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2200,11 +2204,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the TransitionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2673,25 +2699,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.States.TransitionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2712,9 +2738,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3001,97 +3028,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the TransitionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TriggerInvocationExpressionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TriggerInvocationExpressionDeSerializer.cs index a869537d2..9111c0643 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TriggerInvocationExpressionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TriggerInvocationExpressionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TriggerInvocationExpressionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ITriggerInvocationExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TriggerInvocationExpressionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TriggerInvocationExpressionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ITriggerInvocationExpression DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TriggerInvocationExpressionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var argumentSeen = false; @@ -169,9 +169,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1486,11 +1487,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1807,25 +1810,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.TriggerInvocationExpression dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1845,9 +1848,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariableSeen = false; var kindSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2121,93 +2125,95 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!isVariableSeen) - { + { logger.LogDebug("the isVariable Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!kindSeen) - { + { logger.LogDebug("the kind Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the TriggerInvocationExpression: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeDeSerializer.cs index f76ea2c75..db4e5d1b0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TypeDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IType DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TypeDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Type(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Type dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TypeDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IType DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TypeDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Type(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Type dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -138,9 +138,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -953,11 +954,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -1150,25 +1153,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Type: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Type dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Type dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -1178,9 +1181,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isImpliedIncludedSeen = false; var isSufficientSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1330,53 +1334,55 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Type: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Type: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeFeaturingDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeFeaturingDeSerializer.cs index 873132f4f..74f04837b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeFeaturingDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/TypeFeaturingDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Features; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class TypeFeaturingDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static ITypeFeaturing DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TypeFeaturingDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.TypeFeaturing(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.TypeFeaturing dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Features; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class TypeFeaturingDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static ITypeFeaturing DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("TypeFeaturingDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Features.TypeFeaturing(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.TypeFeaturing dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -115,9 +115,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var qualifiedNameSeen = false; var relatedElementSeen = false; var shortNameSeen = false; - var textualRepresentationSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var textualRepresentationSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -534,11 +541,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!featuringTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the TypeFeaturing {Id} disagrees with featuringType; the featuringType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!featureOfTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the TypeFeaturing {Id} disagrees with featureOfType; the featureOfType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -639,25 +702,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!textualRepresentationSeen) { logger.LogDebug("the textualRepresentation Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.TypeFeaturing dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Features.TypeFeaturing dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -670,9 +733,16 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelatedElementSeen = false; var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -888,65 +958,121 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!featuringTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the TypeFeaturing {Id} disagrees with featuringType; the featuringType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!featureOfTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the TypeFeaturing {Id} disagrees with featureOfType; the featureOfType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!featureOfTypeSeen) - { + { logger.LogDebug("the featureOfType Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!featuringTypeSeen) - { + { logger.LogDebug("the featuringType Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the TypeFeaturing: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UnioningDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UnioningDeSerializer.cs index 428c4ad1d..dad1cfe93 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UnioningDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UnioningDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Core.Types; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class UnioningDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IUnioning DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UnioningDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Unioning(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Unioning dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Core.Types; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class UnioningDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IUnioning DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UnioningDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Core.Types.Unioning(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Unioning dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -114,9 +114,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var shortNameSeen = false; var textualRepresentationSeen = false; var typeUnionedSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -516,11 +523,67 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!unioningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Unioning {Id} disagrees with unioningType; the unioningType value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!typeUnionedSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the Unioning {Id} disagrees with typeUnioned; the typeUnioned value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -617,25 +680,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!unioningTypeSeen) { logger.LogDebug("the unioningType Json property was not found in the Unioning: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Unioning dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Core.Types.Unioning dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -647,9 +710,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var unioningTypeSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var unioningTypeSeen = false; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -843,61 +910,90 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (targetRedefinitionSeen) + { + if (!unioningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the Unioning {Id} disagrees with unioningType; the unioningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Unioning: {Id}", dtoInstance.Id); } if (!unioningTypeSeen) - { + { logger.LogDebug("the unioningType Json property was not found in the Unioning: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UsageDeSerializer.cs index 7324d9e61..ab1e1872c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.DefinitionAndUsage; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class UsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.DefinitionAndUsage; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class UsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -198,9 +198,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2031,11 +2035,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the Usage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2468,25 +2494,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the Usage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.Usage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2505,9 +2531,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isUniqueSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2771,89 +2798,91 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the Usage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the Usage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseDefinitionDeSerializer.cs index e18b1d7b5..d80f84c8f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.UseCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class UseCaseDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IUseCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UseCaseDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.UseCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class UseCaseDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IUseCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UseCaseDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var actorParameterSeen = false; @@ -182,9 +182,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var unioningTypeSeen = false; var usageSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1781,11 +1782,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2154,25 +2157,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2184,9 +2187,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2362,61 +2366,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the UseCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseUsageDeSerializer.cs index 2c7b117d5..8da45815f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/UseCaseUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.UseCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class UseCaseUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IUseCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UseCaseUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.UseCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class UseCaseUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IUseCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("UseCaseUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -207,9 +207,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var useCaseDefinitionSeen = false; var variantSeen = false; - var variantMembershipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var variantMembershipSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2189,11 +2193,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the UseCaseUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2662,25 +2688,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!variantMembershipSeen) { logger.LogDebug("the variantMembership Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.UseCases.UseCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2701,9 +2727,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2990,97 +3017,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the UseCaseUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VariantMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VariantMembershipDeSerializer.cs index 06e136dc7..ac6c1d66e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VariantMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VariantMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.DefinitionAndUsage; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class VariantMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IVariantMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VariantMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.DefinitionAndUsage; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class VariantMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IVariantMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VariantMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -118,9 +118,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -565,11 +581,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the VariantMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedVariantUsageSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the VariantMembership {Id} disagrees with ownedVariantUsage; the ownedVariantUsage value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the VariantMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedVariantUsageSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the VariantMembership {Id} disagrees with ownedVariantUsage; the ownedVariantUsage value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!membershipOwningNamespaceSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the VariantMembership {Id} disagrees with membershipOwningNamespace; the membershipOwningNamespace value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -682,25 +817,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.DefinitionAndUsage.VariantMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -712,9 +847,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -896,61 +1032,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the VariantMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseDefinitionDeSerializer.cs index 0ec1e58cc..1a45bbb01 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.VerificationCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class VerificationCaseDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IVerificationCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VerificationCaseDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.VerificationCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class VerificationCaseDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IVerificationCaseDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VerificationCaseDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionSeen = false; var actorParameterSeen = false; @@ -182,9 +182,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var variantSeen = false; var variantMembershipSeen = false; - var verifiedRequirementSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var verifiedRequirementSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1781,11 +1782,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionSeen) { @@ -2154,25 +2157,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!verifiedRequirementSeen) { logger.LogDebug("the verifiedRequirement Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2184,9 +2187,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2362,61 +2366,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the VerificationCaseDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseUsageDeSerializer.cs index 2849642d9..18653f2c8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/VerificationCaseUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.VerificationCases; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class VerificationCaseUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IVerificationCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VerificationCaseUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.VerificationCases; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class VerificationCaseUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IVerificationCaseUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("VerificationCaseUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -208,9 +208,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; var verificationCaseDefinitionSeen = false; - var verifiedRequirementSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var verifiedRequirementSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2207,11 +2211,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the VerificationCaseUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2684,25 +2710,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!verifiedRequirementSeen) { logger.LogDebug("the verifiedRequirement Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.VerificationCases.VerificationCaseUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2723,9 +2749,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3012,97 +3039,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the VerificationCaseUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewDefinitionDeSerializer.cs index 06620c360..156bc41b1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ViewDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IViewDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ViewDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IViewDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -176,9 +176,10 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantMembershipSeen = false; var viewSeen = false; var viewConditionSeen = false; - var viewRenderingSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var viewRenderingSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1664,11 +1665,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2013,25 +2016,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!viewRenderingSeen) { logger.LogDebug("the viewRendering Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2043,9 +2046,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isSufficientSeen = false; var isVariationSeen = false; var ownedRelationshipSeen = false; - var owningRelationshipSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var owningRelationshipSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2221,61 +2225,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ViewDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewRenderingMembershipDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewRenderingMembershipDeSerializer.cs index f5de63a3d..eb19be1f3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewRenderingMembershipDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewRenderingMembershipDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ViewRenderingMembershipDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IViewRenderingMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewRenderingMembershipDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ViewRenderingMembershipDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IViewRenderingMembership DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewRenderingMembershipDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -119,9 +119,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var relatedElementSeen = false; var shortNameSeen = false; var textualRepresentationSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + var memberShortNameRedefinitionSeen = false; + string memberShortNameRedefinitionValue = null; + + var memberElementRedefinitionSeen = false; + Guid? memberElementRedefinitionValue = null; + + var memberNameRedefinitionSeen = false; + string memberNameRedefinitionValue = null; + + var targetRedefinitionSeen = false; + System.Collections.Generic.List targetRedefinitionValue = []; + + var sourceRedefinitionSeen = false; + System.Collections.Generic.List sourceRedefinitionValue = []; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -588,11 +604,130 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("memberShortName"u8)) + { + memberShortNameRedefinitionSeen = true; + reader.Read(); + memberShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("memberElement"u8)) + { + memberElementRedefinitionSeen = true; + reader.Read(); + if (reader.TokenType != JsonTokenType.Null && Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + memberElementRedefinitionValue = redefinitionItem; + } + continue; + } + + if (reader.ValueTextEquals("memberName"u8)) + { + memberNameRedefinitionSeen = true; + reader.Read(); + memberNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("target"u8)) + { + targetRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + targetRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + if (reader.ValueTextEquals("source"u8)) + { + sourceRedefinitionSeen = true; + reader.Read(); + Utf8JsonReaderHelper.ExpectArrayStart(ref reader); + while (reader.Read() && reader.TokenType != JsonTokenType.EndArray) + { + if (Utf8JsonReaderHelper.TryReadReferenceIdentifier(ref reader, out var redefinitionItem)) + { + sourceRedefinitionValue.Add(redefinitionItem); + } + } + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (memberShortNameRedefinitionSeen) + { + if (!ownedMemberShortNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName = memberShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberShortName, memberShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberShortName Json property of the ViewRenderingMembership {Id} disagrees with ownedMemberShortName; the ownedMemberShortName value is kept", dtoInstance.Id); + } + } + + if (memberElementRedefinitionSeen) + { + if (!ownedRenderingSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement = (memberElementRedefinitionValue ?? Guid.Empty); + } + else if (((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberElement != (memberElementRedefinitionValue ?? Guid.Empty) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberElement Json property of the ViewRenderingMembership {Id} disagrees with ownedRendering; the ownedRendering value is kept", dtoInstance.Id); + } + } + + if (memberNameRedefinitionSeen) + { + if (!ownedMemberNameSeen) + { + ((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName = memberNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)dtoInstance).MemberName, memberNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The memberName Json property of the ViewRenderingMembership {Id} disagrees with ownedMemberName; the ownedMemberName value is kept", dtoInstance.Id); + } + } + + if (targetRedefinitionSeen) + { + if (!ownedRenderingSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target = targetRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Target, targetRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The target Json property of the ViewRenderingMembership {Id} disagrees with ownedRendering; the ownedRendering value is kept", dtoInstance.Id); + } + } + + if (sourceRedefinitionSeen) + { + if (!owningTypeSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source = sourceRedefinitionValue; + } + else if (!System.Linq.Enumerable.SequenceEqual(((SysML2.NET.Core.DTO.Root.Elements.IRelationship)dtoInstance).Source, sourceRedefinitionValue) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The source Json property of the ViewRenderingMembership {Id} disagrees with owningType; the owningType value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -709,25 +844,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!visibilitySeen) { logger.LogDebug("the visibility Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewRenderingMembership dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -739,9 +874,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelatedElementSeen = false; var owningRelationshipSeen = false; - var visibilitySeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var visibilitySeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -923,61 +1059,63 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!isImpliedSeen) - { + { logger.LogDebug("the isImplied Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!ownedRelatedElementSeen) - { + { logger.LogDebug("the ownedRelatedElement Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!owningRelatedElementSeen) - { + { logger.LogDebug("the owningRelatedElement Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); } if (!visibilitySeen) - { + { logger.LogDebug("the visibility Json property was not found in the ViewRenderingMembership: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewUsageDeSerializer.cs index 15e117766..f3f0cc2af 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ViewUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IViewUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ViewUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IViewUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var chainingFeatureSeen = false; @@ -207,9 +207,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantMembershipSeen = false; var viewConditionSeen = false; var viewDefinitionSeen = false; - var viewRenderingSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var viewRenderingSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2186,11 +2190,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ViewUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) { @@ -2659,25 +2685,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!viewRenderingSeen) { logger.LogDebug("the viewRendering Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2698,9 +2724,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2987,97 +3014,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ViewUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointDefinitionDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointDefinitionDeSerializer.cs index 9bc0c26a6..9724fdb80 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointDefinitionDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointDefinitionDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ViewpointDefinitionDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IViewpointDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewpointDefinitionDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ViewpointDefinitionDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IViewpointDefinition DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewpointDefinitionDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -184,9 +184,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var variantSeen = false; var variantMembershipSeen = false; - var viewpointStakeholderSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var viewpointStakeholderSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -1822,11 +1826,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ViewpointDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2203,25 +2229,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!viewpointStakeholderSeen) { logger.LogDebug("the viewpointStakeholder Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointDefinition dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2233,9 +2259,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2411,61 +2441,83 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ViewpointDefinition {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the ViewpointDefinition: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointUsageDeSerializer.cs index f84d3a0ab..10851bc1e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/ViewpointUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Views; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class ViewpointUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IViewpointUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewpointUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Views; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class ViewpointUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IViewpointUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("ViewpointUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actorParameterSeen = false; var aliasIdsSeen = false; @@ -212,9 +212,16 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var variantSeen = false; var variantMembershipSeen = false; var viewpointDefinitionSeen = false; - var viewpointStakeholderSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var viewpointStakeholderSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2287,11 +2294,53 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the ViewpointUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ViewpointUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actorParameterSeen) { @@ -2780,25 +2829,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!viewpointStakeholderSeen) { logger.LogDebug("the viewpointStakeholder Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Views.ViewpointUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2819,9 +2868,13 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var ownedRelationshipSeen = false; var owningRelationshipSeen = false; var portionKindSeen = false; - var reqIdSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var reqIdSeen = false; + + var declaredShortNameRedefinitionSeen = false; + string declaredShortNameRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -3108,97 +3161,119 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("declaredShortName"u8)) + { + declaredShortNameRedefinitionSeen = true; + reader.Read(); + declaredShortNameRedefinitionValue = Utf8JsonReaderHelper.ReadStringOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (declaredShortNameRedefinitionSeen) + { + if (!reqIdSeen) + { + ((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName = declaredShortNameRedefinitionValue; + } + else if (!string.Equals(((SysML2.NET.Core.DTO.Root.Elements.IElement)dtoInstance).DeclaredShortName, declaredShortNameRedefinitionValue, StringComparison.Ordinal) && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The declaredShortName Json property of the ViewpointUsage {Id} disagrees with reqId; the reqId value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); } if (!reqIdSeen) - { + { logger.LogDebug("the reqId Json property was not found in the ViewpointUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/WhileLoopActionUsageDeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/WhileLoopActionUsageDeSerializer.cs index 32b974759..c40565f7d 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/WhileLoopActionUsageDeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenDeSerializer/WhileLoopActionUsageDeSerializer.cs @@ -12,84 +12,84 @@ // --------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.Systems.Actions; - using SysML2.NET.Serializer.Json; - using SysML2.NET.Serializer.Json.Utility; - - /// - /// The purpose of the is to provide deserialization capabilities - /// for the interface - /// - internal static class WhileLoopActionUsageDeSerializer - { - /// - /// Deserializes an instance of from the provided - /// - /// - /// The positioned on the of the - /// json object. On return the reader is positioned on the matching - /// - /// - /// - /// enumeration specifying what kind of serialization shall be used - /// - /// - /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored - /// - /// - /// The used to setup logging - /// - /// - /// an instance of - /// - /// - /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather - /// than re-validated here - /// - internal static IWhileLoopActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) - { - var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("WhileLoopActionUsageDeSerializer"); - - Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); - - var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage(); - - if (deserializeDerivedProperties) - { - DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); - } - else - { - DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); - } - - return dtoInstance; - } - - /// - /// Deserializes properties of a - /// from a , including derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) +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.Systems.Actions; + using SysML2.NET.Serializer.Json; + using SysML2.NET.Serializer.Json.Utility; + + /// + /// The purpose of the is to provide deserialization capabilities + /// for the interface + /// + internal static class WhileLoopActionUsageDeSerializer + { + /// + /// Deserializes an instance of from the provided + /// + /// + /// The positioned on the of the + /// json object. On return the reader is positioned on the matching + /// + /// + /// + /// enumeration specifying what kind of serialization shall be used + /// + /// + /// Asserts that the deserializer should deserialize derived properties if present or if they are ignored + /// + /// + /// The used to setup logging + /// + /// + /// an instance of + /// + /// + /// The @type property is the discriminator that the caller dispatched on, so it is skipped rather + /// than re-validated here + /// + internal static IWhileLoopActionUsage DeSerialize(ref Utf8JsonReader reader, SerializationModeKind serializationModeKind, bool deserializeDerivedProperties, ILoggerFactory loggerFactory = null) + { + var logger = loggerFactory == null ? NullLogger.Instance : loggerFactory.CreateLogger("WhileLoopActionUsageDeSerializer"); + + Utf8JsonReaderHelper.Expect(ref reader, JsonTokenType.StartObject); + + var dtoInstance = new SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage(); + + if (deserializeDerivedProperties) + { + DeserializeDtoIncludingDerivedProperties(dtoInstance, ref reader, logger); + } + else + { + DeserializeDtoExcludingDerivedProperties(dtoInstance, ref reader, logger); + } + + return dtoInstance; + } + + /// + /// Deserializes properties of a + /// from a , including derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var actionDefinitionSeen = false; var aliasIdsSeen = false; @@ -204,9 +204,13 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO var usageSeen = false; var variantSeen = false; var variantMembershipSeen = false; - var whileArgumentSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var whileArgumentSeen = false; + + var isVariableRedefinitionSeen = false; + bool? isVariableRedefinitionValue = null; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2138,11 +2142,33 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO } + if (reader.ValueTextEquals("isVariable"u8)) + { + isVariableRedefinitionSeen = true; + reader.Read(); + isVariableRedefinitionValue = Utf8JsonReaderHelper.ReadBoolOrNull(ref reader); + continue; + } + + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + if (isVariableRedefinitionSeen && isVariableRedefinitionValue.HasValue) + { + if (!mayTimeVarySeen) + { + ((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable = isVariableRedefinitionValue.Value; + } + else if (((SysML2.NET.Core.DTO.Core.Features.IFeature)dtoInstance).IsVariable != isVariableRedefinitionValue.Value && logger.IsEnabled(LogLevel.Warning)) + { + logger.LogWarning("The isVariable Json property of the WhileLoopActionUsage {Id} disagrees with mayTimeVary; the mayTimeVary value is kept", dtoInstance.Id); + } + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!actionDefinitionSeen) { @@ -2599,25 +2625,25 @@ private static void DeserializeDtoIncludingDerivedProperties(SysML2.NET.Core.DTO if (!whileArgumentSeen) { logger.LogDebug("the whileArgument Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); - } - } - } - - /// - /// Deserializes properties of a - /// from a , excluding derived properties - /// - /// - /// The instance holding deserialized values - /// - /// - /// The positioned on the of the - /// json object - /// - /// - /// The to produce logging statement - /// - private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) + } + } + } + + /// + /// Deserializes properties of a + /// from a , excluding derived properties + /// + /// + /// The instance holding deserialized values + /// + /// + /// The positioned on the of the + /// json object + /// + /// + /// The to produce logging statement + /// + private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO.Systems.Actions.WhileLoopActionUsage dtoInstance, ref Utf8JsonReader reader, ILogger logger) { var aliasIdsSeen = false; var declaredNameSeen = false; @@ -2638,9 +2664,10 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO var isVariationSeen = false; var ownedRelationshipSeen = false; var owningRelationshipSeen = false; - var portionKindSeen = false; - - while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + var portionKindSeen = false; + + + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) { if (reader.TokenType != JsonTokenType.PropertyName) { @@ -2927,97 +2954,99 @@ private static void DeserializeDtoExcludingDerivedProperties(SysML2.NET.Core.DTO } + reader.Read(); - reader.Skip(); - } - - if (logger.IsEnabled(LogLevel.Debug)) + reader.Skip(); + } + + + if (logger.IsEnabled(LogLevel.Debug)) { if (!aliasIdsSeen) - { + { logger.LogDebug("the aliasIds Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!declaredNameSeen) - { + { logger.LogDebug("the declaredName Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!declaredShortNameSeen) - { + { logger.LogDebug("the declaredShortName Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!directionSeen) - { + { logger.LogDebug("the direction Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!elementIdSeen) - { + { logger.LogDebug("the elementId Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isAbstractSeen) - { + { logger.LogDebug("the isAbstract Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isCompositeSeen) - { + { logger.LogDebug("the isComposite Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isConstantSeen) - { + { logger.LogDebug("the isConstant Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isDerivedSeen) - { + { logger.LogDebug("the isDerived Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isEndSeen) - { + { logger.LogDebug("the isEnd Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isImpliedIncludedSeen) - { + { logger.LogDebug("the isImpliedIncluded Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isIndividualSeen) - { + { logger.LogDebug("the isIndividual Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isOrderedSeen) - { + { logger.LogDebug("the isOrdered Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isPortionSeen) - { + { logger.LogDebug("the isPortion Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isSufficientSeen) - { + { logger.LogDebug("the isSufficient Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isUniqueSeen) - { + { logger.LogDebug("the isUnique Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!isVariationSeen) - { + { logger.LogDebug("the isVariation Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!ownedRelationshipSeen) - { + { logger.LogDebug("the ownedRelationship Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!owningRelationshipSeen) - { + { logger.LogDebug("the owningRelationship Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); } if (!portionKindSeen) - { + { logger.LogDebug("the portionKind Json property was not found in the WhileLoopActionUsage: {Id}", dtoInstance.Id); - } - } - } - } -} - -// ------------------------------------------------------------------------------------------------ -// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- -// ------------------------------------------------------------------------------------------------ + } + } + } + } +} + +// ------------------------------------------------------------------------------------------------ +// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!-------- +// ------------------------------------------------------------------------------------------------ diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs index 0180ae31a..bccc4853f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AcceptActionUsageSerializer.cs @@ -1405,9 +1405,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAcceptActionUsage i writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAcceptActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAcceptActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAcceptActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs index 2c9ace4fd..c4a90e079 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActionUsageSerializer.cs @@ -1371,9 +1371,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IActionUsage iAction writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs index 5fe3ff4c2..cf421f9dc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ActorMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IActorMembership iAc writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iActorMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iActorMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iActorMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iActorMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iActorMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IActorMembership iAc writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iActorMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iActorMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iActorMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs index 55b8da594..83887b71a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationDefinitionSerializer.cs @@ -1196,30 +1196,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAllocationDefinitio writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iAllocationDefinition.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iAllocationDefinition.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs index 9a7a2437f..c27c09381 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AllocationUsageSerializer.cs @@ -1527,9 +1527,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAllocationUsage iAl writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAllocationUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAllocationUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAllocationUsage.IsVariation); @@ -1596,30 +1593,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAllocationUsage iAl writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iAllocationUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iAllocationUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs index 85a917f78..1a193562a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnalysisCaseUsageSerializer.cs @@ -1482,9 +1482,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAnalysisCaseUsage i writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAnalysisCaseUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAnalysisCaseUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAnalysisCaseUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs index 5e7720673..00bec8adb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AnnotationSerializer.cs @@ -443,18 +443,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAnnotation iAnnotat writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iAnnotation.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iAnnotation.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs index 699f48b4e..be3026810 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssertConstraintUsageSerializer.cs @@ -1422,9 +1422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAssertConstraintUsa writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAssertConstraintUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAssertConstraintUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAssertConstraintUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs index cbccbaa1c..3d160d045 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssignmentActionUsageSerializer.cs @@ -1405,9 +1405,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAssignmentActionUsa writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAssignmentActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAssignmentActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAssignmentActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs index 80fe89c06..bec76d5e5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationSerializer.cs @@ -788,30 +788,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAssociation iAssoci 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(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs index 5896c8b26..3de04e3fe 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AssociationStructureSerializer.cs @@ -788,30 +788,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAssociationStructur writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iAssociationStructure.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iAssociationStructure.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs index 79aeefa10..69e6cce44 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/AttributeUsageSerializer.cs @@ -1304,9 +1304,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IAttributeUsage iAtt writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iAttributeUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iAttributeUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iAttributeUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs index 55694f580..965111aef 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorAsUsageSerializer.cs @@ -1436,9 +1436,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IBindingConnectorAsU writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iBindingConnectorAsUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iBindingConnectorAsUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iBindingConnectorAsUsage.IsVariation); @@ -1494,30 +1491,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IBindingConnectorAsU writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iBindingConnectorAsUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iBindingConnectorAsUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs index c45ae9836..92bbc4595 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/BindingConnectorSerializer.cs @@ -1070,30 +1070,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IBindingConnector iB writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iBindingConnector.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iBindingConnector.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs index 21fd449df..abdbf2ef6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CalculationUsageSerializer.cs @@ -1408,9 +1408,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ICalculationUsage iC writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iCalculationUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iCalculationUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iCalculationUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs index 408a660b2..1832cd97e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CaseUsageSerializer.cs @@ -1454,9 +1454,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ICaseUsage iCaseUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iCaseUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iCaseUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iCaseUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs index aa9dd7535..ad891f1f8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConcernUsageSerializer.cs @@ -1516,9 +1516,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConcernUsage iConce writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iConcernUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iConcernUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iConcernUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs index 018c3c06e..3bf434875 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionDefinitionSerializer.cs @@ -1184,30 +1184,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConnectionDefinitio writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iConnectionDefinition.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iConnectionDefinition.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs index 24f380fa7..b63248ada 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectionUsageSerializer.cs @@ -1515,9 +1515,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConnectionUsage iCo writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iConnectionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iConnectionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iConnectionUsage.IsVariation); @@ -1584,30 +1581,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConnectionUsage iCo writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iConnectionUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iConnectionUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs index e8acdbf3e..4cec3e7ee 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConnectorSerializer.cs @@ -1070,30 +1070,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConnector iConnecto writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iConnector.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iConnector.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs index 81462352a..080524464 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ConstraintUsageSerializer.cs @@ -1410,9 +1410,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IConstraintUsage iCo writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iConstraintUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iConstraintUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iConstraintUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CrossSubsettingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CrossSubsettingSerializer.cs index 3a2a1720f..b2d2a89d7 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CrossSubsettingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/CrossSubsettingSerializer.cs @@ -459,36 +459,12 @@ private static void SerializeAsJsonWithoutDerivedProperties(ICrossSubsetting iCr writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iCrossSubsetting.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(iCrossSubsetting.Specific); - writer.WriteEndObject(); - writer.WritePropertyName("subsettedFeature"u8); writer.WriteStartObject(); writer.WritePropertyName("@id"u8); writer.WriteStringValue(iCrossSubsetting.SubsettedFeature); writer.WriteEndObject(); - writer.WritePropertyName("subsettingFeature"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iCrossSubsetting.SubsettingFeature); - writer.WriteEndObject(); - writer.WriteStartArray("target"u8); foreach (var item in iCrossSubsetting.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs index 5269730c5..c0afb8bf6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DecisionNodeSerializer.cs @@ -1371,9 +1371,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IDecisionNode iDecis writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iDecisionNode.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iDecisionNode.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iDecisionNode.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs index ea10fe1ed..e7bc2740f 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/DifferencingSerializer.cs @@ -401,18 +401,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IDifferencing iDiffe writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iDifferencing.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iDifferencing.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs index 2dfb07f6e..1fac548db 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ElementFilterMembershipSerializer.cs @@ -376,18 +376,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IElementFilterMember writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iElementFilterMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iElementFilterMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iElementFilterMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iElementFilterMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iElementFilterMembership.OwnedRelatedElement) @@ -440,30 +428,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IElementFilterMember writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iElementFilterMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iElementFilterMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iElementFilterMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs index a5ae52e34..341e12bc5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EndFeatureMembershipSerializer.cs @@ -382,18 +382,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IEndFeatureMembershi writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iEndFeatureMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iEndFeatureMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iEndFeatureMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iEndFeatureMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iEndFeatureMembership.OwnedRelatedElement) @@ -446,30 +434,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IEndFeatureMembershi writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iEndFeatureMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iEndFeatureMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iEndFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs index 897647188..6b2c8fc13 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EnumerationUsageSerializer.cs @@ -1310,9 +1310,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IEnumerationUsage iE writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iEnumerationUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iEnumerationUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iEnumerationUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs index c0d698426..b81bc91e4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/EventOccurrenceUsageSerializer.cs @@ -1341,9 +1341,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IEventOccurrenceUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iEventOccurrenceUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iEventOccurrenceUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iEventOccurrenceUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs index a90710bf2..51aabf208 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ExhibitStateUsageSerializer.cs @@ -1449,9 +1449,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IExhibitStateUsage i writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iExhibitStateUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iExhibitStateUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iExhibitStateUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs index ab2da14e4..4d6ff5474 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureChainingSerializer.cs @@ -401,18 +401,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFeatureChaining iFe writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iFeatureChaining.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iFeatureChaining.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs index 3eb8b9cd2..0572eb873 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureMembershipSerializer.cs @@ -382,18 +382,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFeatureMembership i writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iFeatureMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iFeatureMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iFeatureMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureMembership.OwnedRelatedElement) @@ -446,30 +434,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFeatureMembership i writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iFeatureMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iFeatureMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs index c22a793b2..047a35e3e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FeatureValueSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFeatureValue iFeatu writer.WritePropertyName("isInitial"u8); writer.WriteBooleanValue(iFeatureValue.IsInitial); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iFeatureValue.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iFeatureValue.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iFeatureValue.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iFeatureValue.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFeatureValue iFeatu writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iFeatureValue.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iFeatureValue.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iFeatureValue.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowDefinitionSerializer.cs index e246c2c43..fdcd3ea38 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowDefinitionSerializer.cs @@ -1220,30 +1220,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFlowDefinition iFlo writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iFlowDefinition.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iFlowDefinition.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowSerializer.cs index c80f3aeb6..2256d47f2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowSerializer.cs @@ -1172,30 +1172,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFlow iFlow, Utf8Jso 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(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowUsageSerializer.cs index c2f5db44c..f81c9e0a5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FlowUsageSerializer.cs @@ -1605,9 +1605,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFlowUsage iFlowUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iFlowUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iFlowUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iFlowUsage.IsVariation); @@ -1674,30 +1671,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFlowUsage iFlowUsag writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iFlowUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iFlowUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs index ad59280fe..474b07003 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForLoopActionUsageSerializer.cs @@ -1389,9 +1389,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IForLoopActionUsage writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iForLoopActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iForLoopActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iForLoopActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs index 45d4c3dc5..8df53e9bd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ForkNodeSerializer.cs @@ -1371,9 +1371,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IForkNode iForkNode, writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iForkNode.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iForkNode.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iForkNode.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs index d5ff9060f..e77f7ea98 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/FramedConcernMembershipSerializer.cs @@ -412,18 +412,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFramedConcernMember 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) @@ -476,30 +464,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IFramedConcernMember 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()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs index 5895deed1..68476f466 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IfActionUsageSerializer.cs @@ -1397,9 +1397,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IIfActionUsage iIfAc writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iIfActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iIfActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iIfActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs index 95d30adfc..61c9990df 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IncludeUseCaseUsageSerializer.cs @@ -1498,9 +1498,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IIncludeUseCaseUsage writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iIncludeUseCaseUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iIncludeUseCaseUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iIncludeUseCaseUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs index 6c1cb2a9e..69d7ef9d0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InteractionSerializer.cs @@ -812,30 +812,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IInteraction iIntera writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iInteraction.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iInteraction.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs index c5eb8a12c..8b6d71e95 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceDefinitionSerializer.cs @@ -1196,30 +1196,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IInterfaceDefinition writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iInterfaceDefinition.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iInterfaceDefinition.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs index 3c281e9d0..7925e8bcc 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/InterfaceUsageSerializer.cs @@ -1527,9 +1527,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IInterfaceUsage iInt writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iInterfaceUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iInterfaceUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iInterfaceUsage.IsVariation); @@ -1596,30 +1593,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IInterfaceUsage iInt writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iInterfaceUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iInterfaceUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs index c17033e4e..c8c2fb9e5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/IntersectingSerializer.cs @@ -401,18 +401,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IIntersecting iInter writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iIntersecting.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iIntersecting.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs index d68bb67ec..21153f800 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ItemUsageSerializer.cs @@ -1347,9 +1347,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IItemUsage iItemUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iItemUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iItemUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iItemUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs index f0a84c589..72cda77ce 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/JoinNodeSerializer.cs @@ -1371,9 +1371,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IJoinNode iJoinNode, writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iJoinNode.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iJoinNode.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iJoinNode.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs index b18386e62..dfca31148 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipExposeSerializer.cs @@ -422,18 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMembershipExpose iM writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iMembershipExpose.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iMembershipExpose.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs index 35a6ddf25..88fec5aa5 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipImportSerializer.cs @@ -422,18 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMembershipImport iM writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iMembershipImport.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iMembershipImport.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs index f7e577c32..3caa2f512 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MembershipSerializer.cs @@ -419,18 +419,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMembership iMembers 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) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs index 413b4f4bd..2f20eee16 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MergeNodeSerializer.cs @@ -1371,9 +1371,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMergeNode iMergeNod writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iMergeNode.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iMergeNode.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iMergeNode.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs index 45eb0eedf..c1dc6e816 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/MetadataUsageSerializer.cs @@ -1425,9 +1425,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IMetadataUsage iMeta writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iMetadataUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iMetadataUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iMetadataUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs index c6a5b7bab..33ebafd3b 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceExposeSerializer.cs @@ -422,18 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(INamespaceExpose iNa writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iNamespaceExpose.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iNamespaceExpose.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs index 5fc34aaa2..09ea17b03 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/NamespaceImportSerializer.cs @@ -422,18 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(INamespaceImport iNa writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iNamespaceImport.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iNamespaceImport.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs index 10897c783..9ed569591 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ObjectiveMembershipSerializer.cs @@ -388,18 +388,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IObjectiveMembership writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iObjectiveMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iObjectiveMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iObjectiveMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iObjectiveMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iObjectiveMembership.OwnedRelatedElement) @@ -452,30 +440,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IObjectiveMembership writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iObjectiveMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iObjectiveMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iObjectiveMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs index 999887f85..5bb563764 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OccurrenceUsageSerializer.cs @@ -1335,9 +1335,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IOccurrenceUsage iOc writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iOccurrenceUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iOccurrenceUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iOccurrenceUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs index 7bebfd976..b0721aad2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/OwningMembershipSerializer.cs @@ -370,18 +370,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IOwningMembership iO 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) @@ -434,30 +422,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IOwningMembership iO 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()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs index 1d3b7f9a9..6f1efd9d8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ParameterMembershipSerializer.cs @@ -388,18 +388,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IParameterMembership writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iParameterMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iParameterMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iParameterMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iParameterMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iParameterMembership.OwnedRelatedElement) @@ -452,30 +440,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IParameterMembership writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iParameterMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iParameterMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iParameterMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs index bceb53260..ad702d6bf 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PartUsageSerializer.cs @@ -1359,9 +1359,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IPartUsage iPartUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iPartUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iPartUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iPartUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs index 9b2ceb80d..b5579b02a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PerformActionUsageSerializer.cs @@ -1383,9 +1383,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IPerformActionUsage writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iPerformActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iPerformActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iPerformActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs index 58ef3a04f..639d6c493 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/PortUsageSerializer.cs @@ -1347,9 +1347,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IPortUsage iPortUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iPortUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iPortUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iPortUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs index 191dbd368..e7da53e62 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceSubsettingSerializer.cs @@ -459,36 +459,12 @@ private static void SerializeAsJsonWithoutDerivedProperties(IReferenceSubsetting 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) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs index 4c9b63fcd..585c471cb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReferenceUsageSerializer.cs @@ -1292,9 +1292,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IReferenceUsage iRef writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iReferenceUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iReferenceUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iReferenceUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs index 69ef804fd..88a1c94c1 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RenderingUsageSerializer.cs @@ -1373,9 +1373,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRenderingUsage iRen writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iRenderingUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iRenderingUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iRenderingUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs index b25c5de71..7418dfeb4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementConstraintMembershipSerializer.cs @@ -400,18 +400,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementConstrai writer.WritePropertyName("kind"u8); writer.WriteStringValue(iRequirementConstraintMembership.Kind.ToString().ToLower()); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iRequirementConstraintMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iRequirementConstraintMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iRequirementConstraintMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iRequirementConstraintMembership.OwnedRelatedElement) @@ -464,30 +452,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementConstrai writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iRequirementConstraintMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iRequirementConstraintMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iRequirementConstraintMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs index 5366d3672..6dfae2521 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementUsageSerializer.cs @@ -1502,9 +1502,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementUsage iR writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iRequirementUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iRequirementUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iRequirementUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs index 4db79755d..f1b52896a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/RequirementVerificationMembershipSerializer.cs @@ -412,18 +412,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementVerifica writer.WritePropertyName("kind"u8); writer.WriteStringValue(iRequirementVerificationMembership.Kind.ToString().ToLower()); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iRequirementVerificationMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iRequirementVerificationMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iRequirementVerificationMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iRequirementVerificationMembership.OwnedRelatedElement) @@ -476,30 +464,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IRequirementVerifica writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iRequirementVerificationMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iRequirementVerificationMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iRequirementVerificationMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs index 6c5e1b735..5ed50dfd6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ResultExpressionMembershipSerializer.cs @@ -388,18 +388,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IResultExpressionMem writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iResultExpressionMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iResultExpressionMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iResultExpressionMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iResultExpressionMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iResultExpressionMembership.OwnedRelatedElement) @@ -452,30 +440,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IResultExpressionMem writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iResultExpressionMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iResultExpressionMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iResultExpressionMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs index 8853cee4b..c5fc86b9a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ReturnParameterMembershipSerializer.cs @@ -388,18 +388,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IReturnParameterMemb writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iReturnParameterMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iReturnParameterMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iReturnParameterMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iReturnParameterMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iReturnParameterMembership.OwnedRelatedElement) @@ -452,30 +440,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IReturnParameterMemb writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iReturnParameterMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iReturnParameterMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iReturnParameterMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs index 81c2f0db5..ba96914b8 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SatisfyRequirementUsageSerializer.cs @@ -1526,9 +1526,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISatisfyRequirementU writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iSatisfyRequirementUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iSatisfyRequirementUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iSatisfyRequirementUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs index 60c88cd6a..4e20165cd 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SendActionUsageSerializer.cs @@ -1413,9 +1413,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISendActionUsage iSe writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iSendActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iSendActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iSendActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs index 756e36ca3..ad2a45d4e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StakeholderMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IStakeholderMembersh writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iStakeholderMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iStakeholderMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iStakeholderMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iStakeholderMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iStakeholderMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IStakeholderMembersh writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iStakeholderMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iStakeholderMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iStakeholderMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs index ee10a44d1..b78ffe58a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateSubactionMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IStateSubactionMembe writer.WritePropertyName("kind"u8); writer.WriteStringValue(iStateSubactionMembership.Kind.ToString().ToLower()); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iStateSubactionMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iStateSubactionMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iStateSubactionMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iStateSubactionMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IStateSubactionMembe writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iStateSubactionMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iStateSubactionMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iStateSubactionMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs index 40ea84098..91e2d74c0 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/StateUsageSerializer.cs @@ -1431,9 +1431,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IStateUsage iStateUs writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iStateUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iStateUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iStateUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs index f9ad455fc..639ad6ae6 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SubjectMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISubjectMembership i writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iSubjectMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iSubjectMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iSubjectMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iSubjectMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iSubjectMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISubjectMembership i writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iSubjectMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iSubjectMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iSubjectMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs index d28224117..a8e55d0b3 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionAsUsageSerializer.cs @@ -1436,9 +1436,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccessionAsUsage i writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iSuccessionAsUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iSuccessionAsUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iSuccessionAsUsage.IsVariation); @@ -1494,30 +1491,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccessionAsUsage i writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iSuccessionAsUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iSuccessionAsUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowSerializer.cs index 1f15141a6..8f3ca9e2c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowSerializer.cs @@ -1172,30 +1172,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccessionFlow iSuc writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iSuccessionFlow.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iSuccessionFlow.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowUsageSerializer.cs index 011a87d48..aa2803437 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionFlowUsageSerializer.cs @@ -1605,9 +1605,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccessionFlowUsage writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iSuccessionFlowUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iSuccessionFlowUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iSuccessionFlowUsage.IsVariation); @@ -1674,30 +1671,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccessionFlowUsage writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iSuccessionFlowUsage.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iSuccessionFlowUsage.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs index 349d0729f..e97e91017 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/SuccessionSerializer.cs @@ -1070,30 +1070,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ISuccession iSuccess writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iSuccession.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iSuccession.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - } } } diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TerminateActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TerminateActionUsageSerializer.cs index 879ed81d9..4acc1e40e 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TerminateActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TerminateActionUsageSerializer.cs @@ -1385,9 +1385,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ITerminateActionUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iTerminateActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iTerminateActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iTerminateActionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs index 699d42bc7..50ee6682c 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionFeatureMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ITransitionFeatureMe writer.WritePropertyName("kind"u8); writer.WriteStringValue(iTransitionFeatureMembership.Kind.ToString().ToLower()); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iTransitionFeatureMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iTransitionFeatureMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iTransitionFeatureMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iTransitionFeatureMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ITransitionFeatureMe writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iTransitionFeatureMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iTransitionFeatureMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iTransitionFeatureMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs index bb5552a73..0eb46f7cb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/TransitionUsageSerializer.cs @@ -1425,9 +1425,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(ITransitionUsage iTr writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iTransitionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iTransitionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iTransitionUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs index 42a8dce1a..b10f3e359 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UnioningSerializer.cs @@ -395,18 +395,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IUnioning iUnioning, writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iUnioning.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WriteStartArray("target"u8); foreach (var item in iUnioning.Target) diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs index df2407f6e..4794d27ff 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UsageSerializer.cs @@ -1292,9 +1292,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IUsage iUsage, Utf8J writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs index eb72f9125..c4872bb6a 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/UseCaseUsageSerializer.cs @@ -1480,9 +1480,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IUseCaseUsage iUseCa writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iUseCaseUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iUseCaseUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iUseCaseUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs index 39a445bd3..3aa4d06fb 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VariantMembershipSerializer.cs @@ -376,18 +376,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IVariantMembership i writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iVariantMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iVariantMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iVariantMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iVariantMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iVariantMembership.OwnedRelatedElement) @@ -440,30 +428,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IVariantMembership i writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iVariantMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iVariantMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iVariantMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs index 737f1d984..a3454cce2 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/VerificationCaseUsageSerializer.cs @@ -1480,9 +1480,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IVerificationCaseUsa writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iVerificationCaseUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iVerificationCaseUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iVerificationCaseUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs index b4d58ef33..0825a3b66 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewRenderingMembershipSerializer.cs @@ -394,18 +394,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IViewRenderingMember writer.WritePropertyName("isImpliedIncluded"u8); writer.WriteBooleanValue(iViewRenderingMembership.IsImpliedIncluded); - writer.WritePropertyName("memberElement"u8); - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(iViewRenderingMembership.MemberElement); - writer.WriteEndObject(); - - writer.WritePropertyName("memberName"u8); - writer.WriteStringValue(iViewRenderingMembership.MemberName); - - writer.WritePropertyName("memberShortName"u8); - writer.WriteStringValue(iViewRenderingMembership.MemberShortName); - writer.WriteStartArray("ownedRelatedElement"u8); foreach (var item in iViewRenderingMembership.OwnedRelatedElement) @@ -458,30 +446,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IViewRenderingMember writer.WriteNullValue(); } - writer.WriteStartArray("source"u8); - - foreach (var item in iViewRenderingMembership.Source) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - - writer.WriteStartArray("target"u8); - - foreach (var item in iViewRenderingMembership.Target) - { - writer.WriteStartObject(); - writer.WritePropertyName("@id"u8); - writer.WriteStringValue(item); - writer.WriteEndObject(); - } - - writer.WriteEndArray(); - writer.WritePropertyName("visibility"u8); writer.WriteStringValue(iViewRenderingMembership.Visibility.ToString().ToLower()); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs index 2e2bc134e..7bf86f485 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewUsageSerializer.cs @@ -1423,9 +1423,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IViewUsage iViewUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iViewUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iViewUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iViewUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs index 960c581e3..d089bd278 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/ViewpointUsageSerializer.cs @@ -1528,9 +1528,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IViewpointUsage iVie writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iViewpointUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iViewpointUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iViewpointUsage.IsVariation); diff --git a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs index 5fe333884..843b1f9b4 100644 --- a/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs +++ b/SysML2.NET.Serializer.Json/Core/AutoGenSerializer/WhileLoopActionUsageSerializer.cs @@ -1397,9 +1397,6 @@ private static void SerializeAsJsonWithoutDerivedProperties(IWhileLoopActionUsag writer.WritePropertyName("isUnique"u8); writer.WriteBooleanValue(iWhileLoopActionUsage.IsUnique); - writer.WritePropertyName("isVariable"u8); - writer.WriteBooleanValue(iWhileLoopActionUsage.IsVariable); - writer.WritePropertyName("isVariation"u8); writer.WriteBooleanValue(iWhileLoopActionUsage.IsVariation); diff --git a/SysML2.NET/Core/AutoGenDto/AcceptActionUsage.cs b/SysML2.NET/Core/AutoGenDto/AcceptActionUsage.cs index 6f70d6ce8..7b83d2ebd 100644 --- a/SysML2.NET/Core/AutoGenDto/AcceptActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AcceptActionUsage.cs @@ -404,12 +404,15 @@ public partial class AcceptActionUsage : IAcceptActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ActionUsage.cs b/SysML2.NET/Core/AutoGenDto/ActionUsage.cs index e42794b42..8849182ce 100644 --- a/SysML2.NET/Core/AutoGenDto/ActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ActionUsage.cs @@ -405,12 +405,15 @@ public partial class ActionUsage : IActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ActorMembership.cs b/SysML2.NET/Core/AutoGenDto/ActorMembership.cs index 95a674fc3..83f0d529d 100644 --- a/SysML2.NET/Core/AutoGenDto/ActorMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ActorMembership.cs @@ -110,12 +110,15 @@ public partial class ActorMembership : IActorMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedActorParameter = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -153,12 +159,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -353,12 +362,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -366,7 +378,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/AllocationDefinition.cs b/SysML2.NET/Core/AutoGenDto/AllocationDefinition.cs index 7513edd6c..073084e8d 100644 --- a/SysML2.NET/Core/AutoGenDto/AllocationDefinition.cs +++ b/SysML2.NET/Core/AutoGenDto/AllocationDefinition.cs @@ -801,12 +801,15 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -823,12 +826,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AllocationUsage.cs b/SysML2.NET/Core/AutoGenDto/AllocationUsage.cs index ee170d498..8007bd28c 100644 --- a/SysML2.NET/Core/AutoGenDto/AllocationUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AllocationUsage.cs @@ -438,12 +438,15 @@ public partial class AllocationUsage : IAllocationUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1114,12 +1117,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1136,12 +1142,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AnalysisCaseUsage.cs b/SysML2.NET/Core/AutoGenDto/AnalysisCaseUsage.cs index 4a372ea77..649f7a011 100644 --- a/SysML2.NET/Core/AutoGenDto/AnalysisCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AnalysisCaseUsage.cs @@ -458,12 +458,15 @@ public partial class AnalysisCaseUsage : IAnalysisCaseUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Annotation.cs b/SysML2.NET/Core/AutoGenDto/Annotation.cs index 4b33eac1d..e0d2cec17 100644 --- a/SysML2.NET/Core/AutoGenDto/Annotation.cs +++ b/SysML2.NET/Core/AutoGenDto/Annotation.cs @@ -268,12 +268,15 @@ public partial class Annotation : IAnnotation /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAnnotation.AnnotatingElement")] + [RedefinedByProperty("IAnnotation.AnnotatingElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.annotatingElement]; - set { } + set + { + this.annotatingElement = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AssertConstraintUsage.cs b/SysML2.NET/Core/AutoGenDto/AssertConstraintUsage.cs index c30aa90c8..0559e17d4 100644 --- a/SysML2.NET/Core/AutoGenDto/AssertConstraintUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AssertConstraintUsage.cs @@ -436,12 +436,15 @@ public partial class AssertConstraintUsage : IAssertConstraintUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AssignmentActionUsage.cs b/SysML2.NET/Core/AutoGenDto/AssignmentActionUsage.cs index 685507e6c..4a29a699c 100644 --- a/SysML2.NET/Core/AutoGenDto/AssignmentActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AssignmentActionUsage.cs @@ -403,12 +403,15 @@ public partial class AssignmentActionUsage : IAssignmentActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Association.cs b/SysML2.NET/Core/AutoGenDto/Association.cs index 5a1c9ce9a..93d959ccf 100644 --- a/SysML2.NET/Core/AutoGenDto/Association.cs +++ b/SysML2.NET/Core/AutoGenDto/Association.cs @@ -523,12 +523,15 @@ public partial class Association : IAssociation /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -545,12 +548,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AssociationStructure.cs b/SysML2.NET/Core/AutoGenDto/AssociationStructure.cs index bbd1a6682..284ec8dad 100644 --- a/SysML2.NET/Core/AutoGenDto/AssociationStructure.cs +++ b/SysML2.NET/Core/AutoGenDto/AssociationStructure.cs @@ -523,12 +523,15 @@ public partial class AssociationStructure : IAssociationStructure /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -545,12 +548,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/AttributeUsage.cs b/SysML2.NET/Core/AutoGenDto/AttributeUsage.cs index 313210ef7..4aaeb5c75 100644 --- a/SysML2.NET/Core/AutoGenDto/AttributeUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/AttributeUsage.cs @@ -387,12 +387,15 @@ public partial class AttributeUsage : IAttributeUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/BindingConnector.cs b/SysML2.NET/Core/AutoGenDto/BindingConnector.cs index d3ad47f96..c86f73059 100644 --- a/SysML2.NET/Core/AutoGenDto/BindingConnector.cs +++ b/SysML2.NET/Core/AutoGenDto/BindingConnector.cs @@ -749,12 +749,15 @@ public partial class BindingConnector : IBindingConnector /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -771,12 +774,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/BindingConnectorAsUsage.cs b/SysML2.NET/Core/AutoGenDto/BindingConnectorAsUsage.cs index 055422c71..722352ea6 100644 --- a/SysML2.NET/Core/AutoGenDto/BindingConnectorAsUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/BindingConnectorAsUsage.cs @@ -398,12 +398,15 @@ public partial class BindingConnectorAsUsage : IBindingConnectorAsUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1037,12 +1040,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1059,12 +1065,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/CalculationUsage.cs b/SysML2.NET/Core/AutoGenDto/CalculationUsage.cs index ee13fd4e9..ea0b245f3 100644 --- a/SysML2.NET/Core/AutoGenDto/CalculationUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/CalculationUsage.cs @@ -435,12 +435,15 @@ public partial class CalculationUsage : ICalculationUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/CaseUsage.cs b/SysML2.NET/Core/AutoGenDto/CaseUsage.cs index c1ab69599..d8a445e8a 100644 --- a/SysML2.NET/Core/AutoGenDto/CaseUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/CaseUsage.cs @@ -449,12 +449,15 @@ public partial class CaseUsage : ICaseUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ConcernUsage.cs b/SysML2.NET/Core/AutoGenDto/ConcernUsage.cs index bcc475343..7c6dfcbfe 100644 --- a/SysML2.NET/Core/AutoGenDto/ConcernUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ConcernUsage.cs @@ -465,12 +465,15 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ConnectionDefinition.cs b/SysML2.NET/Core/AutoGenDto/ConnectionDefinition.cs index 042584e4b..e1a78e41d 100644 --- a/SysML2.NET/Core/AutoGenDto/ConnectionDefinition.cs +++ b/SysML2.NET/Core/AutoGenDto/ConnectionDefinition.cs @@ -790,12 +790,15 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -812,12 +815,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ConnectionUsage.cs b/SysML2.NET/Core/AutoGenDto/ConnectionUsage.cs index 9de1ebde2..56abd603f 100644 --- a/SysML2.NET/Core/AutoGenDto/ConnectionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ConnectionUsage.cs @@ -431,12 +431,15 @@ public partial class ConnectionUsage : IConnectionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1107,12 +1110,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1129,12 +1135,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Connector.cs b/SysML2.NET/Core/AutoGenDto/Connector.cs index 4797d4310..1ddcd024d 100644 --- a/SysML2.NET/Core/AutoGenDto/Connector.cs +++ b/SysML2.NET/Core/AutoGenDto/Connector.cs @@ -753,12 +753,15 @@ public partial class Connector : IConnector /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -775,12 +778,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ConstraintUsage.cs b/SysML2.NET/Core/AutoGenDto/ConstraintUsage.cs index c27ee95c1..d6ac8fe98 100644 --- a/SysML2.NET/Core/AutoGenDto/ConstraintUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ConstraintUsage.cs @@ -422,12 +422,15 @@ public partial class ConstraintUsage : IConstraintUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/CrossSubsetting.cs b/SysML2.NET/Core/AutoGenDto/CrossSubsetting.cs index 63155b310..155f56ef2 100644 --- a/SysML2.NET/Core/AutoGenDto/CrossSubsetting.cs +++ b/SysML2.NET/Core/AutoGenDto/CrossSubsetting.cs @@ -288,7 +288,7 @@ Guid Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -308,7 +308,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] Guid Core.Types.ISpecialization.Specific { @@ -340,12 +340,15 @@ Guid ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("ICrossSubsetting.CrossingFeature")] + [RedefinedByProperty("ICrossSubsetting.CrossingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] Guid ISubsetting.SubsettingFeature { get => this.crossingFeature; - set { } + set + { + this.crossingFeature = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/DecisionNode.cs b/SysML2.NET/Core/AutoGenDto/DecisionNode.cs index 871a1bf22..664a547a0 100644 --- a/SysML2.NET/Core/AutoGenDto/DecisionNode.cs +++ b/SysML2.NET/Core/AutoGenDto/DecisionNode.cs @@ -400,12 +400,15 @@ public partial class DecisionNode : IDecisionNode /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Differencing.cs b/SysML2.NET/Core/AutoGenDto/Differencing.cs index d1e14ff0a..c0ba71327 100644 --- a/SysML2.NET/Core/AutoGenDto/Differencing.cs +++ b/SysML2.NET/Core/AutoGenDto/Differencing.cs @@ -233,12 +233,15 @@ public partial class Differencing : IDifferencing /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IDifferencing.TypeDifferenced")] + [RedefinedByProperty("IDifferencing.TypeDifferenced", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.typeDifferenced]; - set { } + set + { + this.typeDifferenced = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ElementFilterMembership.cs b/SysML2.NET/Core/AutoGenDto/ElementFilterMembership.cs index f064e3b2a..1d7cfbd03 100644 --- a/SysML2.NET/Core/AutoGenDto/ElementFilterMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ElementFilterMembership.cs @@ -120,12 +120,15 @@ public partial class ElementFilterMembership : IElementFilterMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.condition = value; + } } /// @@ -140,12 +143,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -162,12 +168,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -326,12 +335,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -339,7 +351,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/EndFeatureMembership.cs b/SysML2.NET/Core/AutoGenDto/EndFeatureMembership.cs index 9f5e16c37..8704d0ebc 100644 --- a/SysML2.NET/Core/AutoGenDto/EndFeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/EndFeatureMembership.cs @@ -109,12 +109,15 @@ public partial class EndFeatureMembership : IEndFeatureMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedMemberFeature = value; + } } /// @@ -129,12 +132,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -152,12 +158,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -342,12 +351,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -355,7 +367,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/EnumerationUsage.cs b/SysML2.NET/Core/AutoGenDto/EnumerationUsage.cs index d2905d52c..3e615b4fa 100644 --- a/SysML2.NET/Core/AutoGenDto/EnumerationUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/EnumerationUsage.cs @@ -391,12 +391,15 @@ public partial class EnumerationUsage : IEnumerationUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/EventOccurrenceUsage.cs b/SysML2.NET/Core/AutoGenDto/EventOccurrenceUsage.cs index 1549518bd..41c353a9f 100644 --- a/SysML2.NET/Core/AutoGenDto/EventOccurrenceUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/EventOccurrenceUsage.cs @@ -402,12 +402,15 @@ public partial class EventOccurrenceUsage : IEventOccurrenceUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ExhibitStateUsage.cs b/SysML2.NET/Core/AutoGenDto/ExhibitStateUsage.cs index efe0e0207..772f60e37 100644 --- a/SysML2.NET/Core/AutoGenDto/ExhibitStateUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ExhibitStateUsage.cs @@ -469,12 +469,15 @@ public partial class ExhibitStateUsage : IExhibitStateUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/FeatureChaining.cs b/SysML2.NET/Core/AutoGenDto/FeatureChaining.cs index d3c30c5cf..699ee4940 100644 --- a/SysML2.NET/Core/AutoGenDto/FeatureChaining.cs +++ b/SysML2.NET/Core/AutoGenDto/FeatureChaining.cs @@ -243,12 +243,15 @@ public partial class FeatureChaining : IFeatureChaining /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IFeatureChaining.FeatureChained")] + [RedefinedByProperty("IFeatureChaining.FeatureChained", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.featureChained]; - set { } + set + { + this.featureChained = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/FeatureMembership.cs b/SysML2.NET/Core/AutoGenDto/FeatureMembership.cs index 8b9f98465..d5a8940be 100644 --- a/SysML2.NET/Core/AutoGenDto/FeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/FeatureMembership.cs @@ -112,12 +112,15 @@ public partial class FeatureMembership : IFeatureMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedMemberFeature = value; + } } /// @@ -132,12 +135,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -155,12 +161,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -337,12 +346,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -350,7 +362,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/FeatureValue.cs b/SysML2.NET/Core/AutoGenDto/FeatureValue.cs index 637f6ba98..80104dc64 100644 --- a/SysML2.NET/Core/AutoGenDto/FeatureValue.cs +++ b/SysML2.NET/Core/AutoGenDto/FeatureValue.cs @@ -141,12 +141,15 @@ public partial class FeatureValue : IFeatureValue /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.value = value; + } } /// @@ -161,12 +164,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -183,12 +189,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -347,12 +356,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -360,7 +372,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/Flow.cs b/SysML2.NET/Core/AutoGenDto/Flow.cs index ae51b33c3..7409321d9 100644 --- a/SysML2.NET/Core/AutoGenDto/Flow.cs +++ b/SysML2.NET/Core/AutoGenDto/Flow.cs @@ -804,12 +804,15 @@ public partial class Flow : IFlow /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -834,12 +837,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/FlowDefinition.cs b/SysML2.NET/Core/AutoGenDto/FlowDefinition.cs index 2947452a9..f5cc34223 100644 --- a/SysML2.NET/Core/AutoGenDto/FlowDefinition.cs +++ b/SysML2.NET/Core/AutoGenDto/FlowDefinition.cs @@ -794,12 +794,15 @@ public partial class FlowDefinition : IFlowDefinition /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -824,12 +827,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/FlowUsage.cs b/SysML2.NET/Core/AutoGenDto/FlowUsage.cs index a6b71f7df..77b100b1b 100644 --- a/SysML2.NET/Core/AutoGenDto/FlowUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/FlowUsage.cs @@ -471,12 +471,15 @@ public partial class FlowUsage : IFlowUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1154,12 +1157,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1184,12 +1190,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ForLoopActionUsage.cs b/SysML2.NET/Core/AutoGenDto/ForLoopActionUsage.cs index 844275ff4..15918e7af 100644 --- a/SysML2.NET/Core/AutoGenDto/ForLoopActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ForLoopActionUsage.cs @@ -410,12 +410,15 @@ public partial class ForLoopActionUsage : IForLoopActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ForkNode.cs b/SysML2.NET/Core/AutoGenDto/ForkNode.cs index 34523d3d7..ea4a37e92 100644 --- a/SysML2.NET/Core/AutoGenDto/ForkNode.cs +++ b/SysML2.NET/Core/AutoGenDto/ForkNode.cs @@ -401,12 +401,15 @@ public partial class ForkNode : IForkNode /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/FramedConcernMembership.cs b/SysML2.NET/Core/AutoGenDto/FramedConcernMembership.cs index c82cb9ad9..2a8818b58 100644 --- a/SysML2.NET/Core/AutoGenDto/FramedConcernMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/FramedConcernMembership.cs @@ -132,12 +132,15 @@ RequirementConstraintKind IRequirementConstraintMembership.Kind /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedConcern = value; + } } /// @@ -152,12 +155,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -175,12 +181,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -395,12 +404,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -408,7 +420,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/IfActionUsage.cs b/SysML2.NET/Core/AutoGenDto/IfActionUsage.cs index a2c635000..ff1611be8 100644 --- a/SysML2.NET/Core/AutoGenDto/IfActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/IfActionUsage.cs @@ -418,12 +418,15 @@ public partial class IfActionUsage : IIfActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/IncludeUseCaseUsage.cs b/SysML2.NET/Core/AutoGenDto/IncludeUseCaseUsage.cs index 221c50bc5..4f3335844 100644 --- a/SysML2.NET/Core/AutoGenDto/IncludeUseCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/IncludeUseCaseUsage.cs @@ -480,12 +480,15 @@ public partial class IncludeUseCaseUsage : IIncludeUseCaseUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Interaction.cs b/SysML2.NET/Core/AutoGenDto/Interaction.cs index f205079aa..e482241b5 100644 --- a/SysML2.NET/Core/AutoGenDto/Interaction.cs +++ b/SysML2.NET/Core/AutoGenDto/Interaction.cs @@ -532,12 +532,15 @@ public partial class Interaction : IInteraction /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -562,12 +565,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/InterfaceDefinition.cs b/SysML2.NET/Core/AutoGenDto/InterfaceDefinition.cs index 80f9e6c49..d2a97a7d5 100644 --- a/SysML2.NET/Core/AutoGenDto/InterfaceDefinition.cs +++ b/SysML2.NET/Core/AutoGenDto/InterfaceDefinition.cs @@ -798,12 +798,15 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceType.HasValue ? [this.sourceType.Value] : []; - set { } + set + { + this.sourceType = value.Count != 0 ? value[0] : null; + } } /// @@ -820,12 +823,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetType]; - set { } + set + { + this.targetType = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/InterfaceUsage.cs b/SysML2.NET/Core/AutoGenDto/InterfaceUsage.cs index ff3115790..7a309471e 100644 --- a/SysML2.NET/Core/AutoGenDto/InterfaceUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/InterfaceUsage.cs @@ -438,12 +438,15 @@ public partial class InterfaceUsage : IInterfaceUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1114,12 +1117,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1136,12 +1142,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Intersecting.cs b/SysML2.NET/Core/AutoGenDto/Intersecting.cs index be19d2a77..bf240fd3d 100644 --- a/SysML2.NET/Core/AutoGenDto/Intersecting.cs +++ b/SysML2.NET/Core/AutoGenDto/Intersecting.cs @@ -233,12 +233,15 @@ public partial class Intersecting : IIntersecting /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IIntersecting.TypeIntersected")] + [RedefinedByProperty("IIntersecting.TypeIntersected", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.typeIntersected]; - set { } + set + { + this.typeIntersected = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ItemUsage.cs b/SysML2.NET/Core/AutoGenDto/ItemUsage.cs index ed542c1b5..aa64ae356 100644 --- a/SysML2.NET/Core/AutoGenDto/ItemUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ItemUsage.cs @@ -383,12 +383,15 @@ public partial class ItemUsage : IItemUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/JoinNode.cs b/SysML2.NET/Core/AutoGenDto/JoinNode.cs index 7032b2bf5..00973fa7a 100644 --- a/SysML2.NET/Core/AutoGenDto/JoinNode.cs +++ b/SysML2.NET/Core/AutoGenDto/JoinNode.cs @@ -401,12 +401,15 @@ public partial class JoinNode : IJoinNode /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Membership.cs b/SysML2.NET/Core/AutoGenDto/Membership.cs index 6cdc5bacb..6ec57e9b9 100644 --- a/SysML2.NET/Core/AutoGenDto/Membership.cs +++ b/SysML2.NET/Core/AutoGenDto/Membership.cs @@ -269,12 +269,15 @@ public partial class Membership : IMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/MembershipExpose.cs b/SysML2.NET/Core/AutoGenDto/MembershipExpose.cs index 507438508..40a4b4e9a 100644 --- a/SysML2.NET/Core/AutoGenDto/MembershipExpose.cs +++ b/SysML2.NET/Core/AutoGenDto/MembershipExpose.cs @@ -281,12 +281,15 @@ bool Root.Namespaces.IImport.IsImportAll /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.importOwningNamespace]; - set { } + set + { + this.importOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/MembershipImport.cs b/SysML2.NET/Core/AutoGenDto/MembershipImport.cs index ff96bdbf0..40b32658e 100644 --- a/SysML2.NET/Core/AutoGenDto/MembershipImport.cs +++ b/SysML2.NET/Core/AutoGenDto/MembershipImport.cs @@ -265,12 +265,15 @@ public partial class MembershipImport : IMembershipImport /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.importOwningNamespace]; - set { } + set + { + this.importOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/MergeNode.cs b/SysML2.NET/Core/AutoGenDto/MergeNode.cs index 71cdddfe8..b56ecc636 100644 --- a/SysML2.NET/Core/AutoGenDto/MergeNode.cs +++ b/SysML2.NET/Core/AutoGenDto/MergeNode.cs @@ -401,12 +401,15 @@ public partial class MergeNode : IMergeNode /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/MetadataUsage.cs b/SysML2.NET/Core/AutoGenDto/MetadataUsage.cs index 6525b9a96..ad1f2caba 100644 --- a/SysML2.NET/Core/AutoGenDto/MetadataUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/MetadataUsage.cs @@ -402,12 +402,15 @@ public partial class MetadataUsage : IMetadataUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/NamespaceExpose.cs b/SysML2.NET/Core/AutoGenDto/NamespaceExpose.cs index bacbc8c67..7c59449dc 100644 --- a/SysML2.NET/Core/AutoGenDto/NamespaceExpose.cs +++ b/SysML2.NET/Core/AutoGenDto/NamespaceExpose.cs @@ -281,12 +281,15 @@ bool Root.Namespaces.IImport.IsImportAll /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.importOwningNamespace]; - set { } + set + { + this.importOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/NamespaceImport.cs b/SysML2.NET/Core/AutoGenDto/NamespaceImport.cs index f57a773dc..d9e487e86 100644 --- a/SysML2.NET/Core/AutoGenDto/NamespaceImport.cs +++ b/SysML2.NET/Core/AutoGenDto/NamespaceImport.cs @@ -266,12 +266,15 @@ public partial class NamespaceImport : INamespaceImport /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.importOwningNamespace]; - set { } + set + { + this.importOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ObjectiveMembership.cs b/SysML2.NET/Core/AutoGenDto/ObjectiveMembership.cs index eb2968b76..0dc3a14ca 100644 --- a/SysML2.NET/Core/AutoGenDto/ObjectiveMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ObjectiveMembership.cs @@ -109,12 +109,15 @@ public partial class ObjectiveMembership : IObjectiveMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedObjectiveRequirement = value; + } } /// @@ -129,12 +132,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -152,12 +158,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -343,12 +352,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -356,7 +368,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/OccurrenceUsage.cs b/SysML2.NET/Core/AutoGenDto/OccurrenceUsage.cs index 20c6ff60e..50f133810 100644 --- a/SysML2.NET/Core/AutoGenDto/OccurrenceUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/OccurrenceUsage.cs @@ -383,12 +383,15 @@ public partial class OccurrenceUsage : IOccurrenceUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/OwningMembership.cs b/SysML2.NET/Core/AutoGenDto/OwningMembership.cs index 8412e778a..b7baea168 100644 --- a/SysML2.NET/Core/AutoGenDto/OwningMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/OwningMembership.cs @@ -108,12 +108,15 @@ public partial class OwningMembership : IOwningMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid IMembership.MemberElement { get => this.ownedMemberElement; - set { } + set + { + this.ownedMemberElement = value; + } } /// @@ -128,12 +131,15 @@ Guid IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -150,12 +156,15 @@ string IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -313,12 +322,15 @@ string IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -326,7 +338,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/ParameterMembership.cs b/SysML2.NET/Core/AutoGenDto/ParameterMembership.cs index c099007ae..39db86a14 100644 --- a/SysML2.NET/Core/AutoGenDto/ParameterMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ParameterMembership.cs @@ -110,12 +110,15 @@ public partial class ParameterMembership : IParameterMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedMemberParameter = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -153,12 +159,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -344,12 +353,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -357,7 +369,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/PartUsage.cs b/SysML2.NET/Core/AutoGenDto/PartUsage.cs index cd024c810..2d72c1419 100644 --- a/SysML2.NET/Core/AutoGenDto/PartUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/PartUsage.cs @@ -382,12 +382,15 @@ public partial class PartUsage : IPartUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/PerformActionUsage.cs b/SysML2.NET/Core/AutoGenDto/PerformActionUsage.cs index 752c39ea7..d1fbc2ba5 100644 --- a/SysML2.NET/Core/AutoGenDto/PerformActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/PerformActionUsage.cs @@ -423,12 +423,15 @@ public partial class PerformActionUsage : IPerformActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/PortUsage.cs b/SysML2.NET/Core/AutoGenDto/PortUsage.cs index c0d04ef57..4253bb45a 100644 --- a/SysML2.NET/Core/AutoGenDto/PortUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/PortUsage.cs @@ -381,12 +381,15 @@ public partial class PortUsage : IPortUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ReferenceSubsetting.cs b/SysML2.NET/Core/AutoGenDto/ReferenceSubsetting.cs index 24ecb9c9b..71ce00520 100644 --- a/SysML2.NET/Core/AutoGenDto/ReferenceSubsetting.cs +++ b/SysML2.NET/Core/AutoGenDto/ReferenceSubsetting.cs @@ -280,7 +280,7 @@ Guid Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -300,7 +300,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] Guid Core.Types.ISpecialization.Specific { @@ -332,12 +332,15 @@ Guid ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature")] + [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] Guid ISubsetting.SubsettingFeature { get => this.referencingFeature; - set { } + set + { + this.referencingFeature = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ReferenceUsage.cs b/SysML2.NET/Core/AutoGenDto/ReferenceUsage.cs index b5a0d2531..5a0f5fba4 100644 --- a/SysML2.NET/Core/AutoGenDto/ReferenceUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ReferenceUsage.cs @@ -374,12 +374,15 @@ public partial class ReferenceUsage : IReferenceUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/RenderingUsage.cs b/SysML2.NET/Core/AutoGenDto/RenderingUsage.cs index 7fd235457..129fd9cf1 100644 --- a/SysML2.NET/Core/AutoGenDto/RenderingUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/RenderingUsage.cs @@ -381,12 +381,15 @@ public partial class RenderingUsage : IRenderingUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/RequirementConstraintMembership.cs b/SysML2.NET/Core/AutoGenDto/RequirementConstraintMembership.cs index 4cc95b8fe..52ae12637 100644 --- a/SysML2.NET/Core/AutoGenDto/RequirementConstraintMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/RequirementConstraintMembership.cs @@ -117,12 +117,15 @@ public partial class RequirementConstraintMembership : IRequirementConstraintMem /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedConstraint = value; + } } /// @@ -137,12 +140,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -160,12 +166,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -360,12 +369,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -373,7 +385,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/RequirementUsage.cs b/SysML2.NET/Core/AutoGenDto/RequirementUsage.cs index 58710ebd7..b9e7167ea 100644 --- a/SysML2.NET/Core/AutoGenDto/RequirementUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/RequirementUsage.cs @@ -455,12 +455,15 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/RequirementVerificationMembership.cs b/SysML2.NET/Core/AutoGenDto/RequirementVerificationMembership.cs index 29dcd98f9..3583b6884 100644 --- a/SysML2.NET/Core/AutoGenDto/RequirementVerificationMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/RequirementVerificationMembership.cs @@ -133,12 +133,15 @@ RequirementConstraintKind Systems.Requirements.IRequirementConstraintMembership. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedRequirement = value; + } } /// @@ -153,12 +156,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -176,12 +182,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -388,12 +397,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -401,7 +413,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/ResultExpressionMembership.cs b/SysML2.NET/Core/AutoGenDto/ResultExpressionMembership.cs index b75282406..5d50302dc 100644 --- a/SysML2.NET/Core/AutoGenDto/ResultExpressionMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ResultExpressionMembership.cs @@ -111,12 +111,15 @@ public partial class ResultExpressionMembership : IResultExpressionMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedResultExpression = value; + } } /// @@ -131,12 +134,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -154,12 +160,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -345,12 +354,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -358,7 +370,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/ReturnParameterMembership.cs b/SysML2.NET/Core/AutoGenDto/ReturnParameterMembership.cs index 13767528e..f3f31613b 100644 --- a/SysML2.NET/Core/AutoGenDto/ReturnParameterMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ReturnParameterMembership.cs @@ -110,12 +110,15 @@ public partial class ReturnParameterMembership : IReturnParameterMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedMemberParameter = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -153,12 +159,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -344,12 +353,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -357,7 +369,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/SatisfyRequirementUsage.cs b/SysML2.NET/Core/AutoGenDto/SatisfyRequirementUsage.cs index b7c4ccce8..5ba2d6357 100644 --- a/SysML2.NET/Core/AutoGenDto/SatisfyRequirementUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/SatisfyRequirementUsage.cs @@ -475,12 +475,15 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/SendActionUsage.cs b/SysML2.NET/Core/AutoGenDto/SendActionUsage.cs index 828e3add0..b6817789b 100644 --- a/SysML2.NET/Core/AutoGenDto/SendActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/SendActionUsage.cs @@ -405,12 +405,15 @@ public partial class SendActionUsage : ISendActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/StakeholderMembership.cs b/SysML2.NET/Core/AutoGenDto/StakeholderMembership.cs index f14922526..afea2d7c2 100644 --- a/SysML2.NET/Core/AutoGenDto/StakeholderMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/StakeholderMembership.cs @@ -110,12 +110,15 @@ public partial class StakeholderMembership : IStakeholderMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedStakeholderParameter = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -153,12 +159,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -353,12 +362,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -366,7 +378,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/StateSubactionMembership.cs b/SysML2.NET/Core/AutoGenDto/StateSubactionMembership.cs index 8bb903112..c4f2c11ec 100644 --- a/SysML2.NET/Core/AutoGenDto/StateSubactionMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/StateSubactionMembership.cs @@ -125,12 +125,15 @@ public partial class StateSubactionMembership : IStateSubactionMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.action = value; + } } /// @@ -145,12 +148,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -168,12 +174,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -351,12 +360,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -364,7 +376,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/StateUsage.cs b/SysML2.NET/Core/AutoGenDto/StateUsage.cs index 7045a0e2a..3b89811dc 100644 --- a/SysML2.NET/Core/AutoGenDto/StateUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/StateUsage.cs @@ -441,12 +441,15 @@ public partial class StateUsage : IStateUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/SubjectMembership.cs b/SysML2.NET/Core/AutoGenDto/SubjectMembership.cs index 0ab874b08..bd6b85b39 100644 --- a/SysML2.NET/Core/AutoGenDto/SubjectMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/SubjectMembership.cs @@ -110,12 +110,15 @@ public partial class SubjectMembership : ISubjectMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedSubjectParameter = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -153,12 +159,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -353,12 +362,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -366,7 +378,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/Succession.cs b/SysML2.NET/Core/AutoGenDto/Succession.cs index a6729c6fd..6820b457a 100644 --- a/SysML2.NET/Core/AutoGenDto/Succession.cs +++ b/SysML2.NET/Core/AutoGenDto/Succession.cs @@ -748,12 +748,15 @@ public partial class Succession : ISuccession /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -770,12 +773,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/SuccessionAsUsage.cs b/SysML2.NET/Core/AutoGenDto/SuccessionAsUsage.cs index ec41b7ed3..d5843685f 100644 --- a/SysML2.NET/Core/AutoGenDto/SuccessionAsUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/SuccessionAsUsage.cs @@ -398,12 +398,15 @@ public partial class SuccessionAsUsage : ISuccessionAsUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1037,12 +1040,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1059,12 +1065,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/SuccessionFlow.cs b/SysML2.NET/Core/AutoGenDto/SuccessionFlow.cs index 54bb4b939..788cf4bbf 100644 --- a/SysML2.NET/Core/AutoGenDto/SuccessionFlow.cs +++ b/SysML2.NET/Core/AutoGenDto/SuccessionFlow.cs @@ -804,12 +804,15 @@ public partial class SuccessionFlow : ISuccessionFlow /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -834,12 +837,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/SuccessionFlowUsage.cs b/SysML2.NET/Core/AutoGenDto/SuccessionFlowUsage.cs index a94347323..09955cc28 100644 --- a/SysML2.NET/Core/AutoGenDto/SuccessionFlowUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/SuccessionFlowUsage.cs @@ -469,12 +469,15 @@ public partial class SuccessionFlowUsage : ISuccessionFlowUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// @@ -1152,12 +1155,15 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => this.sourceFeature.HasValue ? [this.sourceFeature.Value] : []; - set { } + set + { + this.sourceFeature = value.Count != 0 ? value[0] : null; + } } /// @@ -1182,12 +1188,15 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { get => [.. this.targetFeature]; - set { } + set + { + this.targetFeature = [.. value]; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/TerminateActionUsage.cs b/SysML2.NET/Core/AutoGenDto/TerminateActionUsage.cs index cb9651e59..b0be398ec 100644 --- a/SysML2.NET/Core/AutoGenDto/TerminateActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/TerminateActionUsage.cs @@ -404,12 +404,15 @@ public partial class TerminateActionUsage : ITerminateActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/TransitionFeatureMembership.cs b/SysML2.NET/Core/AutoGenDto/TransitionFeatureMembership.cs index 928ac75ec..ead672d19 100644 --- a/SysML2.NET/Core/AutoGenDto/TransitionFeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/TransitionFeatureMembership.cs @@ -118,12 +118,15 @@ public partial class TransitionFeatureMembership : ITransitionFeatureMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.transitionFeature = value; + } } /// @@ -138,12 +141,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -161,12 +167,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -344,12 +353,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -357,7 +369,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/TransitionUsage.cs b/SysML2.NET/Core/AutoGenDto/TransitionUsage.cs index b9254da6e..61537fcd4 100644 --- a/SysML2.NET/Core/AutoGenDto/TransitionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/TransitionUsage.cs @@ -426,12 +426,15 @@ public partial class TransitionUsage : ITransitionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Unioning.cs b/SysML2.NET/Core/AutoGenDto/Unioning.cs index 9b64f0bdf..1f831bce5 100644 --- a/SysML2.NET/Core/AutoGenDto/Unioning.cs +++ b/SysML2.NET/Core/AutoGenDto/Unioning.cs @@ -223,12 +223,15 @@ public partial class Unioning : IUnioning /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IUnioning.TypeUnioned")] + [RedefinedByProperty("IUnioning.TypeUnioned", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.typeUnioned]; - set { } + set + { + this.typeUnioned = value.Count != 0 ? value[0] : Guid.Empty; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/Usage.cs b/SysML2.NET/Core/AutoGenDto/Usage.cs index 332f33ffd..e5f5e54a1 100644 --- a/SysML2.NET/Core/AutoGenDto/Usage.cs +++ b/SysML2.NET/Core/AutoGenDto/Usage.cs @@ -368,12 +368,15 @@ public partial class Usage : IUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/UseCaseUsage.cs b/SysML2.NET/Core/AutoGenDto/UseCaseUsage.cs index 74f5e3ee6..dea943ec0 100644 --- a/SysML2.NET/Core/AutoGenDto/UseCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/UseCaseUsage.cs @@ -458,12 +458,15 @@ public partial class UseCaseUsage : IUseCaseUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/VariantMembership.cs b/SysML2.NET/Core/AutoGenDto/VariantMembership.cs index 4f1a998d0..57967bd82 100644 --- a/SysML2.NET/Core/AutoGenDto/VariantMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/VariantMembership.cs @@ -110,12 +110,15 @@ public partial class VariantMembership : IVariantMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedVariantUsage = value; + } } /// @@ -130,12 +133,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -152,12 +158,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -325,12 +334,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [this.membershipOwningNamespace]; - set { } + set + { + this.membershipOwningNamespace = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -338,7 +350,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/VerificationCaseUsage.cs b/SysML2.NET/Core/AutoGenDto/VerificationCaseUsage.cs index 1327f27f5..867d5349b 100644 --- a/SysML2.NET/Core/AutoGenDto/VerificationCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/VerificationCaseUsage.cs @@ -449,12 +449,15 @@ public partial class VerificationCaseUsage : IVerificationCaseUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ViewRenderingMembership.cs b/SysML2.NET/Core/AutoGenDto/ViewRenderingMembership.cs index 590d0b2e9..a382ef12d 100644 --- a/SysML2.NET/Core/AutoGenDto/ViewRenderingMembership.cs +++ b/SysML2.NET/Core/AutoGenDto/ViewRenderingMembership.cs @@ -109,12 +109,15 @@ public partial class ViewRenderingMembership : IViewRenderingMembership /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] Guid Root.Namespaces.IMembership.MemberElement { get => ((SysML2.NET.Core.DTO.Root.Namespaces.IOwningMembership)this).ownedMemberElement; - set { } + set + { + this.ownedRendering = value; + } } /// @@ -129,12 +132,15 @@ Guid Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { get => this.ownedMemberName; - set { } + set + { + this.ownedMemberName = value; + } } /// @@ -152,12 +158,15 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { get => this.ownedMemberShortName; - set { } + set + { + this.ownedMemberShortName = value; + } } /// @@ -353,12 +362,15 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { get => [((SysML2.NET.Core.DTO.Root.Namespaces.IMembership)this).membershipOwningNamespace]; - set { } + set + { + this.owningType = value.Count != 0 ? value[0] : Guid.Empty; + } } /// @@ -366,7 +378,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenDto/ViewUsage.cs b/SysML2.NET/Core/AutoGenDto/ViewUsage.cs index 69302f9fc..026fe49e4 100644 --- a/SysML2.NET/Core/AutoGenDto/ViewUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ViewUsage.cs @@ -391,12 +391,15 @@ public partial class ViewUsage : IViewUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/ViewpointUsage.cs b/SysML2.NET/Core/AutoGenDto/ViewpointUsage.cs index b660e01f2..7a7f99518 100644 --- a/SysML2.NET/Core/AutoGenDto/ViewpointUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/ViewpointUsage.cs @@ -455,12 +455,15 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenDto/WhileLoopActionUsage.cs b/SysML2.NET/Core/AutoGenDto/WhileLoopActionUsage.cs index a18fee45c..0bf9571f4 100644 --- a/SysML2.NET/Core/AutoGenDto/WhileLoopActionUsage.cs +++ b/SysML2.NET/Core/AutoGenDto/WhileLoopActionUsage.cs @@ -412,12 +412,15 @@ public partial class WhileLoopActionUsage : IWhileLoopActionUsage /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { get => this.mayTimeVary; - set { } + set + { + this.mayTimeVary = value; + } } /// diff --git a/SysML2.NET/Core/AutoGenPoco/AcceptActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/AcceptActionUsage.cs index 6cba5d8a9..379d15330 100644 --- a/SysML2.NET/Core/AutoGenPoco/AcceptActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AcceptActionUsage.cs @@ -448,7 +448,7 @@ public AcceptActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/ActionUsage.cs index 6bd23eba1..4b98a570a 100644 --- a/SysML2.NET/Core/AutoGenPoco/ActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ActionUsage.cs @@ -447,7 +447,7 @@ public ActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ActorMembership.cs b/SysML2.NET/Core/AutoGenPoco/ActorMembership.cs index 7e5ebe026..d8a690665 100644 --- a/SysML2.NET/Core/AutoGenPoco/ActorMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ActorMembership.cs @@ -134,7 +134,7 @@ public ActorMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -154,7 +154,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -177,7 +177,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -389,7 +389,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -402,7 +402,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/AllocationDefinition.cs b/SysML2.NET/Core/AutoGenPoco/AllocationDefinition.cs index 7af212f66..5da5c7e38 100644 --- a/SysML2.NET/Core/AutoGenPoco/AllocationDefinition.cs +++ b/SysML2.NET/Core/AutoGenPoco/AllocationDefinition.cs @@ -859,7 +859,7 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -881,7 +881,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/AllocationUsage.cs b/SysML2.NET/Core/AutoGenPoco/AllocationUsage.cs index 2de8ed9c0..3a60b967d 100644 --- a/SysML2.NET/Core/AutoGenPoco/AllocationUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AllocationUsage.cs @@ -486,7 +486,7 @@ public AllocationUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1174,7 +1174,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1196,7 +1196,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/AnalysisCaseUsage.cs b/SysML2.NET/Core/AutoGenPoco/AnalysisCaseUsage.cs index fb319cc72..3702254ba 100644 --- a/SysML2.NET/Core/AutoGenPoco/AnalysisCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AnalysisCaseUsage.cs @@ -501,7 +501,7 @@ public AnalysisCaseUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Annotation.cs b/SysML2.NET/Core/AutoGenPoco/Annotation.cs index 5654b6cf9..e78021e1e 100644 --- a/SysML2.NET/Core/AutoGenPoco/Annotation.cs +++ b/SysML2.NET/Core/AutoGenPoco/Annotation.cs @@ -298,7 +298,7 @@ public Annotation() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAnnotation.AnnotatingElement")] + [RedefinedByProperty("IAnnotation.AnnotatingElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/AssertConstraintUsage.cs b/SysML2.NET/Core/AutoGenPoco/AssertConstraintUsage.cs index 321b0413d..cc26f655f 100644 --- a/SysML2.NET/Core/AutoGenPoco/AssertConstraintUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AssertConstraintUsage.cs @@ -479,7 +479,7 @@ public AssertConstraintUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/AssignmentActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/AssignmentActionUsage.cs index a00889f6f..e325489db 100644 --- a/SysML2.NET/Core/AutoGenPoco/AssignmentActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AssignmentActionUsage.cs @@ -447,7 +447,7 @@ public AssignmentActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Association.cs b/SysML2.NET/Core/AutoGenPoco/Association.cs index 1ebab8d69..68eda273b 100644 --- a/SysML2.NET/Core/AutoGenPoco/Association.cs +++ b/SysML2.NET/Core/AutoGenPoco/Association.cs @@ -558,7 +558,7 @@ public Association() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -580,7 +580,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/AssociationStructure.cs b/SysML2.NET/Core/AutoGenPoco/AssociationStructure.cs index 21b74cddd..d10db8953 100644 --- a/SysML2.NET/Core/AutoGenPoco/AssociationStructure.cs +++ b/SysML2.NET/Core/AutoGenPoco/AssociationStructure.cs @@ -560,7 +560,7 @@ public AssociationStructure() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -582,7 +582,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/AttributeUsage.cs b/SysML2.NET/Core/AutoGenPoco/AttributeUsage.cs index 0f2ee1c8e..17c2567c8 100644 --- a/SysML2.NET/Core/AutoGenPoco/AttributeUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/AttributeUsage.cs @@ -428,7 +428,7 @@ public AttributeUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/BindingConnector.cs b/SysML2.NET/Core/AutoGenPoco/BindingConnector.cs index f971d181a..bc19bd620 100644 --- a/SysML2.NET/Core/AutoGenPoco/BindingConnector.cs +++ b/SysML2.NET/Core/AutoGenPoco/BindingConnector.cs @@ -785,7 +785,7 @@ public BindingConnector() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -807,7 +807,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/BindingConnectorAsUsage.cs b/SysML2.NET/Core/AutoGenPoco/BindingConnectorAsUsage.cs index 516d5a4b7..7ec4548fd 100644 --- a/SysML2.NET/Core/AutoGenPoco/BindingConnectorAsUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/BindingConnectorAsUsage.cs @@ -444,7 +444,7 @@ public BindingConnectorAsUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1095,7 +1095,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1117,7 +1117,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/CalculationUsage.cs b/SysML2.NET/Core/AutoGenPoco/CalculationUsage.cs index 829773dfa..9f5a0b656 100644 --- a/SysML2.NET/Core/AutoGenPoco/CalculationUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/CalculationUsage.cs @@ -477,7 +477,7 @@ public CalculationUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/CaseUsage.cs b/SysML2.NET/Core/AutoGenPoco/CaseUsage.cs index aa581b54e..f3c2541da 100644 --- a/SysML2.NET/Core/AutoGenPoco/CaseUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/CaseUsage.cs @@ -492,7 +492,7 @@ public CaseUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ConcernUsage.cs b/SysML2.NET/Core/AutoGenPoco/ConcernUsage.cs index e57555cf4..502b78bb9 100644 --- a/SysML2.NET/Core/AutoGenPoco/ConcernUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ConcernUsage.cs @@ -509,7 +509,7 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ConnectionDefinition.cs b/SysML2.NET/Core/AutoGenPoco/ConnectionDefinition.cs index 6e867a3a3..6b3118816 100644 --- a/SysML2.NET/Core/AutoGenPoco/ConnectionDefinition.cs +++ b/SysML2.NET/Core/AutoGenPoco/ConnectionDefinition.cs @@ -847,7 +847,7 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -869,7 +869,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ConnectionUsage.cs b/SysML2.NET/Core/AutoGenPoco/ConnectionUsage.cs index f0c9c8808..253599385 100644 --- a/SysML2.NET/Core/AutoGenPoco/ConnectionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ConnectionUsage.cs @@ -479,7 +479,7 @@ public ConnectionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1167,7 +1167,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1189,7 +1189,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/Connector.cs b/SysML2.NET/Core/AutoGenPoco/Connector.cs index 51d5fe20d..f03363b43 100644 --- a/SysML2.NET/Core/AutoGenPoco/Connector.cs +++ b/SysML2.NET/Core/AutoGenPoco/Connector.cs @@ -787,7 +787,7 @@ public Connector() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -809,7 +809,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ConstraintUsage.cs b/SysML2.NET/Core/AutoGenPoco/ConstraintUsage.cs index 3e9ed89b2..aba72d53d 100644 --- a/SysML2.NET/Core/AutoGenPoco/ConstraintUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ConstraintUsage.cs @@ -464,7 +464,7 @@ public ConstraintUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/CrossSubsetting.cs b/SysML2.NET/Core/AutoGenPoco/CrossSubsetting.cs index f76494a38..ed2f494cd 100644 --- a/SysML2.NET/Core/AutoGenPoco/CrossSubsetting.cs +++ b/SysML2.NET/Core/AutoGenPoco/CrossSubsetting.cs @@ -324,7 +324,7 @@ IType Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -343,7 +343,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] IType Core.Types.ISpecialization.Specific { @@ -378,7 +378,7 @@ IFeature ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("ICrossSubsetting.CrossingFeature")] + [RedefinedByProperty("ICrossSubsetting.CrossingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] IFeature ISubsetting.SubsettingFeature { diff --git a/SysML2.NET/Core/AutoGenPoco/DecisionNode.cs b/SysML2.NET/Core/AutoGenPoco/DecisionNode.cs index 63c44a473..bdc345479 100644 --- a/SysML2.NET/Core/AutoGenPoco/DecisionNode.cs +++ b/SysML2.NET/Core/AutoGenPoco/DecisionNode.cs @@ -444,7 +444,7 @@ public DecisionNode() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Differencing.cs b/SysML2.NET/Core/AutoGenPoco/Differencing.cs index f57d0728f..5d410f848 100644 --- a/SysML2.NET/Core/AutoGenPoco/Differencing.cs +++ b/SysML2.NET/Core/AutoGenPoco/Differencing.cs @@ -264,7 +264,7 @@ public Differencing() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IDifferencing.TypeDifferenced")] + [RedefinedByProperty("IDifferencing.TypeDifferenced", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/ElementFilterMembership.cs b/SysML2.NET/Core/AutoGenPoco/ElementFilterMembership.cs index 3acc891cf..4ee3f72fc 100644 --- a/SysML2.NET/Core/AutoGenPoco/ElementFilterMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ElementFilterMembership.cs @@ -140,7 +140,7 @@ public ElementFilterMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -160,7 +160,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -182,7 +182,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -358,7 +358,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -371,7 +371,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/EndFeatureMembership.cs b/SysML2.NET/Core/AutoGenPoco/EndFeatureMembership.cs index 05dc716dc..394884514 100644 --- a/SysML2.NET/Core/AutoGenPoco/EndFeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/EndFeatureMembership.cs @@ -129,7 +129,7 @@ public EndFeatureMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -149,7 +149,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -172,7 +172,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -374,7 +374,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -387,7 +387,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/EnumerationUsage.cs b/SysML2.NET/Core/AutoGenPoco/EnumerationUsage.cs index 9c58bcaa4..cb4f77af0 100644 --- a/SysML2.NET/Core/AutoGenPoco/EnumerationUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/EnumerationUsage.cs @@ -432,7 +432,7 @@ public EnumerationUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/EventOccurrenceUsage.cs b/SysML2.NET/Core/AutoGenPoco/EventOccurrenceUsage.cs index 3ec9622d8..e6a3dcd29 100644 --- a/SysML2.NET/Core/AutoGenPoco/EventOccurrenceUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/EventOccurrenceUsage.cs @@ -444,7 +444,7 @@ public EventOccurrenceUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ExhibitStateUsage.cs b/SysML2.NET/Core/AutoGenPoco/ExhibitStateUsage.cs index 7bb573c3c..ce25b9aa8 100644 --- a/SysML2.NET/Core/AutoGenPoco/ExhibitStateUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ExhibitStateUsage.cs @@ -512,7 +512,7 @@ public ExhibitStateUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/FeatureChaining.cs b/SysML2.NET/Core/AutoGenPoco/FeatureChaining.cs index 6a3f0c226..b9937d7a6 100644 --- a/SysML2.NET/Core/AutoGenPoco/FeatureChaining.cs +++ b/SysML2.NET/Core/AutoGenPoco/FeatureChaining.cs @@ -274,7 +274,7 @@ public FeatureChaining() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IFeatureChaining.FeatureChained")] + [RedefinedByProperty("IFeatureChaining.FeatureChained", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/FeatureMembership.cs b/SysML2.NET/Core/AutoGenPoco/FeatureMembership.cs index 36667694d..430580056 100644 --- a/SysML2.NET/Core/AutoGenPoco/FeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/FeatureMembership.cs @@ -132,7 +132,7 @@ public FeatureMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -152,7 +152,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -175,7 +175,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -369,7 +369,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -382,7 +382,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/FeatureValue.cs b/SysML2.NET/Core/AutoGenPoco/FeatureValue.cs index a995e59f4..aba828633 100644 --- a/SysML2.NET/Core/AutoGenPoco/FeatureValue.cs +++ b/SysML2.NET/Core/AutoGenPoco/FeatureValue.cs @@ -162,7 +162,7 @@ public FeatureValue() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -182,7 +182,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -204,7 +204,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -380,7 +380,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -393,7 +393,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/Flow.cs b/SysML2.NET/Core/AutoGenPoco/Flow.cs index 48990b603..7b10c3b2b 100644 --- a/SysML2.NET/Core/AutoGenPoco/Flow.cs +++ b/SysML2.NET/Core/AutoGenPoco/Flow.cs @@ -841,7 +841,7 @@ public Flow() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -871,7 +871,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/FlowDefinition.cs b/SysML2.NET/Core/AutoGenPoco/FlowDefinition.cs index 016b0f606..7363c50d1 100644 --- a/SysML2.NET/Core/AutoGenPoco/FlowDefinition.cs +++ b/SysML2.NET/Core/AutoGenPoco/FlowDefinition.cs @@ -853,7 +853,7 @@ public FlowDefinition() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -883,7 +883,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/FlowUsage.cs b/SysML2.NET/Core/AutoGenPoco/FlowUsage.cs index 0450e6520..f1d31e186 100644 --- a/SysML2.NET/Core/AutoGenPoco/FlowUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/FlowUsage.cs @@ -519,7 +519,7 @@ public FlowUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1214,7 +1214,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1244,7 +1244,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ForLoopActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/ForLoopActionUsage.cs index 1f05262ce..664d627b0 100644 --- a/SysML2.NET/Core/AutoGenPoco/ForLoopActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ForLoopActionUsage.cs @@ -454,7 +454,7 @@ public ForLoopActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ForkNode.cs b/SysML2.NET/Core/AutoGenPoco/ForkNode.cs index 8304cb834..c5a08987e 100644 --- a/SysML2.NET/Core/AutoGenPoco/ForkNode.cs +++ b/SysML2.NET/Core/AutoGenPoco/ForkNode.cs @@ -445,7 +445,7 @@ public ForkNode() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/FramedConcernMembership.cs b/SysML2.NET/Core/AutoGenPoco/FramedConcernMembership.cs index 43fe062e6..784288a7b 100644 --- a/SysML2.NET/Core/AutoGenPoco/FramedConcernMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/FramedConcernMembership.cs @@ -155,7 +155,7 @@ RequirementConstraintKind IRequirementConstraintMembership.Kind /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -175,7 +175,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -198,7 +198,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -430,7 +430,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -443,7 +443,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/IfActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/IfActionUsage.cs index 81b0a8cdd..ddc3cee52 100644 --- a/SysML2.NET/Core/AutoGenPoco/IfActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/IfActionUsage.cs @@ -462,7 +462,7 @@ public IfActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/IncludeUseCaseUsage.cs b/SysML2.NET/Core/AutoGenPoco/IncludeUseCaseUsage.cs index 8a71ffad3..d529ca04a 100644 --- a/SysML2.NET/Core/AutoGenPoco/IncludeUseCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/IncludeUseCaseUsage.cs @@ -523,7 +523,7 @@ public IncludeUseCaseUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Interaction.cs b/SysML2.NET/Core/AutoGenPoco/Interaction.cs index d031c1e9a..d172499f2 100644 --- a/SysML2.NET/Core/AutoGenPoco/Interaction.cs +++ b/SysML2.NET/Core/AutoGenPoco/Interaction.cs @@ -569,7 +569,7 @@ public Interaction() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -599,7 +599,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/InterfaceDefinition.cs b/SysML2.NET/Core/AutoGenPoco/InterfaceDefinition.cs index 6257824a7..6d60b4237 100644 --- a/SysML2.NET/Core/AutoGenPoco/InterfaceDefinition.cs +++ b/SysML2.NET/Core/AutoGenPoco/InterfaceDefinition.cs @@ -856,7 +856,7 @@ bool Core.Types.IType.IsSufficient /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.SourceType")] + [RedefinedByProperty("IAssociation.SourceType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -878,7 +878,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IAssociation.TargetType")] + [RedefinedByProperty("IAssociation.TargetType", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/InterfaceUsage.cs b/SysML2.NET/Core/AutoGenPoco/InterfaceUsage.cs index 6101786c8..6fa78fe1c 100644 --- a/SysML2.NET/Core/AutoGenPoco/InterfaceUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/InterfaceUsage.cs @@ -486,7 +486,7 @@ public InterfaceUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1174,7 +1174,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1196,7 +1196,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/Intersecting.cs b/SysML2.NET/Core/AutoGenPoco/Intersecting.cs index cbcd2a8d9..c2e15784a 100644 --- a/SysML2.NET/Core/AutoGenPoco/Intersecting.cs +++ b/SysML2.NET/Core/AutoGenPoco/Intersecting.cs @@ -264,7 +264,7 @@ public Intersecting() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IIntersecting.TypeIntersected")] + [RedefinedByProperty("IIntersecting.TypeIntersected", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/ItemUsage.cs b/SysML2.NET/Core/AutoGenPoco/ItemUsage.cs index c8aac8258..42ceca1dd 100644 --- a/SysML2.NET/Core/AutoGenPoco/ItemUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ItemUsage.cs @@ -425,7 +425,7 @@ public ItemUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/JoinNode.cs b/SysML2.NET/Core/AutoGenPoco/JoinNode.cs index 4416f8ba7..dbc2c165d 100644 --- a/SysML2.NET/Core/AutoGenPoco/JoinNode.cs +++ b/SysML2.NET/Core/AutoGenPoco/JoinNode.cs @@ -445,7 +445,7 @@ public JoinNode() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Membership.cs b/SysML2.NET/Core/AutoGenPoco/Membership.cs index 28b275543..5b81e97dd 100644 --- a/SysML2.NET/Core/AutoGenPoco/Membership.cs +++ b/SysML2.NET/Core/AutoGenPoco/Membership.cs @@ -299,7 +299,7 @@ public Membership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/MembershipExpose.cs b/SysML2.NET/Core/AutoGenPoco/MembershipExpose.cs index 43537a969..f140c498d 100644 --- a/SysML2.NET/Core/AutoGenPoco/MembershipExpose.cs +++ b/SysML2.NET/Core/AutoGenPoco/MembershipExpose.cs @@ -312,7 +312,7 @@ bool Root.Namespaces.IImport.IsImportAll /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/MembershipImport.cs b/SysML2.NET/Core/AutoGenPoco/MembershipImport.cs index 95e84c1cf..e34755f4e 100644 --- a/SysML2.NET/Core/AutoGenPoco/MembershipImport.cs +++ b/SysML2.NET/Core/AutoGenPoco/MembershipImport.cs @@ -296,7 +296,7 @@ public MembershipImport() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/MergeNode.cs b/SysML2.NET/Core/AutoGenPoco/MergeNode.cs index 2d61b09f8..eb75b0c1a 100644 --- a/SysML2.NET/Core/AutoGenPoco/MergeNode.cs +++ b/SysML2.NET/Core/AutoGenPoco/MergeNode.cs @@ -445,7 +445,7 @@ public MergeNode() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/MetadataUsage.cs b/SysML2.NET/Core/AutoGenPoco/MetadataUsage.cs index 1f0ffec53..2a0122b92 100644 --- a/SysML2.NET/Core/AutoGenPoco/MetadataUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/MetadataUsage.cs @@ -444,7 +444,7 @@ public MetadataUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/NamespaceExpose.cs b/SysML2.NET/Core/AutoGenPoco/NamespaceExpose.cs index 7750ef8ad..3e97708f2 100644 --- a/SysML2.NET/Core/AutoGenPoco/NamespaceExpose.cs +++ b/SysML2.NET/Core/AutoGenPoco/NamespaceExpose.cs @@ -312,7 +312,7 @@ bool Root.Namespaces.IImport.IsImportAll /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/NamespaceImport.cs b/SysML2.NET/Core/AutoGenPoco/NamespaceImport.cs index e2c67dcb2..ebac16cdd 100644 --- a/SysML2.NET/Core/AutoGenPoco/NamespaceImport.cs +++ b/SysML2.NET/Core/AutoGenPoco/NamespaceImport.cs @@ -297,7 +297,7 @@ public NamespaceImport() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IImport.ImportOwningNamespace")] + [RedefinedByProperty("IImport.ImportOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/ObjectiveMembership.cs b/SysML2.NET/Core/AutoGenPoco/ObjectiveMembership.cs index 15ab7f0c2..a5c37c90f 100644 --- a/SysML2.NET/Core/AutoGenPoco/ObjectiveMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ObjectiveMembership.cs @@ -131,7 +131,7 @@ public ObjectiveMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -151,7 +151,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -174,7 +174,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -377,7 +377,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -390,7 +390,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/OccurrenceUsage.cs b/SysML2.NET/Core/AutoGenPoco/OccurrenceUsage.cs index fc5555ae7..b3c6589e1 100644 --- a/SysML2.NET/Core/AutoGenPoco/OccurrenceUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/OccurrenceUsage.cs @@ -424,7 +424,7 @@ public OccurrenceUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/OwningMembership.cs b/SysML2.NET/Core/AutoGenPoco/OwningMembership.cs index 444ef90f3..0351f9691 100644 --- a/SysML2.NET/Core/AutoGenPoco/OwningMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/OwningMembership.cs @@ -127,7 +127,7 @@ public OwningMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement IMembership.MemberElement { @@ -147,7 +147,7 @@ IElement IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string IMembership.MemberName { @@ -169,7 +169,7 @@ string IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string IMembership.MemberShortName { @@ -344,7 +344,7 @@ string IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -357,7 +357,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ParameterMembership.cs b/SysML2.NET/Core/AutoGenPoco/ParameterMembership.cs index d9c4b76f6..da362df61 100644 --- a/SysML2.NET/Core/AutoGenPoco/ParameterMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ParameterMembership.cs @@ -132,7 +132,7 @@ public ParameterMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -152,7 +152,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -175,7 +175,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -378,7 +378,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -391,7 +391,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/PartUsage.cs b/SysML2.NET/Core/AutoGenPoco/PartUsage.cs index 90f666c1a..01ff6ab14 100644 --- a/SysML2.NET/Core/AutoGenPoco/PartUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/PartUsage.cs @@ -424,7 +424,7 @@ public PartUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/PerformActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/PerformActionUsage.cs index 55c4e0e1e..d7458ed0b 100644 --- a/SysML2.NET/Core/AutoGenPoco/PerformActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/PerformActionUsage.cs @@ -466,7 +466,7 @@ public PerformActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/PortUsage.cs b/SysML2.NET/Core/AutoGenPoco/PortUsage.cs index dbe7b2e33..74468de76 100644 --- a/SysML2.NET/Core/AutoGenPoco/PortUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/PortUsage.cs @@ -422,7 +422,7 @@ public PortUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ReferenceSubsetting.cs b/SysML2.NET/Core/AutoGenPoco/ReferenceSubsetting.cs index 5b84abca9..2cf204978 100644 --- a/SysML2.NET/Core/AutoGenPoco/ReferenceSubsetting.cs +++ b/SysML2.NET/Core/AutoGenPoco/ReferenceSubsetting.cs @@ -316,7 +316,7 @@ IType Core.Types.ISpecialization.General /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("ISpecialization.Specific")] + [RedefinedByProperty("ISpecialization.Specific", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -335,7 +335,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674982_253967_43281", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674971_696758_43228")] - [RedefinedByProperty("ISubsetting.SubsettingFeature")] + [RedefinedByProperty("ISubsetting.SubsettingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISpecialization.Specific")] IType Core.Types.ISpecialization.Specific { @@ -370,7 +370,7 @@ IFeature ISubsetting.SubsettedFeature /// [Property(xmiId: "_18_5_3_12e503d9_1533160674967_140305_43206", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674982_253967_43281")] - [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature")] + [RedefinedByProperty("IReferenceSubsetting.ReferencingFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "ISubsetting.SubsettingFeature")] IFeature ISubsetting.SubsettingFeature { diff --git a/SysML2.NET/Core/AutoGenPoco/ReferenceUsage.cs b/SysML2.NET/Core/AutoGenPoco/ReferenceUsage.cs index e7bee0184..5e287269f 100644 --- a/SysML2.NET/Core/AutoGenPoco/ReferenceUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ReferenceUsage.cs @@ -415,7 +415,7 @@ public ReferenceUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/RenderingUsage.cs b/SysML2.NET/Core/AutoGenPoco/RenderingUsage.cs index 42ed9610b..b873f2d9b 100644 --- a/SysML2.NET/Core/AutoGenPoco/RenderingUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/RenderingUsage.cs @@ -423,7 +423,7 @@ public RenderingUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/RequirementConstraintMembership.cs b/SysML2.NET/Core/AutoGenPoco/RequirementConstraintMembership.cs index 68d12c853..e5e3b1b2d 100644 --- a/SysML2.NET/Core/AutoGenPoco/RequirementConstraintMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/RequirementConstraintMembership.cs @@ -139,7 +139,7 @@ public RequirementConstraintMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -159,7 +159,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -182,7 +182,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -394,7 +394,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -407,7 +407,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/RequirementUsage.cs b/SysML2.NET/Core/AutoGenPoco/RequirementUsage.cs index 36d45b9c3..7fdd95fef 100644 --- a/SysML2.NET/Core/AutoGenPoco/RequirementUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/RequirementUsage.cs @@ -498,7 +498,7 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/RequirementVerificationMembership.cs b/SysML2.NET/Core/AutoGenPoco/RequirementVerificationMembership.cs index 5e09dbe4a..32791efdf 100644 --- a/SysML2.NET/Core/AutoGenPoco/RequirementVerificationMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/RequirementVerificationMembership.cs @@ -156,7 +156,7 @@ RequirementConstraintKind Systems.Requirements.IRequirementConstraintMembership. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -176,7 +176,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -199,7 +199,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -423,7 +423,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -436,7 +436,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ResultExpressionMembership.cs b/SysML2.NET/Core/AutoGenPoco/ResultExpressionMembership.cs index a3c9fda80..9cf385029 100644 --- a/SysML2.NET/Core/AutoGenPoco/ResultExpressionMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ResultExpressionMembership.cs @@ -132,7 +132,7 @@ public ResultExpressionMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -152,7 +152,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -175,7 +175,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -378,7 +378,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -391,7 +391,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ReturnParameterMembership.cs b/SysML2.NET/Core/AutoGenPoco/ReturnParameterMembership.cs index 64f609082..8f1c89d38 100644 --- a/SysML2.NET/Core/AutoGenPoco/ReturnParameterMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ReturnParameterMembership.cs @@ -133,7 +133,7 @@ public ReturnParameterMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -153,7 +153,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -176,7 +176,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -379,7 +379,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -392,7 +392,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/SatisfyRequirementUsage.cs b/SysML2.NET/Core/AutoGenPoco/SatisfyRequirementUsage.cs index 4e87d4506..8cae64e5b 100644 --- a/SysML2.NET/Core/AutoGenPoco/SatisfyRequirementUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/SatisfyRequirementUsage.cs @@ -518,7 +518,7 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/SendActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/SendActionUsage.cs index 23c1d75d0..7e05894ff 100644 --- a/SysML2.NET/Core/AutoGenPoco/SendActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/SendActionUsage.cs @@ -449,7 +449,7 @@ public SendActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/StakeholderMembership.cs b/SysML2.NET/Core/AutoGenPoco/StakeholderMembership.cs index 92b0d6f60..326b37d0b 100644 --- a/SysML2.NET/Core/AutoGenPoco/StakeholderMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/StakeholderMembership.cs @@ -134,7 +134,7 @@ public StakeholderMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -154,7 +154,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -177,7 +177,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -389,7 +389,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -402,7 +402,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/StateSubactionMembership.cs b/SysML2.NET/Core/AutoGenPoco/StateSubactionMembership.cs index 22f258c82..1e95c9fca 100644 --- a/SysML2.NET/Core/AutoGenPoco/StateSubactionMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/StateSubactionMembership.cs @@ -147,7 +147,7 @@ public StateSubactionMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -167,7 +167,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -190,7 +190,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -385,7 +385,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -398,7 +398,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/StateUsage.cs b/SysML2.NET/Core/AutoGenPoco/StateUsage.cs index a97b89d9a..0e9cba66d 100644 --- a/SysML2.NET/Core/AutoGenPoco/StateUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/StateUsage.cs @@ -484,7 +484,7 @@ public StateUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/SubjectMembership.cs b/SysML2.NET/Core/AutoGenPoco/SubjectMembership.cs index 5d02cee73..f5d3c7c1c 100644 --- a/SysML2.NET/Core/AutoGenPoco/SubjectMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/SubjectMembership.cs @@ -134,7 +134,7 @@ public SubjectMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -154,7 +154,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -177,7 +177,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -389,7 +389,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -402,7 +402,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/Succession.cs b/SysML2.NET/Core/AutoGenPoco/Succession.cs index 77ac4e173..b49b5635a 100644 --- a/SysML2.NET/Core/AutoGenPoco/Succession.cs +++ b/SysML2.NET/Core/AutoGenPoco/Succession.cs @@ -784,7 +784,7 @@ public Succession() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -806,7 +806,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/SuccessionAsUsage.cs b/SysML2.NET/Core/AutoGenPoco/SuccessionAsUsage.cs index 85204baf5..bd53f1480 100644 --- a/SysML2.NET/Core/AutoGenPoco/SuccessionAsUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/SuccessionAsUsage.cs @@ -444,7 +444,7 @@ public SuccessionAsUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1095,7 +1095,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1117,7 +1117,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/SuccessionFlow.cs b/SysML2.NET/Core/AutoGenPoco/SuccessionFlow.cs index 7318cc258..de2077ccc 100644 --- a/SysML2.NET/Core/AutoGenPoco/SuccessionFlow.cs +++ b/SysML2.NET/Core/AutoGenPoco/SuccessionFlow.cs @@ -842,7 +842,7 @@ public SuccessionFlow() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -872,7 +872,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/SuccessionFlowUsage.cs b/SysML2.NET/Core/AutoGenPoco/SuccessionFlowUsage.cs index e596f65d0..d42db8a17 100644 --- a/SysML2.NET/Core/AutoGenPoco/SuccessionFlowUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/SuccessionFlowUsage.cs @@ -519,7 +519,7 @@ public SuccessionFlowUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { @@ -1214,7 +1214,7 @@ bool Core.Features.IFeature.IsVariable /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.SourceFeature")] + [RedefinedByProperty("IConnector.SourceFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -1244,7 +1244,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IConnector.TargetFeature")] + [RedefinedByProperty("IConnector.TargetFeature", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/TerminateActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/TerminateActionUsage.cs index 2108bd1e9..bde92c6d2 100644 --- a/SysML2.NET/Core/AutoGenPoco/TerminateActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/TerminateActionUsage.cs @@ -448,7 +448,7 @@ public TerminateActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/TransitionFeatureMembership.cs b/SysML2.NET/Core/AutoGenPoco/TransitionFeatureMembership.cs index c33ce982a..b0fbc4b23 100644 --- a/SysML2.NET/Core/AutoGenPoco/TransitionFeatureMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/TransitionFeatureMembership.cs @@ -140,7 +140,7 @@ public TransitionFeatureMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -160,7 +160,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -183,7 +183,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -378,7 +378,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -391,7 +391,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/TransitionUsage.cs b/SysML2.NET/Core/AutoGenPoco/TransitionUsage.cs index 8f204c571..aa9ed4057 100644 --- a/SysML2.NET/Core/AutoGenPoco/TransitionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/TransitionUsage.cs @@ -470,7 +470,7 @@ public TransitionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/Unioning.cs b/SysML2.NET/Core/AutoGenPoco/Unioning.cs index d116a6f1f..f49c29982 100644 --- a/SysML2.NET/Core/AutoGenPoco/Unioning.cs +++ b/SysML2.NET/Core/AutoGenPoco/Unioning.cs @@ -254,7 +254,7 @@ public Unioning() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IUnioning.TypeUnioned")] + [RedefinedByProperty("IUnioning.TypeUnioned", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { diff --git a/SysML2.NET/Core/AutoGenPoco/Usage.cs b/SysML2.NET/Core/AutoGenPoco/Usage.cs index c15dc0a71..8ff11255f 100644 --- a/SysML2.NET/Core/AutoGenPoco/Usage.cs +++ b/SysML2.NET/Core/AutoGenPoco/Usage.cs @@ -408,7 +408,7 @@ public Usage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/UseCaseUsage.cs b/SysML2.NET/Core/AutoGenPoco/UseCaseUsage.cs index 1ed3b4010..1de423546 100644 --- a/SysML2.NET/Core/AutoGenPoco/UseCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/UseCaseUsage.cs @@ -501,7 +501,7 @@ public UseCaseUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/VariantMembership.cs b/SysML2.NET/Core/AutoGenPoco/VariantMembership.cs index 1f6d02d39..508967aa6 100644 --- a/SysML2.NET/Core/AutoGenPoco/VariantMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/VariantMembership.cs @@ -129,7 +129,7 @@ public VariantMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -149,7 +149,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -171,7 +171,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -356,7 +356,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -369,7 +369,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/VerificationCaseUsage.cs b/SysML2.NET/Core/AutoGenPoco/VerificationCaseUsage.cs index 88c802be3..1d855a3e9 100644 --- a/SysML2.NET/Core/AutoGenPoco/VerificationCaseUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/VerificationCaseUsage.cs @@ -492,7 +492,7 @@ public VerificationCaseUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ViewRenderingMembership.cs b/SysML2.NET/Core/AutoGenPoco/ViewRenderingMembership.cs index 700457c61..630e4a1a3 100644 --- a/SysML2.NET/Core/AutoGenPoco/ViewRenderingMembership.cs +++ b/SysML2.NET/Core/AutoGenPoco/ViewRenderingMembership.cs @@ -130,7 +130,7 @@ public ViewRenderingMembership() /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_819490_43195", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [RedefinedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_138197_43179")] - [RedefinedByProperty("IOwningMembership.OwnedMemberElement")] + [RedefinedByProperty("IOwningMembership.OwnedMemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberElement")] IElement Root.Namespaces.IMembership.MemberElement { @@ -150,7 +150,7 @@ IElement Root.Namespaces.IMembership.MemberElement /// The name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_18_5_3_12e503d9_1533160674964_35293_43192", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberName")] string Root.Namespaces.IMembership.MemberName { @@ -173,7 +173,7 @@ string Root.Namespaces.IMembership.MemberName /// The short name of the memberElement relative to the membershipOwningNamespace. /// [Property(xmiId: "_19_0_4_12e503d9_1651721174176_601088_238", aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] - [RedefinedByProperty("IOwningMembership.OwnedMemberShortName")] + [RedefinedByProperty("IOwningMembership.OwnedMemberShortName", IsDerivedByRedefinition = true)] [Implements(implementation: "IMembership.MemberShortName")] string Root.Namespaces.IMembership.MemberShortName { @@ -386,7 +386,7 @@ string Root.Namespaces.IMembership.MemberShortName /// [Property(xmiId: "_18_5_3_12e503d9_1533160674971_696758_43228", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MembershipOwningNamespace")] + [RedefinedByProperty("IMembership.MembershipOwningNamespace", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Source")] List Root.Elements.IRelationship.Source { @@ -399,7 +399,7 @@ List Root.Elements.IRelationship.Source /// [Property(xmiId: "_18_5_3_12e503d9_1533160674961_138197_43179", aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: true, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null, isOwnerEnd: false)] [SubsettedProperty(propertyName: "_18_5_3_12e503d9_1533160674961_132339_43177")] - [RedefinedByProperty("IMembership.MemberElement")] + [RedefinedByProperty("IMembership.MemberElement", IsDerivedByRedefinition = true)] [Implements(implementation: "IRelationship.Target")] List Root.Elements.IRelationship.Target { diff --git a/SysML2.NET/Core/AutoGenPoco/ViewUsage.cs b/SysML2.NET/Core/AutoGenPoco/ViewUsage.cs index 39573cc36..dbbac9586 100644 --- a/SysML2.NET/Core/AutoGenPoco/ViewUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ViewUsage.cs @@ -434,7 +434,7 @@ public ViewUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/ViewpointUsage.cs b/SysML2.NET/Core/AutoGenPoco/ViewpointUsage.cs index e81236a08..b6522dc05 100644 --- a/SysML2.NET/Core/AutoGenPoco/ViewpointUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/ViewpointUsage.cs @@ -498,7 +498,7 @@ string Root.Elements.IElement.DeclaredShortName /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Core/AutoGenPoco/WhileLoopActionUsage.cs b/SysML2.NET/Core/AutoGenPoco/WhileLoopActionUsage.cs index 2e5dc6013..d12efa521 100644 --- a/SysML2.NET/Core/AutoGenPoco/WhileLoopActionUsage.cs +++ b/SysML2.NET/Core/AutoGenPoco/WhileLoopActionUsage.cs @@ -456,7 +456,7 @@ public WhileLoopActionUsage() /// different value for each snapshot of an owningType that is an Occurrence. /// [Property(xmiId: "_2022x_2_12e503d9_1725998273002_23711_212", aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: "false", isOwnerEnd: false)] - [RedefinedByProperty("IUsage.MayTimeVary")] + [RedefinedByProperty("IUsage.MayTimeVary", IsDerivedByRedefinition = true)] [Implements(implementation: "IFeature.IsVariable")] bool Core.Features.IFeature.IsVariable { diff --git a/SysML2.NET/Decorators/RedefinedByPropertyAttribute.cs b/SysML2.NET/Decorators/RedefinedByPropertyAttribute.cs index 15f177d64..cbe39e2fb 100644 --- a/SysML2.NET/Decorators/RedefinedByPropertyAttribute.cs +++ b/SysML2.NET/Decorators/RedefinedByPropertyAttribute.cs @@ -36,5 +36,13 @@ public RedefinedByPropertyAttribute(string propertyName) /// Gets or sets the name of the property that is redefining this property /// public string PropertyName { get; set; } + + /// + /// Gets or sets a value indicating whether the decorated property is derived in its class because its redefinition chain ends on a derived property + /// + /// + /// The decorated property may be declared non-derived; a derived redefinition makes it derived, as SysML states for Usage::mayTimeVary. + /// + public bool IsDerivedByRedefinition { get; set; } } }