diff --git a/src/AasCore.Aas3_0/copying.cs b/src/AasCore.Aas3_0/copying.cs
index 9cfb5dca6..5b06e3a47 100644
--- a/src/AasCore.Aas3_0/copying.cs
+++ b/src/AasCore.Aas3_0/copying.cs
@@ -3,8 +3,8 @@
* Do NOT edit or append.
*/
-using System.Collections.Generic; // can't alias
using Aas = AasCore.Aas3_0; // renamed
+using System.Collections.Generic; // can't alias
namespace AasCore.Aas3_0
{
@@ -1268,8 +1268,7 @@ Aas.IProperty that
that.EmbeddedDataSpecifications.Count);
foreach (var item in that.EmbeddedDataSpecifications)
{
- if (item.DataSpecification != null && item.DataSpecificationContent != null)
- theEmbeddedDataSpecifications.Add(Deep(item));
+ theEmbeddedDataSpecifications.Add(Deep(item));
}
}
@@ -2457,17 +2456,10 @@ public override Aas.IClass TransformEmbeddedDataSpecification(
Aas.IEmbeddedDataSpecification that
)
{
- IReference? theDataSpecification = null;
- if (that.DataSpecification != null)
- {
- theDataSpecification = Deep(that.DataSpecification);
- }
- IDataSpecificationContent? theDataSpecificationContent = null;
- if (that.DataSpecificationContent != null)
- {
- theDataSpecificationContent = Deep(that.DataSpecificationContent);
- }
- return new Aas.EmbeddedDataSpecification(theDataSpecification, theDataSpecificationContent);
+ return new Aas.EmbeddedDataSpecification(
+ Deep(that.DataSpecification),
+ Deep(that.DataSpecificationContent)
+ );
}
public override Aas.IClass TransformLevelType(
diff --git a/src/AasCore.Aas3_0/types.cs b/src/AasCore.Aas3_0/types.cs
index 3bf4f228b..82b824fff 100644
--- a/src/AasCore.Aas3_0/types.cs
+++ b/src/AasCore.Aas3_0/types.cs
@@ -2,12 +2,14 @@
* This code has been automatically generated by aas-core-codegen.
* Do NOT edit or append.
*/
-using Newtonsoft.Json;
-using System;
-using System.Collections.Generic; // can't alias
+
using Aas = AasCore.Aas3_0; // renamed
using EnumMemberAttribute = System.Runtime.Serialization.EnumMemberAttribute;
+using System.Collections.Generic; // can't alias
+
+using Newtonsoft.Json; // can't alias
+
namespace AasCore.Aas3_0
{
///
@@ -383,11 +385,38 @@ public interface IHasExtensions : IClass
/// An element that is referable by its .
///
///
+ ///
/// This ID is not globally unique.
/// This ID is unique within the name space of the element.
+ ///
+ ///
+ /// Constraints:
+ ///
+ ///
+ /// -
+ /// Constraint AASd-022:
+ /// of non-identifiable referables
+ /// within the same name space shall be unique (case-sensitive).
+ ///
+ ///
///
public interface IReferable : IHasExtensions
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// The category is a value that gives further meta information
/// w.r.t. to the class of the element.
@@ -439,21 +468,6 @@ public interface IReferable : IHasExtensions
///
public List? Description { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over DisplayName, if set, and otherwise return an empty enumerable.
///
@@ -779,18 +793,20 @@ public AdministrativeInformation(
///
///
///
- /// This constraint is checked at .
- ///
- ///
/// Constraints:
///
///
/// -
+ ///
/// Constraint AASd-119:
/// If any value of is
/// equal to and the qualified element
/// inherits from then the qualified element shall be of
/// kind Template ( = ).
+ ///
+ ///
+ /// This constraint is checked at .
+ ///
///
///
///
@@ -993,21 +1009,6 @@ public class Qualifier : IQualifier
///
public IReference? ValueId { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over SupplementalSemanticIds, if set, and otherwise return an empty enumerable.
///
@@ -1196,6 +1197,21 @@ public interface IAssetAdministrationShell :
///
public class AssetAdministrationShell : IAssetAdministrationShell
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -1297,21 +1313,6 @@ public class AssetAdministrationShell : IAssetAdministrationShell
///
public List? Submodels { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -1605,31 +1606,33 @@ public AssetAdministrationShell(
/// optional.
///
///
- /// Constraint AASd-116 is important to enable a generic search across global
- /// and specific asset IDs.
- ///
- ///
- ///
- /// In the book, Constraint AASd-116 imposes a
- /// case-insensitive equality against globalAssetId. This is
- /// culturally-dependent, and depends on the system settings.
- /// For example, the case-folding for the letters "i" and "I" is
- /// different in Turkish from English.
- ///
- ///
- /// We implement the constraint as case-sensitive instead to allow
- /// for interoperability across different culture settings.
- ///
- ///
- ///
/// Constraints:
///
///
/// -
+ ///
/// Constraint AASd-116:
/// globalAssetId is a reserved key. If used as value for
/// then shall be
/// identical to .
+ ///
+ ///
+ /// Constraint AASd-116 is important to enable a generic search across
+ /// global and specific asset IDs.
+ ///
+ ///
+ ///
+ /// In the book, Constraint AASd-116 imposes a
+ /// case-insensitive equality against globalAssetId. This is
+ /// culturally-dependent, and depends on the system settings.
+ /// For example, the case-folding for the letters "i" and "I" is
+ /// different in Turkish from English.
+ ///
+ ///
+ /// We implement the constraint as case-sensitive instead to allow
+ /// for interoperability across different culture settings.
+ ///
+ ///
///
/// -
/// Constraint AASd-131:
@@ -1710,31 +1713,33 @@ public interface IAssetInformation : IClass
/// optional.
///
///
- /// Constraint AASd-116 is important to enable a generic search across global
- /// and specific asset IDs.
- ///
- ///
- ///
- /// In the book, Constraint AASd-116 imposes a
- /// case-insensitive equality against globalAssetId. This is
- /// culturally-dependent, and depends on the system settings.
- /// For example, the case-folding for the letters "i" and "I" is
- /// different in Turkish from English.
- ///
- ///
- /// We implement the constraint as case-sensitive instead to allow
- /// for interoperability across different culture settings.
- ///
- ///
- ///
/// Constraints:
///
///
/// -
+ ///
/// Constraint AASd-116:
/// globalAssetId is a reserved key. If used as value for
/// then shall be
/// identical to .
+ ///
+ ///
+ /// Constraint AASd-116 is important to enable a generic search across
+ /// global and specific asset IDs.
+ ///
+ ///
+ ///
+ /// In the book, Constraint AASd-116 imposes a
+ /// case-insensitive equality against globalAssetId. This is
+ /// culturally-dependent, and depends on the system settings.
+ /// For example, the case-folding for the letters "i" and "I" is
+ /// different in Turkish from English.
+ ///
+ ///
+ /// We implement the constraint as case-sensitive instead to allow
+ /// for interoperability across different culture settings.
+ ///
+ ///
///
/// -
/// Constraint AASd-131:
@@ -2311,6 +2316,21 @@ public interface ISubmodel :
///
public class Submodel : ISubmodel
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -2434,21 +2454,6 @@ public class Submodel : ISubmodel
///
public List? SubmodelElements { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -2845,6 +2850,21 @@ public interface IRelationshipElement : ISubmodelElement
///
public class RelationshipElement : IRelationshipElement
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -2951,21 +2971,6 @@ public class RelationshipElement : IRelationshipElement
///
public IReference Second { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -3354,6 +3359,11 @@ public enum AasSubmodelElements
/// identical to .
///
/// -
+ /// Constraint AASd-120:
+ /// The of a being a direct child of a
+ /// shall not be specified.
+ ///
+ /// -
/// Constraint AASd-108:
/// All first level child elements in a shall have
/// the same submodel element type as specified in .
@@ -3443,6 +3453,11 @@ public interface ISubmodelElementList : ISubmodelElement
/// identical to .
///
/// -
+ /// Constraint AASd-120:
+ /// The of a being a direct child of a
+ /// shall not be specified.
+ ///
+ /// -
/// Constraint AASd-108:
/// All first level child elements in a shall have
/// the same submodel element type as specified in .
@@ -3460,6 +3475,21 @@ public interface ISubmodelElementList : ISubmodelElement
///
public class SubmodelElementList : ISubmodelElementList
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -3591,21 +3621,6 @@ public class SubmodelElementList : ISubmodelElementList
///
public List? Value { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -3973,6 +3988,21 @@ public interface ISubmodelElementCollection : ISubmodelElement
///
public class SubmodelElementCollection : ISubmodelElementCollection
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -4074,21 +4104,6 @@ public class SubmodelElementCollection : ISubmodelElementCollection
///
public List? Value { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -4485,6 +4500,21 @@ public interface IProperty : IDataElement
///
public class Property : IProperty
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -4599,21 +4629,6 @@ public class Property : IProperty
///
public IReference? ValueId { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -4990,6 +5005,21 @@ public interface IMultiLanguageProperty : IDataElement
///
public class MultiLanguageProperty : IMultiLanguageProperty
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -5098,20 +5128,6 @@ public class MultiLanguageProperty : IMultiLanguageProperty
/// It is recommended to use a global reference.
///
public IReference? ValueId { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -5495,6 +5511,21 @@ public interface IRange : IDataElement
///
public class Range : IRange
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -5612,21 +5643,6 @@ public class Range : IRange
///
public string? Max { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -5954,6 +5970,21 @@ public interface IReferenceElement : IDataElement
///
public class ReferenceElement : IReferenceElement
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -6057,21 +6088,6 @@ public class ReferenceElement : IReferenceElement
///
public IReference? Value { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
-
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
///
@@ -6428,6 +6444,21 @@ public interface IBlob : IDataElement
///
public class Blob : IBlob
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -6546,23 +6577,9 @@ public class Blob : IBlob
///
///
/// The allowed values are defined as in RFC2046.
- ///
- ///
- public string ContentType { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
+ ///
+ ///
+ public string ContentType { get; set; }
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -6900,6 +6917,21 @@ public interface IFile : IDataElement
///
public class File : IFile
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -7011,20 +7043,6 @@ public class File : IFile
/// The content type states which file extensions the file can have.
///
public string ContentType { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -7353,6 +7371,21 @@ public interface IAnnotatedRelationshipElement : IRelationshipElement
///
public class AnnotatedRelationshipElement : IAnnotatedRelationshipElement
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -7464,20 +7497,6 @@ public class AnnotatedRelationshipElement : IAnnotatedRelationshipElement
/// between the two elements
///
public List? Annotations { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -7886,6 +7905,21 @@ public interface IEntity : ISubmodelElement
///
public class Entity : IEntity
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -8006,20 +8040,6 @@ public class Entity : IEntity
/// of the asset represented by the Asset Administration Shell.
///
public List? SpecificAssetIds { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -8825,6 +8845,21 @@ public interface IBasicEventElement : IEventElement
///
public class BasicEventElement : IBasicEventElement
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -9002,20 +9037,6 @@ public class BasicEventElement : IBasicEventElement
///
///
public string? MaxInterval { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -9406,6 +9427,21 @@ public interface IOperation : ISubmodelElement
///
public class Operation : IOperation
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -9516,20 +9552,6 @@ public class Operation : IOperation
/// Parameter that is input and output of the operation.
///
public List? InoutputVariables { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -10023,6 +10045,21 @@ public interface ICapability : ISubmodelElement
///
public class Capability : ICapability
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -10118,20 +10155,6 @@ public class Capability : ICapability
/// Embedded data specification.
///
public List? EmbeddedDataSpecifications { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -10421,27 +10444,66 @@ public Capability(
/// data specification template).
///
///
- /// Note: categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Note: categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
/// Constraints:
///
///
/// -
///
+ /// Constraint AASc-3a-004:
+ /// For a with PROPERTY or
+ /// VALUE using data specification IEC61360,
+ /// the is mandatory and shall be
+ /// one of: DATE, STRING, STRING_TRANSLATABLE, INTEGER_MEASURE,
+ /// INTEGER_COUNT, INTEGER_CURRENCY, REAL_MEASURE, REAL_COUNT,
+ /// REAL_CURRENCY, BOOLEAN, RATIONAL, RATIONAL_MEASURE,
+ /// TIME, TIMESTAMP.
+ ///
+ ///
+ /// Note: categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-005:
+ /// For a with REFERENCE
+ /// using data specification template IEC61360,
+ /// the shall be
+ /// one of: STRING, IRI, IRDI.
+ ///
+ ///
+ /// Note: categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-006:
+ /// For a with DOCUMENT
+ /// using data specification IEC61360,
+ /// the shall be one of FILE,
+ /// BLOB, HTML
+ ///
+ ///
+ /// Categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-007:
+ /// For a with QUALIFIER_TYPE
+ /// using data specification IEC61360,
+ /// the is mandatory and shall be
+ /// defined.
+ ///
+ ///
+ /// Categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
/// Constraint AASc-3a-008:
/// For a using data specification template IEC61360,
/// is mandatory and shall be
@@ -10495,27 +10557,66 @@ public interface IConceptDescription :
/// data specification template).
///
///
- /// Note: categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Note: categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
- /// Categories are deprecated since V3.0 of Part 1a of the document series
- /// "Details of the Asset Administration Shell".
- ///
- ///
/// Constraints:
///
///
/// -
///
+ /// Constraint AASc-3a-004:
+ /// For a with PROPERTY or
+ /// VALUE using data specification IEC61360,
+ /// the is mandatory and shall be
+ /// one of: DATE, STRING, STRING_TRANSLATABLE, INTEGER_MEASURE,
+ /// INTEGER_COUNT, INTEGER_CURRENCY, REAL_MEASURE, REAL_COUNT,
+ /// REAL_CURRENCY, BOOLEAN, RATIONAL, RATIONAL_MEASURE,
+ /// TIME, TIMESTAMP.
+ ///
+ ///
+ /// Note: categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-005:
+ /// For a with REFERENCE
+ /// using data specification template IEC61360,
+ /// the shall be
+ /// one of: STRING, IRI, IRDI.
+ ///
+ ///
+ /// Note: categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-006:
+ /// For a with DOCUMENT
+ /// using data specification IEC61360,
+ /// the shall be one of FILE,
+ /// BLOB, HTML
+ ///
+ ///
+ /// Categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
+ /// Constraint AASc-3a-007:
+ /// For a with QUALIFIER_TYPE
+ /// using data specification IEC61360,
+ /// the is mandatory and shall be
+ /// defined.
+ ///
+ ///
+ /// Categories are deprecated since V3.0 of Part 1a of the document series
+ /// "Details of the Asset Administration Shell".
+ ///
+ ///
+ /// -
+ ///
/// Constraint AASc-3a-008:
/// For a using data specification template IEC61360,
/// is mandatory and shall be
@@ -10537,6 +10638,21 @@ public interface IConceptDescription :
///
public class ConceptDescription : IConceptDescription
{
+ #region Parent
+ [JsonIgnore]
+ public IClass? Parent { get; set; }
+ #endregion
+
+ #region TimeStamp
+ [JsonIgnore]
+ public System.DateTime TimeStampCreate { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStamp { get; set; }
+ [JsonIgnore]
+ public System.DateTime TimeStampTree { get; set; }
+ #endregion
+
+
///
/// An extension of the element.
///
@@ -10625,20 +10741,6 @@ public class ConceptDescription : IConceptDescription
///
///
public List? IsCaseOf { get; set; }
- #region Parent
- [JsonIgnore]
- public IClass? Parent { get; set; }
- #endregion
-
- #region TimeStamp
- [JsonIgnore]
- public DateTime TimeStampCreate { get; set; }
- [JsonIgnore]
- public DateTime TimeStamp { get; set; }
- [JsonIgnore]
- public DateTime TimeStampTree { get; set; }
-
- #endregion
///
/// Iterate over Extensions, if set, and otherwise return an empty enumerable.
@@ -11262,6 +11364,10 @@ public interface IKey : IClass
///
///
///
+ /// In case = ,
+ /// the key represents a reference to a source that can be globally identified.
+ ///
+ ///
/// In case = the key represents
/// a bookmark or a similar local identifier within its parent element as specified
/// by the key that precedes this key.
@@ -11289,6 +11395,10 @@ public class Key : IKey
///
///
///
+ /// In case = ,
+ /// the key represents a reference to a source that can be globally identified.
+ ///
+ ///
/// In case = the key represents
/// a bookmark or a similar local identifier within its parent element as specified
/// by the key that precedes this key.
@@ -13033,18 +13143,6 @@ public LangStringDefinitionTypeIec61360(
///
///
///
- /// It is also possible that both and are empty.
- /// This is the case for concept descriptions that define the semantics of a
- /// property but do not have an enumeration () as data type.
- ///
- ///
- /// Although it is possible to define a for a
- /// :attr:´value_list`,
- /// it is not possible to reuse this .
- /// It is only possible to directly add a as data type
- /// to a specific semantic definition of a property.
- ///
- ///
/// IEC61360 requires also a globally unique identifier for a concept
/// description. This ID is not part of the data specification template.
/// Instead the as inherited via
@@ -13064,6 +13162,26 @@ public LangStringDefinitionTypeIec61360(
///
///
/// -
+ ///
+ /// Constraint AASc-3a-010:
+ /// If is not empty then shall be empty
+ /// and vice versa.
+ ///
+ ///
+ /// It is also possible that both and are
+ /// empty. This is the case for concept descriptions that define the semantics
+ /// of a property but do not have an enumeration () as
+ /// data type.
+ ///
+ ///
+ /// Although it is possible to define a for a
+ /// :attr:´value_list`,
+ /// it is not possible to reuse this .
+ /// It is only possible to directly add a as data type
+ /// to a specific semantic definition of a property.
+ ///
+ ///
+ /// -
/// Constraint AASc-3a-009:
/// If one of:
/// ,
@@ -13180,18 +13298,6 @@ public interface IDataSpecificationIec61360 : IDataSpecificationContent
///
///
///
- /// It is also possible that both and are empty.
- /// This is the case for concept descriptions that define the semantics of a
- /// property but do not have an enumeration () as data type.
- ///
- ///
- /// Although it is possible to define a for a
- /// :attr:´value_list`,
- /// it is not possible to reuse this .
- /// It is only possible to directly add a as data type
- /// to a specific semantic definition of a property.
- ///
- ///
/// IEC61360 requires also a globally unique identifier for a concept
/// description. This ID is not part of the data specification template.
/// Instead the as inherited via
@@ -13211,6 +13317,26 @@ public interface IDataSpecificationIec61360 : IDataSpecificationContent
///
///
/// -
+ ///
+ /// Constraint AASc-3a-010:
+ /// If is not empty then shall be empty
+ /// and vice versa.
+ ///
+ ///
+ /// It is also possible that both and are
+ /// empty. This is the case for concept descriptions that define the semantics
+ /// of a property but do not have an enumeration () as
+ /// data type.
+ ///
+ ///
+ /// Although it is possible to define a for a
+ /// :attr:´value_list`,
+ /// it is not possible to reuse this .
+ /// It is only possible to directly add a as data type
+ /// to a specific semantic definition of a property.
+ ///
+ ///
+ /// -
/// Constraint AASc-3a-009:
/// If one of:
/// ,
diff --git a/src/AasCore.Aas3_0/verification.cs b/src/AasCore.Aas3_0/verification.cs
index ce4c1167f..aca087e5b 100644
--- a/src/AasCore.Aas3_0/verification.cs
+++ b/src/AasCore.Aas3_0/verification.cs
@@ -3016,7 +3016,7 @@ Aas.IAssetAdministrationShell that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -3035,16 +3035,7 @@ Aas.IAssetAdministrationShell that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
- }
-
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -3257,7 +3248,8 @@ Aas.IAssetInformation that
that.SpecificAssetIds.All(
specificAssetId => specificAssetId.Name != "globalAssetId"
|| (
- specificAssetId.Name == "globalAssetId"
+ (that.GlobalAssetId != null)
+ && specificAssetId.Name == "globalAssetId"
&& specificAssetId.Value == that.GlobalAssetId
))
)))
@@ -3273,12 +3265,11 @@ Aas.IAssetInformation that
if (!(
(
(that.GlobalAssetId != null)
- && (that.SpecificAssetIds == null)
+ || (that.SpecificAssetIds != null)
)
- || (
- (that.GlobalAssetId == null)
- && (that.SpecificAssetIds != null)
- && that.SpecificAssetIds.Count >= 1
+ && (
+ !(that.SpecificAssetIds != null)
+ || (that.SpecificAssetIds.Count >= 1)
)))
{
yield return new Reporting.Error(
@@ -3516,7 +3507,7 @@ Aas.ISubmodel that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -3535,16 +3526,7 @@ Aas.ISubmodel that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
- }
-
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -3635,7 +3617,7 @@ Aas.ISubmodel that
if (!(
!(that.SubmodelElements != null)
|| (
- !(that.Kind != ModellingKind.Template)
+ !(that.KindOrDefault() != ModellingKind.Template)
|| (
that.SubmodelElements.All(
submodelElement => !(submodelElement.Qualifiers != null)
@@ -3914,7 +3896,7 @@ Aas.IRelationshipElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -3933,7 +3915,7 @@ Aas.IRelationshipElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -3985,15 +3967,6 @@ Aas.IRelationshipElement that
"at least one item.");
}
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
- }
-
if (that.Extensions != null)
{
int indexExtensions = 0;
@@ -4198,7 +4171,7 @@ Aas.ISubmodelElementList that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -4217,7 +4190,7 @@ Aas.ISubmodelElementList that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -4597,7 +4570,7 @@ Aas.ISubmodelElementCollection that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -4616,7 +4589,7 @@ Aas.ISubmodelElementCollection that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -4908,7 +4881,7 @@ Aas.IProperty that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -4927,7 +4900,7 @@ Aas.IProperty that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -5217,7 +5190,7 @@ Aas.IMultiLanguageProperty that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -5236,7 +5209,7 @@ Aas.IMultiLanguageProperty that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -5305,7 +5278,7 @@ Aas.IMultiLanguageProperty that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Value specifies no duplicate languages.");
+ "Value must specify unique languages.");
}
if (!(
@@ -5535,7 +5508,7 @@ Aas.IRange that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -5554,7 +5527,7 @@ Aas.IRange that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -5853,7 +5826,7 @@ Aas.IReferenceElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -5872,7 +5845,7 @@ Aas.IReferenceElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -6134,7 +6107,7 @@ Aas.IBlob that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -6153,7 +6126,7 @@ Aas.IBlob that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -6423,7 +6396,7 @@ Aas.IFile that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -6442,7 +6415,7 @@ Aas.IFile that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -6712,7 +6685,7 @@ Aas.IAnnotatedRelationshipElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -6731,7 +6704,7 @@ Aas.IAnnotatedRelationshipElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -6783,15 +6756,6 @@ Aas.IAnnotatedRelationshipElement that
"at least one item.");
}
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
- }
-
if (!(
!(that.Annotations != null)
|| (that.Annotations.Count >= 1)))
@@ -7040,7 +7004,7 @@ Aas.IEntity that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -7059,7 +7023,7 @@ Aas.IEntity that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -7151,7 +7115,8 @@ Aas.IEntity that
)
)
|| (
- (that.GlobalAssetId == null)
+ that.EntityType != EntityType.SelfManagedEntity
+ && (that.GlobalAssetId == null)
&& (that.SpecificAssetIds == null)
)))
{
@@ -7520,7 +7485,7 @@ Aas.IBasicEventElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -7539,7 +7504,7 @@ Aas.IBasicEventElement that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -7591,15 +7556,6 @@ Aas.IBasicEventElement that
"at least one item.");
}
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
- }
-
if (!(
!(that.Direction == Direction.Input)
|| (that.MaxInterval == null)))
@@ -7893,7 +7849,7 @@ Aas.IOperation that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -7912,7 +7868,7 @@ Aas.IOperation that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -8275,7 +8231,7 @@ Aas.ICapability that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -8294,7 +8250,7 @@ Aas.ICapability that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -8534,7 +8490,7 @@ Aas.IConceptDescription that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Description specifies no duplicate languages.");
+ "Description must specify unique languages.");
}
if (!(
@@ -8553,16 +8509,7 @@ Aas.IConceptDescription that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Display name specifies no duplicate languages.");
- }
-
- if (!(that.IdShort != null))
- {
- yield return new Reporting.Error(
- "Invariant violated:\n" +
- "Constraint AASd-117: ID-short of Referables not being " +
- "a direct child of a Submodel element list shall be " +
- "specified.");
+ "Display name must specify unique languages.");
}
if (!(
@@ -9259,7 +9206,7 @@ Aas.ILangStringPreferredNameTypeIec61360 that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "String shall have a maximum length of 1023 characters.");
+ "String shall have a maximum length of 255 characters.");
}
foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language))
@@ -9290,7 +9237,7 @@ Aas.ILangStringShortNameTypeIec61360 that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "String shall have a maximum length of 1023 characters.");
+ "String shall have a maximum length of 18 characters.");
}
foreach (var error in Verification.VerifyBcp47LanguageTag(that.Language))
@@ -9349,15 +9296,8 @@ Aas.IDataSpecificationIec61360 that
)
{
if (!(
- (
- (that.Value != null)
- && (that.ValueList == null)
- )
- || (
- (that.Value == null)
- && (that.ValueList != null)
- && that.ValueList.ValueReferencePairs.Count >= 1
- )))
+ !((that.Value != null)
+ && (that.ValueList != null))))
{
yield return new Reporting.Error(
"Invariant violated:\n" +
@@ -9367,7 +9307,7 @@ Aas.IDataSpecificationIec61360 that
if (!(
!(
- (that.DataType == null)
+ (that.DataType != null)
&& Aas.Constants.Iec61360DataTypesWithUnit.Contains(that.DataType)
)
|| (
@@ -9397,7 +9337,7 @@ Aas.IDataSpecificationIec61360 that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Definition specifies no duplicate languages.");
+ "Definition must specify unique languages.");
}
if (!(
@@ -9415,7 +9355,7 @@ Aas.IDataSpecificationIec61360 that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Short name specifies no duplicate languages.");
+ "Short name must specify unique languages.");
}
if (!(that.PreferredName.Count >= 1))
@@ -9430,7 +9370,7 @@ Aas.IDataSpecificationIec61360 that
{
yield return new Reporting.Error(
"Invariant violated:\n" +
- "Preferred name specifies no duplicate languages.");
+ "Preferred name must specify unique languages.");
}
if (!(
diff --git a/src/AasCore.Aas3_0/visitation.cs b/src/AasCore.Aas3_0/visitation.cs
index 552c5eb7a..3382540c8 100644
--- a/src/AasCore.Aas3_0/visitation.cs
+++ b/src/AasCore.Aas3_0/visitation.cs
@@ -132,7 +132,6 @@ ILangStringDefinitionTypeIec61360 that
public void VisitDataSpecificationIec61360(
IDataSpecificationIec61360 that
);
- // OZ: void Visit(Extension that);
} // public interface IVisitor
///
@@ -868,7 +867,7 @@ TContext context
public abstract class AbstractVisitorWithContext
: IVisitorWithContext
{
- public void Visit(IClass that, TContext context)
+ public virtual void Visit(IClass that, TContext context)
{
that.Accept(this, context);
}
@@ -1162,7 +1161,7 @@ IDataSpecificationIec61360 that
/// The type of the transformation result
public abstract class AbstractTransformer : ITransformer
{
- public T Transform(IClass that)
+ public virtual T Transform(IClass that)
{
return that.Transform(this);
}
@@ -1502,7 +1501,7 @@ TContext context
public abstract class AbstractTransformerWithContext
: ITransformerWithContext
{
- public T Transform(IClass that, TContext context)
+ public virtual T Transform(IClass that, TContext context)
{
return that.Transform(this, context);
}
diff --git a/src/AasCore.Aas3_0/xmlization.cs b/src/AasCore.Aas3_0/xmlization.cs
index f6f52986b..7ef55ec97 100644
--- a/src/AasCore.Aas3_0/xmlization.cs
+++ b/src/AasCore.Aas3_0/xmlization.cs
@@ -2,11 +2,13 @@
* This code has been automatically generated by aas-core-codegen.
* Do NOT edit or append.
*/
-using System.Collections.Generic; // can't alias
+
using Aas = AasCore.Aas3_0; // renamed
using CodeAnalysis = System.Diagnostics.CodeAnalysis;
using Xml = System.Xml;
+using System.Collections.Generic; // can't alias
+
namespace AasCore.Aas3_0
{
///
@@ -230,8 +232,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Extension, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -516,13 +535,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -1065,8 +1077,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class AdministrativeInformation, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -1300,13 +1329,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -1541,8 +1563,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Qualifier, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -1860,13 +1899,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -2038,8 +2070,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class AssetAdministrationShell, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -2445,13 +2494,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -2621,8 +2663,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class AssetInformation, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -2871,13 +2930,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -3028,8 +3080,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Resource, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -3173,13 +3242,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -3330,8 +3392,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class SpecificAssetId, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -3539,13 +3618,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -3717,8 +3789,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Submodel, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -4237,13 +4326,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -4497,8 +4579,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class RelationshipElement, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -4900,13 +4999,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -5135,8 +5227,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class SubmodelElementList, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -5717,13 +5826,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -5891,8 +5993,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class SubmodelElementCollection, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -6302,13 +6421,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -6526,8 +6638,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Property, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -7010,13 +7139,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -7183,8 +7305,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class MultiLanguageProperty, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -7608,13 +7747,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -7771,8 +7903,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Range, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -8281,13 +8430,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -8453,8 +8595,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class ReferenceElement, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -8842,13 +9001,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -9003,8 +9155,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Blob, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -9466,13 +9635,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -9638,8 +9800,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class File, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -10093,13 +10272,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -10266,8 +10438,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class AnnotatedRelationshipElement, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -10705,13 +10894,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -10890,8 +11072,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Entity, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -11432,13 +11631,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -11603,8 +11795,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class EventPayload, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -11866,13 +12075,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -12108,8 +12310,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class BasicEventElement, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -12781,13 +13000,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -12980,8 +13192,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Operation, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -13463,13 +13692,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -13616,8 +13838,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class OperationVariable, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -13734,13 +13973,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -13894,8 +14126,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Capability, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -14269,13 +14518,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -14427,8 +14669,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class ConceptDescription, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -14806,13 +15065,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -14968,8 +15220,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Reference, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -15138,13 +15407,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -15303,8 +15565,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Key, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -15463,13 +15742,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -15686,8 +15958,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LangStringNameType, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -15831,13 +16120,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -15995,8 +16277,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LangStringTextType, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -16140,13 +16439,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -16305,8 +16597,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class Environment, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -16478,13 +16787,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -16670,8 +16972,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class EmbeddedDataSpecification, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -16802,42 +17121,33 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
- //if (theDataSpecification == null)
- //{
- // error = new Reporting.Error(
- // "The required property DataSpecification has not been given " +
- // "in the XML representation of an instance of class EmbeddedDataSpecification");
- // return null;
- //}
-
- //if (theDataSpecificationContent == null)
- //{
- // error = new Reporting.Error(
- // "The required property DataSpecificationContent has not been given " +
- // "in the XML representation of an instance of class EmbeddedDataSpecification");
- // return null;
- //}
-
- //return new Aas.EmbeddedDataSpecification(
- // theDataSpecification
- // ?? throw new System.InvalidOperationException(
- // "Unexpected null, had to be handled before"),
- // theDataSpecificationContent
- // ?? throw new System.InvalidOperationException(
- // "Unexpected null, had to be handled before"));
-
- return new EmbeddedDataSpecification(theDataSpecification, theDataSpecificationContent);
+ if (theDataSpecification == null)
+ {
+ error = new Reporting.Error(
+ "The required property DataSpecification has not been given " +
+ "in the XML representation of an instance of class EmbeddedDataSpecification");
+ return null;
+ }
+
+ if (theDataSpecificationContent == null)
+ {
+ error = new Reporting.Error(
+ "The required property DataSpecificationContent has not been given " +
+ "in the XML representation of an instance of class EmbeddedDataSpecification");
+ return null;
+ }
+
+ return new Aas.EmbeddedDataSpecification(
+ theDataSpecification
+ ?? throw new System.InvalidOperationException(
+ "Unexpected null, had to be handled before"),
+ theDataSpecificationContent
+ ?? throw new System.InvalidOperationException(
+ "Unexpected null, had to be handled before"));
} // internal static Aas.EmbeddedDataSpecification? EmbeddedDataSpecificationFromSequence
///
@@ -16970,8 +17280,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LevelType, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -17223,13 +17550,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -17409,8 +17729,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class ValueReferencePair, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -17528,16 +17865,9 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
}
-
- if (reader.EOF)
- {
- break;
- }
- }
- }
+ }
+ }
if (theValue == null)
{
@@ -17691,8 +18021,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class ValueList, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -17792,13 +18139,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -17945,8 +18285,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LangStringPreferredNameTypeIec61360, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -18090,13 +18447,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -18254,8 +18604,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LangStringShortNameTypeIec61360, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -18399,13 +18766,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -18563,8 +18923,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class LangStringDefinitionTypeIec61360, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -18708,13 +19085,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -18882,8 +19252,25 @@ out Reporting.Error? error
"but reached the end-of-file");
return null;
}
- while (reader.NodeType == Xml.XmlNodeType.Element)
+ while (true)
{
+ SkipNoneWhitespaceAndComments(reader);
+
+ if (reader.NodeType == Xml.XmlNodeType.EndElement || reader.EOF)
+ {
+ break;
+ }
+
+ if (reader.NodeType != Xml.XmlNodeType.Element)
+ {
+ error = new Reporting.Error(
+ "Expected an XML start element representing " +
+ "a property of an instance of class DataSpecificationIec61360, " +
+ $"but got the node of type {reader.NodeType} " +
+ $"with the value {reader.Value}");
+ return null;
+ }
+
string elementName = TryElementName(
reader, out error);
if (error != null)
@@ -19352,13 +19739,6 @@ out Reporting.Error? error
}
// Skip the expected end element
reader.Read();
-
- SkipNoneWhitespaceAndComments(reader);
- }
-
- if (reader.EOF)
- {
- break;
}
}
}
@@ -19496,7 +19876,7 @@ public class Exception : System.Exception
public readonly string Path;
public readonly string Cause;
public Exception(string path, string cause)
- : base($"{cause} at: {path}")
+ : base($"{cause} at: {(path == "" ? "the beginning" : path)}")
{
Path = path;
Cause = cause;
@@ -19538,6 +19918,17 @@ public static class Deserialize
public static Aas.IHasSemantics IHasSemanticsFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IHasSemantics, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IHasSemantics? result = (
DeserializeImplementation.IHasSemanticsFromElement(
reader,
@@ -19564,6 +19955,17 @@ public static Aas.IHasSemantics IHasSemanticsFrom(
public static Aas.Extension ExtensionFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Extension, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Extension? result = (
DeserializeImplementation.ExtensionFromElement(
reader,
@@ -19591,6 +19993,17 @@ public static Aas.Extension ExtensionFrom(
public static Aas.IHasExtensions IHasExtensionsFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IHasExtensions, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IHasExtensions? result = (
DeserializeImplementation.IHasExtensionsFromElement(
reader,
@@ -19618,6 +20031,17 @@ public static Aas.IHasExtensions IHasExtensionsFrom(
public static Aas.IReferable IReferableFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IReferable, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IReferable? result = (
DeserializeImplementation.IReferableFromElement(
reader,
@@ -19645,6 +20069,17 @@ public static Aas.IReferable IReferableFrom(
public static Aas.IIdentifiable IIdentifiableFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IIdentifiable, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IIdentifiable? result = (
DeserializeImplementation.IIdentifiableFromElement(
reader,
@@ -19672,6 +20107,17 @@ public static Aas.IIdentifiable IIdentifiableFrom(
public static Aas.IHasKind IHasKindFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IHasKind, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IHasKind? result = (
DeserializeImplementation.IHasKindFromElement(
reader,
@@ -19699,6 +20145,17 @@ public static Aas.IHasKind IHasKindFrom(
public static Aas.IHasDataSpecification IHasDataSpecificationFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IHasDataSpecification, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IHasDataSpecification? result = (
DeserializeImplementation.IHasDataSpecificationFromElement(
reader,
@@ -19725,6 +20182,17 @@ public static Aas.IHasDataSpecification IHasDataSpecificationFrom(
public static Aas.AdministrativeInformation AdministrativeInformationFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class AdministrativeInformation, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.AdministrativeInformation? result = (
DeserializeImplementation.AdministrativeInformationFromElement(
reader,
@@ -19752,6 +20220,17 @@ public static Aas.AdministrativeInformation AdministrativeInformationFrom(
public static Aas.IQualifiable IQualifiableFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IQualifiable, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IQualifiable? result = (
DeserializeImplementation.IQualifiableFromElement(
reader,
@@ -19778,6 +20257,17 @@ public static Aas.IQualifiable IQualifiableFrom(
public static Aas.Qualifier QualifierFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Qualifier, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Qualifier? result = (
DeserializeImplementation.QualifierFromElement(
reader,
@@ -19804,6 +20294,17 @@ public static Aas.Qualifier QualifierFrom(
public static Aas.AssetAdministrationShell AssetAdministrationShellFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class AssetAdministrationShell, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.AssetAdministrationShell? result = (
DeserializeImplementation.AssetAdministrationShellFromElement(
reader,
@@ -19830,6 +20331,17 @@ public static Aas.AssetAdministrationShell AssetAdministrationShellFrom(
public static Aas.AssetInformation AssetInformationFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class AssetInformation, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.AssetInformation? result = (
DeserializeImplementation.AssetInformationFromElement(
reader,
@@ -19856,6 +20368,17 @@ public static Aas.AssetInformation AssetInformationFrom(
public static Aas.Resource ResourceFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Resource, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Resource? result = (
DeserializeImplementation.ResourceFromElement(
reader,
@@ -19882,6 +20405,17 @@ public static Aas.Resource ResourceFrom(
public static Aas.SpecificAssetId SpecificAssetIdFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class SpecificAssetId, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.SpecificAssetId? result = (
DeserializeImplementation.SpecificAssetIdFromElement(
reader,
@@ -19908,6 +20442,17 @@ public static Aas.SpecificAssetId SpecificAssetIdFrom(
public static Aas.Submodel SubmodelFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Submodel, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Submodel? result = (
DeserializeImplementation.SubmodelFromElement(
reader,
@@ -19935,6 +20480,17 @@ public static Aas.Submodel SubmodelFrom(
public static Aas.ISubmodelElement ISubmodelElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class ISubmodelElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.ISubmodelElement? result = (
DeserializeImplementation.ISubmodelElementFromElement(
reader,
@@ -19962,6 +20518,17 @@ public static Aas.ISubmodelElement ISubmodelElementFrom(
public static Aas.IRelationshipElement IRelationshipElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IRelationshipElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IRelationshipElement? result = (
DeserializeImplementation.IRelationshipElementFromElement(
reader,
@@ -19988,6 +20555,17 @@ public static Aas.IRelationshipElement IRelationshipElementFrom(
public static Aas.RelationshipElement RelationshipElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class RelationshipElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.RelationshipElement? result = (
DeserializeImplementation.RelationshipElementFromElement(
reader,
@@ -20014,6 +20592,17 @@ public static Aas.RelationshipElement RelationshipElementFrom(
public static Aas.SubmodelElementList SubmodelElementListFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class SubmodelElementList, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.SubmodelElementList? result = (
DeserializeImplementation.SubmodelElementListFromElement(
reader,
@@ -20040,6 +20629,17 @@ public static Aas.SubmodelElementList SubmodelElementListFrom(
public static Aas.SubmodelElementCollection SubmodelElementCollectionFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class SubmodelElementCollection, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.SubmodelElementCollection? result = (
DeserializeImplementation.SubmodelElementCollectionFromElement(
reader,
@@ -20067,6 +20667,17 @@ public static Aas.SubmodelElementCollection SubmodelElementCollectionFrom(
public static Aas.IDataElement IDataElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IDataElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IDataElement? result = (
DeserializeImplementation.IDataElementFromElement(
reader,
@@ -20093,6 +20704,17 @@ public static Aas.IDataElement IDataElementFrom(
public static Aas.Property PropertyFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Property, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Property? result = (
DeserializeImplementation.PropertyFromElement(
reader,
@@ -20119,6 +20741,17 @@ public static Aas.Property PropertyFrom(
public static Aas.MultiLanguageProperty MultiLanguagePropertyFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class MultiLanguageProperty, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.MultiLanguageProperty? result = (
DeserializeImplementation.MultiLanguagePropertyFromElement(
reader,
@@ -20145,6 +20778,17 @@ public static Aas.MultiLanguageProperty MultiLanguagePropertyFrom(
public static Aas.Range RangeFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Range, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Range? result = (
DeserializeImplementation.RangeFromElement(
reader,
@@ -20171,6 +20815,17 @@ public static Aas.Range RangeFrom(
public static Aas.ReferenceElement ReferenceElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class ReferenceElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.ReferenceElement? result = (
DeserializeImplementation.ReferenceElementFromElement(
reader,
@@ -20197,6 +20852,17 @@ public static Aas.ReferenceElement ReferenceElementFrom(
public static Aas.Blob BlobFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Blob, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Blob? result = (
DeserializeImplementation.BlobFromElement(
reader,
@@ -20223,6 +20889,17 @@ public static Aas.Blob BlobFrom(
public static Aas.File FileFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class File, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.File? result = (
DeserializeImplementation.FileFromElement(
reader,
@@ -20249,6 +20926,17 @@ public static Aas.File FileFrom(
public static Aas.AnnotatedRelationshipElement AnnotatedRelationshipElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class AnnotatedRelationshipElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.AnnotatedRelationshipElement? result = (
DeserializeImplementation.AnnotatedRelationshipElementFromElement(
reader,
@@ -20275,6 +20963,17 @@ public static Aas.AnnotatedRelationshipElement AnnotatedRelationshipElementFrom(
public static Aas.Entity EntityFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Entity, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Entity? result = (
DeserializeImplementation.EntityFromElement(
reader,
@@ -20301,6 +21000,17 @@ public static Aas.Entity EntityFrom(
public static Aas.EventPayload EventPayloadFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class EventPayload, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.EventPayload? result = (
DeserializeImplementation.EventPayloadFromElement(
reader,
@@ -20328,6 +21038,17 @@ public static Aas.EventPayload EventPayloadFrom(
public static Aas.IEventElement IEventElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IEventElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IEventElement? result = (
DeserializeImplementation.IEventElementFromElement(
reader,
@@ -20354,6 +21075,17 @@ public static Aas.IEventElement IEventElementFrom(
public static Aas.BasicEventElement BasicEventElementFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class BasicEventElement, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.BasicEventElement? result = (
DeserializeImplementation.BasicEventElementFromElement(
reader,
@@ -20380,6 +21112,17 @@ public static Aas.BasicEventElement BasicEventElementFrom(
public static Aas.Operation OperationFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Operation, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Operation? result = (
DeserializeImplementation.OperationFromElement(
reader,
@@ -20406,6 +21149,17 @@ public static Aas.Operation OperationFrom(
public static Aas.OperationVariable OperationVariableFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class OperationVariable, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.OperationVariable? result = (
DeserializeImplementation.OperationVariableFromElement(
reader,
@@ -20432,6 +21186,17 @@ public static Aas.OperationVariable OperationVariableFrom(
public static Aas.Capability CapabilityFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Capability, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Capability? result = (
DeserializeImplementation.CapabilityFromElement(
reader,
@@ -20458,6 +21223,17 @@ public static Aas.Capability CapabilityFrom(
public static Aas.ConceptDescription ConceptDescriptionFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class ConceptDescription, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.ConceptDescription? result = (
DeserializeImplementation.ConceptDescriptionFromElement(
reader,
@@ -20484,6 +21260,17 @@ public static Aas.ConceptDescription ConceptDescriptionFrom(
public static Aas.Reference ReferenceFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Reference, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Reference? result = (
DeserializeImplementation.ReferenceFromElement(
reader,
@@ -20510,6 +21297,17 @@ public static Aas.Reference ReferenceFrom(
public static Aas.Key KeyFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Key, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Key? result = (
DeserializeImplementation.KeyFromElement(
reader,
@@ -20537,6 +21335,17 @@ public static Aas.Key KeyFrom(
public static Aas.IAbstractLangString IAbstractLangStringFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IAbstractLangString, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IAbstractLangString? result = (
DeserializeImplementation.IAbstractLangStringFromElement(
reader,
@@ -20563,6 +21372,17 @@ public static Aas.IAbstractLangString IAbstractLangStringFrom(
public static Aas.LangStringNameType LangStringNameTypeFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LangStringNameType, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LangStringNameType? result = (
DeserializeImplementation.LangStringNameTypeFromElement(
reader,
@@ -20589,6 +21409,17 @@ public static Aas.LangStringNameType LangStringNameTypeFrom(
public static Aas.LangStringTextType LangStringTextTypeFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LangStringTextType, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LangStringTextType? result = (
DeserializeImplementation.LangStringTextTypeFromElement(
reader,
@@ -20615,6 +21446,17 @@ public static Aas.LangStringTextType LangStringTextTypeFrom(
public static Aas.Environment EnvironmentFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class Environment, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.Environment? result = (
DeserializeImplementation.EnvironmentFromElement(
reader,
@@ -20642,6 +21484,17 @@ public static Aas.Environment EnvironmentFrom(
public static Aas.IDataSpecificationContent IDataSpecificationContentFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class IDataSpecificationContent, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.IDataSpecificationContent? result = (
DeserializeImplementation.IDataSpecificationContentFromElement(
reader,
@@ -20668,6 +21521,17 @@ public static Aas.IDataSpecificationContent IDataSpecificationContentFrom(
public static Aas.EmbeddedDataSpecification EmbeddedDataSpecificationFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class EmbeddedDataSpecification, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.EmbeddedDataSpecification? result = (
DeserializeImplementation.EmbeddedDataSpecificationFromElement(
reader,
@@ -20694,6 +21558,17 @@ public static Aas.EmbeddedDataSpecification EmbeddedDataSpecificationFrom(
public static Aas.LevelType LevelTypeFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LevelType, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LevelType? result = (
DeserializeImplementation.LevelTypeFromElement(
reader,
@@ -20720,6 +21595,17 @@ public static Aas.LevelType LevelTypeFrom(
public static Aas.ValueReferencePair ValueReferencePairFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class ValueReferencePair, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.ValueReferencePair? result = (
DeserializeImplementation.ValueReferencePairFromElement(
reader,
@@ -20746,6 +21632,17 @@ public static Aas.ValueReferencePair ValueReferencePairFrom(
public static Aas.ValueList ValueListFrom(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class ValueList, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.ValueList? result = (
DeserializeImplementation.ValueListFromElement(
reader,
@@ -20772,6 +21669,17 @@ public static Aas.ValueList ValueListFrom(
public static Aas.LangStringPreferredNameTypeIec61360 LangStringPreferredNameTypeIec61360From(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LangStringPreferredNameTypeIec61360, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LangStringPreferredNameTypeIec61360? result = (
DeserializeImplementation.LangStringPreferredNameTypeIec61360FromElement(
reader,
@@ -20798,6 +21706,17 @@ public static Aas.LangStringPreferredNameTypeIec61360 LangStringPreferredNameTyp
public static Aas.LangStringShortNameTypeIec61360 LangStringShortNameTypeIec61360From(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LangStringShortNameTypeIec61360, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LangStringShortNameTypeIec61360? result = (
DeserializeImplementation.LangStringShortNameTypeIec61360FromElement(
reader,
@@ -20824,6 +21743,17 @@ public static Aas.LangStringShortNameTypeIec61360 LangStringShortNameTypeIec6136
public static Aas.LangStringDefinitionTypeIec61360 LangStringDefinitionTypeIec61360From(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class LangStringDefinitionTypeIec61360, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.LangStringDefinitionTypeIec61360? result = (
DeserializeImplementation.LangStringDefinitionTypeIec61360FromElement(
reader,
@@ -20850,6 +21780,17 @@ public static Aas.LangStringDefinitionTypeIec61360 LangStringDefinitionTypeIec61
public static Aas.DataSpecificationIec61360 DataSpecificationIec61360From(
Xml.XmlReader reader)
{
+ DeserializeImplementation.SkipNoneWhitespaceAndComments(reader);
+
+ if (!reader.EOF && reader.NodeType == Xml.XmlNodeType.XmlDeclaration)
+ {
+ throw new Xmlization.Exception(
+ "",
+ "Unexpected XML declaration when reading an instance " +
+ "of class DataSpecificationIec61360, as we expect the reader " +
+ "to be set at content with MoveToContent");
+ }
+
Aas.DataSpecificationIec61360? result = (
DeserializeImplementation.DataSpecificationIec61360FromElement(
reader,
@@ -20889,7 +21830,7 @@ private void ExtensionToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -20943,7 +21884,7 @@ private void ExtensionToSequence(
writer.WriteEndElement();
}
- if (that.RefersTo != null && that.RefersTo.Count > 0)
+ if (that.RefersTo != null)
{
writer.WriteStartElement(
"refersTo",
@@ -20977,7 +21918,7 @@ private void AdministrativeInformationToSequence(
Aas.IAdministrativeInformation that,
Xml.XmlWriter writer)
{
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -21073,7 +22014,7 @@ private void QualifierToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -21172,7 +22113,7 @@ private void AssetAdministrationShellToSequence(
Aas.IAssetAdministrationShell that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -21212,7 +22153,7 @@ private void AssetAdministrationShellToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -21228,7 +22169,7 @@ private void AssetAdministrationShellToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -21266,7 +22207,7 @@ private void AssetAdministrationShellToSequence(
writer.WriteEndElement();
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -21305,7 +22246,7 @@ private void AssetAdministrationShellToSequence(
writer.WriteEndElement();
- if (that.Submodels != null && that.Submodels.Count > 0)
+ if (that.Submodels != null)
{
writer.WriteStartElement(
"submodels",
@@ -21365,7 +22306,7 @@ private void AssetInformationToSequence(
writer.WriteEndElement();
}
- if (that.SpecificAssetIds != null && that.SpecificAssetIds.Count > 0)
+ if (that.SpecificAssetIds != null)
{
writer.WriteStartElement(
"specificAssetIds",
@@ -21476,7 +22417,7 @@ private void SpecificAssetIdToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -21541,7 +22482,7 @@ private void SubmodelToSequence(
Aas.ISubmodel that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -21581,7 +22522,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -21597,7 +22538,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -21665,7 +22606,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -21681,7 +22622,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -21697,7 +22638,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -21713,7 +22654,7 @@ private void SubmodelToSequence(
writer.WriteEndElement();
}
- if (that.SubmodelElements != null && that.SubmodelElements.Count > 0)
+ if (that.SubmodelElements != null)
{
writer.WriteStartElement(
"submodelElements",
@@ -21747,7 +22688,7 @@ private void RelationshipElementToSequence(
Aas.IRelationshipElement that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -21787,7 +22728,7 @@ private void RelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -21803,7 +22744,7 @@ private void RelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -21832,7 +22773,7 @@ private void RelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -21848,7 +22789,7 @@ private void RelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -21864,7 +22805,7 @@ private void RelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -21918,7 +22859,7 @@ private void SubmodelElementListToSequence(
Aas.ISubmodelElementList that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -21958,7 +22899,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -21974,7 +22915,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22003,7 +22944,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22019,7 +22960,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22035,7 +22976,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -22107,7 +23048,7 @@ private void SubmodelElementListToSequence(
writer.WriteEndElement();
}
- if (that.Value != null && that.Value.Count > 0)
+ if (that.Value != null)
{
writer.WriteStartElement(
"value",
@@ -22141,7 +23082,7 @@ private void SubmodelElementCollectionToSequence(
Aas.ISubmodelElementCollection that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -22181,7 +23122,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -22197,7 +23138,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22226,7 +23167,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22242,7 +23183,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22258,7 +23199,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -22274,7 +23215,7 @@ private void SubmodelElementCollectionToSequence(
writer.WriteEndElement();
}
- if (that.Value != null && that.Value.Count > 0)
+ if (that.Value != null)
{
writer.WriteStartElement(
"value",
@@ -22308,7 +23249,7 @@ private void PropertyToSequence(
Aas.IProperty that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -22348,7 +23289,7 @@ private void PropertyToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -22364,7 +23305,7 @@ private void PropertyToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22393,7 +23334,7 @@ private void PropertyToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22409,7 +23350,7 @@ private void PropertyToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22425,7 +23366,7 @@ private void PropertyToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -22498,7 +23439,7 @@ private void MultiLanguagePropertyToSequence(
Aas.IMultiLanguageProperty that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -22538,7 +23479,7 @@ private void MultiLanguagePropertyToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -22554,7 +23495,7 @@ private void MultiLanguagePropertyToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22583,7 +23524,7 @@ private void MultiLanguagePropertyToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22599,7 +23540,7 @@ private void MultiLanguagePropertyToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22615,7 +23556,7 @@ private void MultiLanguagePropertyToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -22678,7 +23619,7 @@ private void RangeToSequence(
Aas.IRange that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -22718,7 +23659,7 @@ private void RangeToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -22734,7 +23675,7 @@ private void RangeToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22763,7 +23704,7 @@ private void RangeToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22779,7 +23720,7 @@ private void RangeToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22795,7 +23736,7 @@ private void RangeToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -22867,7 +23808,7 @@ private void ReferenceElementToSequence(
Aas.IReferenceElement that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -22907,7 +23848,7 @@ private void ReferenceElementToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -22923,7 +23864,7 @@ private void ReferenceElementToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -22952,7 +23893,7 @@ private void ReferenceElementToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -22968,7 +23909,7 @@ private void ReferenceElementToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -22984,7 +23925,7 @@ private void ReferenceElementToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -23031,7 +23972,7 @@ private void BlobToSequence(
Aas.IBlob that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -23071,7 +24012,7 @@ private void BlobToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -23087,7 +24028,7 @@ private void BlobToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -23116,7 +24057,7 @@ private void BlobToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -23132,7 +24073,7 @@ private void BlobToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -23148,7 +24089,7 @@ private void BlobToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -23205,7 +24146,7 @@ private void FileToSequence(
Aas.IFile that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -23245,7 +24186,7 @@ private void FileToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -23261,7 +24202,7 @@ private void FileToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -23290,7 +24231,7 @@ private void FileToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -23306,7 +24247,7 @@ private void FileToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -23322,7 +24263,7 @@ private void FileToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -23377,7 +24318,7 @@ private void AnnotatedRelationshipElementToSequence(
Aas.IAnnotatedRelationshipElement that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -23417,7 +24358,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -23433,7 +24374,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -23462,7 +24403,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -23478,7 +24419,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -23494,7 +24435,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -23530,7 +24471,7 @@ private void AnnotatedRelationshipElementToSequence(
writer.WriteEndElement();
- if (that.Annotations != null && that.Annotations.Count > 0)
+ if (that.Annotations != null)
{
writer.WriteStartElement(
"annotations",
@@ -23564,7 +24505,7 @@ private void EntityToSequence(
Aas.IEntity that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -23604,7 +24545,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -23620,7 +24561,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -23649,7 +24590,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -23665,7 +24606,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -23681,7 +24622,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -23697,7 +24638,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.Statements != null && that.Statements.Count > 0)
+ if (that.Statements != null)
{
writer.WriteStartElement(
"statements",
@@ -23739,7 +24680,7 @@ private void EntityToSequence(
writer.WriteEndElement();
}
- if (that.SpecificAssetIds != null && that.SpecificAssetIds.Count > 0)
+ if (that.SpecificAssetIds != null)
{
writer.WriteStartElement(
"specificAssetIds",
@@ -23885,7 +24826,7 @@ private void BasicEventElementToSequence(
Aas.IBasicEventElement that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -23925,7 +24866,7 @@ private void BasicEventElementToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -23941,7 +24882,7 @@ private void BasicEventElementToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -23970,7 +24911,7 @@ private void BasicEventElementToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -23986,7 +24927,7 @@ private void BasicEventElementToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -24002,7 +24943,7 @@ private void BasicEventElementToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -24135,7 +25076,7 @@ private void OperationToSequence(
Aas.IOperation that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -24175,7 +25116,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -24191,7 +25132,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -24220,7 +25161,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -24236,7 +25177,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -24252,7 +25193,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -24268,7 +25209,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.InputVariables != null && that.InputVariables.Count > 0)
+ if (that.InputVariables != null)
{
writer.WriteStartElement(
"inputVariables",
@@ -24284,7 +25225,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.OutputVariables != null && that.OutputVariables.Count > 0)
+ if (that.OutputVariables != null)
{
writer.WriteStartElement(
"outputVariables",
@@ -24300,7 +25241,7 @@ private void OperationToSequence(
writer.WriteEndElement();
}
- if (that.InoutputVariables != null && that.InoutputVariables.Count > 0)
+ if (that.InoutputVariables != null)
{
writer.WriteStartElement(
"inoutputVariables",
@@ -24362,7 +25303,7 @@ private void CapabilityToSequence(
Aas.ICapability that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -24402,7 +25343,7 @@ private void CapabilityToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -24418,7 +25359,7 @@ private void CapabilityToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -24447,7 +25388,7 @@ private void CapabilityToSequence(
writer.WriteEndElement();
}
- if (that.SupplementalSemanticIds != null && that.SupplementalSemanticIds.Count > 0)
+ if (that.SupplementalSemanticIds != null)
{
writer.WriteStartElement(
"supplementalSemanticIds",
@@ -24463,7 +25404,7 @@ private void CapabilityToSequence(
writer.WriteEndElement();
}
- if (that.Qualifiers != null && that.Qualifiers.Count > 0)
+ if (that.Qualifiers != null)
{
writer.WriteStartElement(
"qualifiers",
@@ -24479,7 +25420,7 @@ private void CapabilityToSequence(
writer.WriteEndElement();
}
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -24513,7 +25454,7 @@ private void ConceptDescriptionToSequence(
Aas.IConceptDescription that,
Xml.XmlWriter writer)
{
- if (that.Extensions != null && that.Extensions.Count > 0)
+ if (that.Extensions != null)
{
writer.WriteStartElement(
"extensions",
@@ -24553,7 +25494,7 @@ private void ConceptDescriptionToSequence(
writer.WriteEndElement();
}
- if (that.DisplayName != null && that.DisplayName.Count > 0)
+ if (that.DisplayName != null)
{
writer.WriteStartElement(
"displayName",
@@ -24569,7 +25510,7 @@ private void ConceptDescriptionToSequence(
writer.WriteEndElement();
}
- if (that.Description != null && that.Description.Count > 0)
+ if (that.Description != null)
{
writer.WriteStartElement(
"description",
@@ -24607,7 +25548,7 @@ private void ConceptDescriptionToSequence(
writer.WriteEndElement();
- if (that.EmbeddedDataSpecifications != null && that.EmbeddedDataSpecifications.Count > 0)
+ if (that.EmbeddedDataSpecifications != null)
{
writer.WriteStartElement(
"embeddedDataSpecifications",
@@ -24623,7 +25564,7 @@ private void ConceptDescriptionToSequence(
writer.WriteEndElement();
}
- if (that.IsCaseOf != null && that.IsCaseOf.Count > 0)
+ if (that.IsCaseOf != null)
{
writer.WriteStartElement(
"isCaseOf",
@@ -24657,10 +25598,6 @@ private void ReferenceToSequence(
Aas.IReference that,
Xml.XmlWriter writer)
{
- if (that == null)
- {
- return;
- }
writer.WriteStartElement(
"type",
NS);
@@ -24688,21 +25625,18 @@ private void ReferenceToSequence(
writer.WriteEndElement();
}
- if (that.Keys != null && that.Keys.Count > 0)
- {
- writer.WriteStartElement(
- "keys",
- NS);
-
- foreach (var item in that.Keys)
- {
- this.Visit(
- item,
- writer);
- }
+ writer.WriteStartElement(
+ "keys",
+ NS);
- writer.WriteEndElement();
+ foreach (var item in that.Keys)
+ {
+ this.Visit(
+ item,
+ writer);
}
+
+ writer.WriteEndElement();
} // private void ReferenceToSequence
public override void VisitReference(
@@ -24835,7 +25769,7 @@ private void EnvironmentToSequence(
Aas.IEnvironment that,
Xml.XmlWriter writer)
{
- if (that.AssetAdministrationShells != null && that.AssetAdministrationShells.Count > 0)
+ if (that.AssetAdministrationShells != null)
{
writer.WriteStartElement(
"assetAdministrationShells",
@@ -24851,7 +25785,7 @@ private void EnvironmentToSequence(
writer.WriteEndElement();
}
- if (that.Submodels != null && that.Submodels.Count > 0)
+ if (that.Submodels != null)
{
writer.WriteStartElement(
"submodels",
@@ -24867,7 +25801,7 @@ private void EnvironmentToSequence(
writer.WriteEndElement();
}
- if (that.ConceptDescriptions != null && that.ConceptDescriptions.Count > 0)
+ if (that.ConceptDescriptions != null)
{
writer.WriteStartElement(
"conceptDescriptions",
@@ -24901,32 +25835,25 @@ private void EmbeddedDataSpecificationToSequence(
Aas.IEmbeddedDataSpecification that,
Xml.XmlWriter writer)
{
- if (that.DataSpecification != null)
- {
- writer.WriteStartElement(
- "dataSpecification",
- NS);
+ writer.WriteStartElement(
+ "dataSpecification",
+ NS);
- this.ReferenceToSequence(
- that.DataSpecification,
- writer);
+ this.ReferenceToSequence(
+ that.DataSpecification,
+ writer);
- writer.WriteEndElement();
- }
+ writer.WriteEndElement();
- if (that.DataSpecificationContent != null)
- {
- writer.WriteStartElement(
- "dataSpecificationContent",
- NS);
+ writer.WriteStartElement(
+ "dataSpecificationContent",
+ NS);
- if (that.DataSpecificationContent != null)
- this.Visit(
- that.DataSpecificationContent,
- writer);
+ this.Visit(
+ that.DataSpecificationContent,
+ writer);
- writer.WriteEndElement();
- }
+ writer.WriteEndElement();
} // private void EmbeddedDataSpecificationToSequence
public override void VisitEmbeddedDataSpecification(
@@ -25037,21 +25964,18 @@ private void ValueListToSequence(
Aas.IValueList that,
Xml.XmlWriter writer)
{
- if (that.ValueReferencePairs != null && that.ValueReferencePairs.Count > 0)
- {
- writer.WriteStartElement(
- "valueReferencePairs",
- NS);
-
- foreach (var item in that.ValueReferencePairs)
- {
- this.Visit(
- item,
- writer);
- }
+ writer.WriteStartElement(
+ "valueReferencePairs",
+ NS);
- writer.WriteEndElement();
+ foreach (var item in that.ValueReferencePairs)
+ {
+ this.Visit(
+ item,
+ writer);
}
+
+ writer.WriteEndElement();
} // private void ValueListToSequence
public override void VisitValueList(
@@ -25179,23 +26103,20 @@ private void DataSpecificationIec61360ToSequence(
Aas.IDataSpecificationIec61360 that,
Xml.XmlWriter writer)
{
- if (that.PreferredName != null && that.PreferredName.Count > 0)
- {
- writer.WriteStartElement(
- "preferredName",
- NS);
-
- foreach (var item in that.PreferredName)
- {
- this.Visit(
- item,
- writer);
- }
+ writer.WriteStartElement(
+ "preferredName",
+ NS);
- writer.WriteEndElement();
+ foreach (var item in that.PreferredName)
+ {
+ this.Visit(
+ item,
+ writer);
}
- if (that.ShortName != null && that.ShortName.Count > 0)
+ writer.WriteEndElement();
+
+ if (that.ShortName != null)
{
writer.WriteStartElement(
"shortName",
@@ -25277,7 +26198,7 @@ private void DataSpecificationIec61360ToSequence(
writer.WriteEndElement();
}
- if (that.Definition != null && that.Definition.Count > 0)
+ if (that.Definition != null)
{
writer.WriteStartElement(
"definition",
diff --git a/src/Script.SemanticallyPatchAasCore/Folder.DotSettings b/src/Script.SemanticallyPatchAasCore/Folder.DotSettings
new file mode 100644
index 000000000..298641d4c
--- /dev/null
+++ b/src/Script.SemanticallyPatchAasCore/Folder.DotSettings
@@ -0,0 +1,6 @@
+
+ True
+ True
+ True
+ True
+ True
\ No newline at end of file
diff --git a/src/Script.SemanticallyPatchAasCore/Program.cs b/src/Script.SemanticallyPatchAasCore/Program.cs
new file mode 100644
index 000000000..a1c74d468
--- /dev/null
+++ b/src/Script.SemanticallyPatchAasCore/Program.cs
@@ -0,0 +1,616 @@
+using Console = System.Console;
+using Directory = System.IO.Directory;
+using Environment = System.Environment;
+using File = System.IO.File;
+using Path = System.IO.Path;
+using System.Collections.Generic;
+using Syntax = Microsoft.CodeAnalysis.CSharp.Syntax;
+using System.CommandLine;
+using System.Linq;
+
+
+namespace Script.SemanticallyPatchAasCore
+{
+ // ReSharper disable once ClassNeverInstantiated.Global
+ public class Program
+ {
+ interface IPatch
+ {
+ public int Position { get; }
+ public int End { get; }
+ public string Text { get; }
+ }
+
+ class InsertPrefix : IPatch
+ {
+ public int Position { get; }
+ public string Text { get; }
+
+ public int End => Position;
+
+ public InsertPrefix(int position, string text)
+ {
+ Position = position;
+ Text = text;
+ }
+ }
+
+ class InsertSuffix : IPatch
+ {
+ public int Position { get; }
+ public string Text { get; }
+
+ public int End => Position;
+
+ public InsertSuffix(int position, string text)
+ {
+ Position = position;
+ Text = text;
+ }
+ }
+
+ class Replace : IPatch
+ {
+ public int Position { get; }
+ public int End { get; }
+ public string Text { get; }
+
+ Replace(int position, int end, string text)
+ {
+ Position = position;
+ End = end;
+ Text = text;
+ }
+
+ public Replace Clone()
+ {
+ return new Replace(Position, End, Text);
+ }
+ }
+
+ private static string ApplyPatches(List patches, string text)
+ {
+ var sortedPatches = new List(patches);
+ sortedPatches.Sort(
+ (that, other) => that.Position - other.Position
+ );
+
+ #region CheckNoOverlapBetweenReplaces
+
+ Replace? prevReplace = null;
+
+ foreach (var replace in sortedPatches.OfType())
+ {
+ if (prevReplace != null)
+ {
+ if (prevReplace.End > replace.Position)
+ {
+ throw new System.InvalidOperationException(
+ "The two replace operations overlap: " +
+ $"({replace.Position}, {replace.End}, {replace.Text}) " +
+ $"and ({prevReplace.Position}, {prevReplace.End}, {prevReplace.Text})"
+ );
+ }
+ }
+
+ prevReplace = replace;
+ }
+
+ #endregion
+
+ #region MergeInserts
+
+ var mergedInserts = new List();
+
+ int lastInsertPrefixPosition = -1;
+ string lastInsertPrefixText = "";
+
+ int lastInsertSuffixPosition = -1;
+ string lastInsertSuffixText = "";
+
+ foreach (var patch in sortedPatches)
+ {
+ switch (patch)
+ {
+ case InsertPrefix insertPrefix:
+ if (lastInsertPrefixPosition == insertPrefix.Position)
+ {
+ // NOTE (mristin):
+ // This has quadratic time complexity, but merges are seldom so we see no need
+ // to make the code more complex than this.
+ lastInsertPrefixText =
+ $"{insertPrefix.Text}{lastInsertPrefixText}";
+ }
+ else
+ {
+ if (lastInsertPrefixPosition != -1)
+ {
+ mergedInserts.Add(
+ new InsertPrefix(lastInsertPrefixPosition,
+ lastInsertPrefixText)
+ );
+ }
+
+ lastInsertPrefixPosition = insertPrefix.Position;
+ lastInsertPrefixText = insertPrefix.Text;
+ }
+
+ break;
+ case InsertSuffix insertSuffix:
+ if (lastInsertSuffixPosition == insertSuffix.Position)
+ {
+ // NOTE (mristin):
+ // This has quadratic time complexity, but merges are seldom so we see no need
+ // to make the code more complex than this.
+ lastInsertSuffixText =
+ $"{insertSuffix.Text}{lastInsertSuffixText}";
+ }
+ else
+ {
+ if (lastInsertSuffixPosition != -1)
+ {
+ mergedInserts.Add(
+ new InsertSuffix(lastInsertSuffixPosition,
+ lastInsertSuffixText)
+ );
+ }
+
+ lastInsertSuffixPosition = insertSuffix.Position;
+ lastInsertSuffixText = insertSuffix.Text;
+ }
+
+ break;
+ // We pass here, as there is nothing to merge for other types.
+ }
+ }
+
+ if (lastInsertPrefixPosition != -1)
+ {
+ mergedInserts.Add(
+ new InsertPrefix(lastInsertPrefixPosition, lastInsertPrefixText)
+ );
+ }
+
+ if (lastInsertSuffixPosition != -1)
+ {
+ mergedInserts.Add(
+ new InsertSuffix(lastInsertSuffixPosition, lastInsertSuffixText)
+ );
+ }
+
+ #endregion
+
+ #region MergeSortOnMergedInsertsAndReplaces
+
+ using var replacesEnumerator =
+ sortedPatches.OfType().GetEnumerator();
+ using var insertsEnumerator = mergedInserts.GetEnumerator();
+
+ var replacesHasNext = replacesEnumerator.MoveNext();
+ var insertsHasNext = insertsEnumerator.MoveNext();
+
+ var mergedPatches = new List(patches.Count);
+
+ while (true)
+ {
+ if (!replacesHasNext && !insertsHasNext)
+ {
+ break;
+ }
+ else if (replacesHasNext && !insertsHasNext)
+ {
+ mergedPatches.Add(replacesEnumerator.Current);
+
+ replacesHasNext = replacesEnumerator.MoveNext();
+ }
+ else if (!replacesHasNext && insertsHasNext)
+ {
+ mergedPatches.Add(insertsEnumerator.Current);
+
+ insertsHasNext = insertsEnumerator.MoveNext();
+ }
+ else
+ {
+ if (insertsEnumerator.Current.Position <
+ replacesEnumerator.Current.Position)
+ {
+ mergedPatches.Add(insertsEnumerator.Current);
+ insertsHasNext = insertsEnumerator.MoveNext();
+ }
+ else
+ {
+ // NOTE (mristin):
+ // We clone here as we do not want the original `patches` to remain
+ // immutable.
+ mergedPatches.Add(replacesEnumerator.Current.Clone());
+ replacesHasNext = replacesEnumerator.MoveNext();
+ }
+ }
+ }
+
+ #endregion
+
+ var parts = new List();
+
+ IPatch? previousPatch = null;
+ foreach (var patch in mergedPatches)
+ {
+ if (previousPatch == null)
+ {
+ parts.Add(
+ text.Substring(0, patch.Position)
+ );
+ }
+ else
+ {
+ parts.Add(
+ text.Substring(
+ previousPatch.End,
+ patch.Position - previousPatch.End
+ )
+ );
+ }
+
+ parts.Add(patch.Text);
+ previousPatch = patch;
+ }
+
+ if (previousPatch != null)
+ {
+ parts.Add(
+ text.Substring(
+ previousPatch.End,
+ text.Length - previousPatch.End
+ )
+ );
+ }
+
+ return string.Join("", parts);
+ }
+
+ private static bool PatchTypes(string srcTypesPath, string tgtTypesPath)
+ {
+ string text = File.ReadAllText(srcTypesPath);
+ var tree = Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.ParseText(
+ text
+ );
+
+ var root = (Syntax.CompilationUnitSyntax)tree.GetRoot();
+
+ var patches = new List();
+
+ #region FindTheLastUsingAndAddNewtownsoft
+
+ {
+ Syntax.UsingDirectiveSyntax? lastUsingDirective = null;
+ foreach (
+ var usingDirective
+ in root.DescendantNodes().OfType()
+ )
+ {
+ if (lastUsingDirective == null
+ || usingDirective.GetLocation().SourceSpan.Start >
+ lastUsingDirective.GetLocation().SourceSpan.Start
+ )
+ {
+ lastUsingDirective = usingDirective;
+ }
+ }
+
+ if (lastUsingDirective == null)
+ {
+ Console.Error.WriteLine(
+ $"No using directives found in: {srcTypesPath}"
+ );
+ return false;
+ }
+
+ patches.Add(
+ new InsertSuffix(
+ lastUsingDirective.HasTrailingTrivia
+ ? lastUsingDirective.GetTrailingTrivia().Span.End
+ : lastUsingDirective.GetLocation().SourceSpan.End,
+ "\nusing Newtonsoft.Json; // can't alias\n"
+ )
+ );
+ }
+
+ #endregion
+
+ #region AddTimestampToAllReferables
+
+ {
+ var referable =
+ root.DescendantNodes()
+ .OfType()
+ .FirstOrDefault(
+ interfaceDeclaration =>
+ interfaceDeclaration.Identifier.Text ==
+ "IReferable"
+ );
+
+ if (referable == null)
+ {
+ Console.Error.WriteLine(
+ $"No interface IReferable found in: {srcTypesPath}"
+ );
+ return false;
+ }
+
+ string snippet =
+ "\n" +
+ " #region Parent\n" +
+ " [JsonIgnore]\n" +
+ " public IClass? Parent { get; set; }\n" +
+ " #endregion\n" +
+ "\n" +
+ " #region TimeStamp\n" +
+ " [JsonIgnore]\n" +
+ " public System.DateTime TimeStampCreate { get; set; }\n" +
+ " [JsonIgnore]\n" +
+ " public System.DateTime TimeStamp { get; set; }\n" +
+ " [JsonIgnore]\n" +
+ " public System.DateTime TimeStampTree { get; set; }\n" +
+ " #endregion\n\n";
+
+ patches.Add(
+ new InsertSuffix(
+ referable.OpenBraceToken.Span.End,
+ snippet
+ )
+ );
+
+ var interfaceChildren = new Dictionary>();
+ foreach (
+ var interfaceDeclaration
+ in root.DescendantNodes()
+ .OfType()
+ )
+ {
+ var interfaceName = interfaceDeclaration.Identifier.Text;
+
+ interfaceChildren[interfaceName] = new List();
+ }
+
+ foreach (
+ var interfaceDeclaration
+ in root.DescendantNodes()
+ .OfType()
+ )
+ {
+ var interfaceName = interfaceDeclaration.Identifier.Text;
+
+ if (interfaceDeclaration.BaseList != null)
+ {
+ foreach (var baseType in interfaceDeclaration.BaseList.Types)
+ {
+ var parentName = baseType.Type.GetText().ToString().Trim();
+ if (!interfaceChildren.ContainsKey(parentName))
+ {
+ throw new System.InvalidOperationException(
+ "Unexpected no interfaceChildren entry " +
+ $"for {parentName}; expected all interfaceChildren " +
+ "entries to be initialized for all interfaces before"
+ );
+ }
+
+ interfaceChildren[parentName].Add(interfaceName);
+ }
+ }
+ }
+
+ if (!interfaceChildren.ContainsKey("IReferable"))
+ {
+ Console.Error.WriteLine(
+ $"No interface IReferable found in: {srcTypesPath}"
+ );
+ return false;
+ }
+
+ var referableInterfaces = new HashSet();
+ var queue = new Queue();
+ queue.Enqueue("IReferable");
+
+ while (queue.Count > 0)
+ {
+ var interfaceName = queue.Dequeue();
+ referableInterfaces.Add(interfaceName);
+
+ foreach (string child in interfaceChildren[interfaceName])
+ {
+ queue.Enqueue(child);
+ }
+ }
+
+ foreach (
+ var classDeclaration
+ in root.DescendantNodes().OfType()
+ )
+ {
+ bool isReferable = false;
+ if (classDeclaration.BaseList != null)
+ {
+ foreach (var baseType in classDeclaration.BaseList.Types)
+ {
+ string baseTypeName =
+ baseType.Type.GetText().ToString().Trim();
+
+ if (referableInterfaces.Contains(baseTypeName))
+ {
+ isReferable = true;
+ }
+ }
+ }
+
+ if (!isReferable)
+ {
+ continue;
+ }
+
+ patches.Add(
+ new InsertSuffix(
+ classDeclaration.OpenBraceToken.Span.End,
+ snippet
+ )
+ );
+ }
+ }
+
+ #endregion
+
+ string patched = ApplyPatches(patches, text);
+
+ try
+ {
+ File.WriteAllText(tgtTypesPath, patched);
+ }
+ catch (System.Exception exception)
+ {
+ Console.Error.WriteLine(
+ $"Failed to write to {tgtTypesPath}: {exception}");
+ return false;
+ }
+
+ return true;
+ }
+
+ // ReSharper disable once ClassNeverInstantiated.Global
+ // ReSharper disable once MemberCanBePrivate.Global
+ public class Arguments
+ {
+#pragma warning disable 8618
+ // ReSharper disable UnusedAutoPropertyAccessor.Global
+ // ReSharper disable CollectionNeverUpdated.Global
+ public string SourceProject { get; set; }
+ public string TargetProject { get; set; }
+ // ReSharper restore CollectionNeverUpdated.Global
+ // ReSharper restore UnusedAutoPropertyAccessor.Global
+#pragma warning restore 8618
+ }
+
+ private static string? FindCsprojFile(string path)
+ {
+ foreach (string file in Directory.GetFiles(path))
+ {
+ if (file.EndsWith(".csproj"))
+ {
+ return file;
+ }
+ }
+
+ return null;
+ }
+
+ private static int SemanticallyPatch(Arguments a)
+ {
+ if (!Directory.Exists(a.SourceProject))
+ {
+ Console.Error.WriteLine(
+ $"The --source does not exist or is not a directory: {a.SourceProject}"
+ );
+ return 1;
+ }
+
+ if (FindCsprojFile(a.SourceProject) == null)
+ {
+ Console.Error.WriteLine(
+ $"There is no *.csproj in --source: {a.SourceProject}"
+ );
+ return 1;
+ }
+
+ if (!Directory.Exists(a.TargetProject))
+ {
+ if (File.Exists(a.TargetProject))
+ {
+ Console.Error.WriteLine(
+ $"The --target exists, but it is a file, while we expected a directory: {a.TargetProject}"
+ );
+ return 1;
+ }
+
+ Directory.CreateDirectory(a.TargetProject);
+ }
+
+ string srcTypesPath = Path.Join(a.SourceProject, "types.cs");
+ if (!File.Exists(srcTypesPath))
+ {
+ Console.Error.WriteLine(
+ $"The types.cs could not be found in --source: {a.SourceProject}"
+ );
+ return 1;
+ }
+
+ string tgtTypesPath = Path.Join(a.TargetProject, "types.cs");
+
+ bool success = PatchTypes(srcTypesPath, tgtTypesPath);
+
+ var filenames = new List()
+ {
+ "constants.cs",
+ "copying.cs",
+ "jsonization.cs",
+ "reporting.cs",
+ "stringification.cs",
+ "verification.cs",
+ "visitation.cs",
+ "xmlization.cs"
+ };
+ foreach (var filename in filenames)
+ {
+ string src = Path.Join(a.SourceProject, filename);
+ string tgt = Path.Join(a.TargetProject, filename);
+
+ try
+ {
+ File.Copy(src, tgt, true);
+ }
+ catch (System.Exception exception)
+ {
+ Console.Error.WriteLine(
+ $"Failed to copy {src} to {tgt}: {exception}"
+ );
+ success = false;
+ }
+ }
+
+ if (!success)
+ {
+ return 1;
+ }
+
+ return 0;
+ }
+
+ static async System.Threading.Tasks.Task Main(string[] args)
+ {
+ var sourceOption = new Option(
+ new[] { "--source", "-s" },
+ "Path to the original project containing aas-core-csharp")
+ { IsRequired = true };
+
+ var targetOption = new Option(
+ new[] { "--target", "-t" },
+ "Path to the project where the semantically patched code " +
+ "should live"
+ )
+ { IsRequired = true };
+
+ var rootCommand = new RootCommand(
+ "Semantically patch the aas-core-csharp library for aasx-server."
+ ) { sourceOption, targetOption };
+
+
+ rootCommand.SetHandler(
+ (source, target) =>
+ {
+ Environment.ExitCode = SemanticallyPatch(
+ new Arguments()
+ { SourceProject = source, TargetProject = target }
+ );
+ }, sourceOption, targetOption);
+
+ await rootCommand.InvokeAsync(args);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Script.SemanticallyPatchAasCore/Script.SemanticallyPatchAasCore.csproj b/src/Script.SemanticallyPatchAasCore/Script.SemanticallyPatchAasCore.csproj
new file mode 100644
index 000000000..54fd67e34
--- /dev/null
+++ b/src/Script.SemanticallyPatchAasCore/Script.SemanticallyPatchAasCore.csproj
@@ -0,0 +1,14 @@
+
+
+
+ Exe
+ net6
+ enable
+ 8
+
+
+
+
+
+
+