diff --git a/ReqIFSharp.Tests/Decorators/ModelMetadataTestFixture.cs b/ReqIFSharp.Tests/Decorators/ModelMetadataTestFixture.cs
new file mode 100644
index 0000000..337a401
--- /dev/null
+++ b/ReqIFSharp.Tests/Decorators/ModelMetadataTestFixture.cs
@@ -0,0 +1,200 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp.Tests.Decorators
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Reflection;
+
+ using NUnit.Framework;
+
+ using ReqIFSharp;
+
+ ///
+ /// Reflection-driven completeness guard that verifies every model class and metamodel property
+ /// in the assembly is decorated with the
+ /// and metadata decorators. When a new model class or property
+ /// is added, this fixture fails until the decorators are applied (or the property is added to the
+ /// documented exclusion list of infrastructure / back-reference members).
+ ///
+ [TestFixture]
+ public class ModelMetadataTestFixture
+ {
+ ///
+ /// Names of properties that are NOT part of the ReqIF metamodel and therefore intentionally
+ /// carry no : container back-references, owner links and
+ /// programming-convenience accessors.
+ ///
+ private static readonly HashSet ExcludedPropertyNames = new HashSet
+ {
+ "ObjectValue", // convenience accessor that aliases TheValue / Values
+ "DatatypeDefinition", // AttributeDefinition base accessor that aliases the concrete Type
+ "AttributeDefinition", // AttributeValue base accessor that aliases the concrete Definition
+ "ExternalObjects", // derived from the parsed XHTML content
+ "OwningDefinition", // back-reference to the owning AttributeDefinition
+ "Definition", // see note below - kept, handled explicitly (NOT excluded)
+ "SpecElAt", // back-reference to the owning SpecElementWithAttributes
+ "SpecType", // AttributeDefinition back-reference to its owning SpecType
+ "ReqIFContent", // back-reference to the owning ReqIFContent
+ "ReqIfContent", // back-reference (SpecHierarchy casing variant)
+ "DocumentRoot", // back-reference to the owning ReqIF
+ "CoreContent", // RelationGroup back-reference to the owning ReqIFContent
+ "Root", // SpecHierarchy back-reference to the owning Specification
+ "Container", // SpecHierarchy back-reference to the parent SpecHierarchy
+ "DataTpeDefEnum", // EnumValue back-reference to the owning DatatypeDefinitionEnumeration
+ "EnumValue", // EmbeddedValue back-reference to the owning EnumValue
+ "Owner", // ExternalObject back-reference to the owning AttributeValueXHTML
+ "Ident" // AlternativeId back-reference to the owning Identifiable
+ };
+
+ ///
+ /// Returns every model class in the assembly. A model class is one
+ /// that derives from or , or is one of
+ /// the remaining stand-alone model classes.
+ ///
+ private static IEnumerable ModelTypes()
+ {
+ var standalone = new[]
+ {
+ typeof(ReqIF), typeof(ReqIFContent), typeof(ReqIFHeader), typeof(ReqIFToolExtension),
+ typeof(AlternativeId), typeof(EmbeddedValue), typeof(ExternalObject)
+ };
+
+ return typeof(Identifiable).Assembly.GetTypes()
+ .Where(t => t.IsClass
+ && (typeof(Identifiable).IsAssignableFrom(t)
+ || typeof(AttributeValue).IsAssignableFrom(t)
+ || standalone.Contains(t)));
+ }
+
+ ///
+ /// Returns the public, instance properties declared directly on that
+ /// are expected to carry a (i.e. metamodel features), filtering
+ /// out the documented infrastructure / back-reference exclusions. The Definition property
+ /// IS a metamodel reference and is therefore kept even though it appears in the lookup set above
+ /// only for documentation - it is removed from the exclusion set here.
+ ///
+ private static IEnumerable MetamodelProperties(Type type)
+ {
+ return type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
+ .Where(p => p.GetMethod != null && p.GetMethod.IsPublic)
+ .Where(p => p.Name == "Definition" || !ExcludedPropertyNames.Contains(p.Name));
+ }
+
+ [Test]
+ public void Verify_that_every_model_class_is_decorated_with_ReqIfClassAttribute()
+ {
+ var offenders = ModelTypes()
+ .Where(t => t.GetCustomAttribute() == null)
+ .Select(t => t.Name)
+ .ToList();
+
+ Assert.That(offenders, Is.Empty,
+ $"The following model classes are missing the [Class] decorator: {string.Join(", ", offenders)}");
+ }
+
+ [Test]
+ public void Verify_that_ReqIfClassAttribute_IsAbstract_matches_the_type()
+ {
+ foreach (var type in ModelTypes())
+ {
+ var classAttribute = type.GetCustomAttribute();
+
+ Assert.That(classAttribute, Is.Not.Null, $"{type.Name} is missing the [Class] decorator.");
+ Assert.That(classAttribute.IsAbstract, Is.EqualTo(type.IsAbstract),
+ $"[Class].IsAbstract on {type.Name} does not match the type's abstractness.");
+ Assert.That(classAttribute.Name, Is.Not.Empty, $"[Class].Name on {type.Name} should not be empty.");
+ }
+ }
+
+ [Test]
+ public void Verify_that_every_metamodel_property_is_decorated_with_ReqIfPropertyAttribute()
+ {
+ var offenders = new List();
+
+ foreach (var type in ModelTypes())
+ {
+ foreach (var property in MetamodelProperties(type))
+ {
+ if (property.GetCustomAttribute() == null)
+ {
+ offenders.Add($"{type.Name}.{property.Name}");
+ }
+ }
+ }
+
+ Assert.That(offenders, Is.Empty,
+ $"The following metamodel properties are missing the [Property] decorator: {string.Join(", ", offenders)}");
+ }
+
+ [Test]
+ public void Verify_that_every_ReqIfPropertyAttribute_has_consistent_multiplicity()
+ {
+ foreach (var type in ModelTypes())
+ {
+ foreach (var property in MetamodelProperties(type))
+ {
+ var propertyAttribute = property.GetCustomAttribute();
+
+ if (propertyAttribute == null)
+ {
+ continue;
+ }
+
+ Assert.That(propertyAttribute.LowerValue, Is.GreaterThanOrEqualTo(0),
+ $"{type.Name}.{property.Name} has a negative lower bound.");
+ Assert.That(propertyAttribute.UpperValue, Is.GreaterThanOrEqualTo(1),
+ $"{type.Name}.{property.Name} has an upper bound below 1.");
+ Assert.That(propertyAttribute.UpperValue, Is.GreaterThanOrEqualTo(propertyAttribute.LowerValue),
+ $"{type.Name}.{property.Name} has an upper bound below its lower bound.");
+ }
+ }
+ }
+
+ [Test]
+ public void Verify_known_property_metadata_spot_checks()
+ {
+ AssertProperty(typeof(SpecObject), nameof(SpecObject.Type), AggregationKind.None, 1, 1);
+ AssertProperty(typeof(ReqIFContent), nameof(ReqIFContent.SpecObjects), AggregationKind.Composite, 0, int.MaxValue);
+ AssertProperty(typeof(Identifiable), nameof(Identifiable.Identifier), AggregationKind.None, 1, 1);
+ AssertProperty(typeof(Identifiable), nameof(Identifiable.AlternativeId), AggregationKind.Composite, 0, 1);
+ AssertProperty(typeof(AttributeDefinitionEnumeration), nameof(AttributeDefinitionEnumeration.IsMultiValued), AggregationKind.None, 1, 1);
+ AssertProperty(typeof(DatatypeDefinitionEnumeration), nameof(DatatypeDefinitionEnumeration.SpecifiedValues), AggregationKind.Composite, 0, int.MaxValue);
+ }
+
+ private static void AssertProperty(Type type, string propertyName, AggregationKind aggregation, int lower, int upper)
+ {
+ var property = type.GetProperty(propertyName);
+ Assert.That(property, Is.Not.Null, $"{type.Name}.{propertyName} does not exist.");
+
+ var propertyAttribute = property.GetCustomAttribute();
+ Assert.That(propertyAttribute, Is.Not.Null, $"{type.Name}.{propertyName} is missing the [Property] decorator.");
+
+ Assert.Multiple(() =>
+ {
+ Assert.That(propertyAttribute.Aggregation, Is.EqualTo(aggregation), $"{type.Name}.{propertyName} aggregation");
+ Assert.That(propertyAttribute.LowerValue, Is.EqualTo(lower), $"{type.Name}.{propertyName} lower bound");
+ Assert.That(propertyAttribute.UpperValue, Is.EqualTo(upper), $"{type.Name}.{propertyName} upper bound");
+ });
+ }
+ }
+}
diff --git a/ReqIFSharp.Tests/Decorators/ReqIfClassAttributeTestFixture.cs b/ReqIFSharp.Tests/Decorators/ReqIfClassAttributeTestFixture.cs
new file mode 100644
index 0000000..eef429f
--- /dev/null
+++ b/ReqIFSharp.Tests/Decorators/ReqIfClassAttributeTestFixture.cs
@@ -0,0 +1,64 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp.Tests.Decorators
+{
+ using NUnit.Framework;
+
+ using ReqIFSharp;
+
+ ///
+ /// Suite of tests for the class
+ ///
+ [TestFixture]
+ public class ReqIfClassAttributeTestFixture
+ {
+ [Test]
+ public void Verify_that_default_constructor_values_are_as_expected()
+ {
+ var classAttribute = new ReqIfClassAttribute();
+
+ Assert.That(classAttribute.Name, Is.EqualTo(string.Empty));
+ Assert.That(classAttribute.IsAbstract, Is.False);
+ }
+
+ [Test]
+ public void Verify_that_constructor_sets_properties_as_expected()
+ {
+ var classAttribute = new ReqIfClassAttribute("SPEC-OBJECT", true);
+
+ Assert.That(classAttribute.Name, Is.EqualTo("SPEC-OBJECT"));
+ Assert.That(classAttribute.IsAbstract, Is.True);
+ }
+
+ [Test]
+ public void Verify_that_properties_can_be_set()
+ {
+ var classAttribute = new ReqIfClassAttribute
+ {
+ Name = "SPEC-RELATION",
+ IsAbstract = true
+ };
+
+ Assert.That(classAttribute.Name, Is.EqualTo("SPEC-RELATION"));
+ Assert.That(classAttribute.IsAbstract, Is.True);
+ }
+ }
+}
diff --git a/ReqIFSharp.Tests/Decorators/ReqIfPropertyAttributeTestFixture.cs b/ReqIFSharp.Tests/Decorators/ReqIfPropertyAttributeTestFixture.cs
new file mode 100644
index 0000000..c8e92a8
--- /dev/null
+++ b/ReqIFSharp.Tests/Decorators/ReqIfPropertyAttributeTestFixture.cs
@@ -0,0 +1,74 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp.Tests.Decorators
+{
+ using NUnit.Framework;
+
+ using ReqIFSharp;
+
+ ///
+ /// Suite of tests for the class
+ ///
+ [TestFixture]
+ public class ReqIfPropertyAttributeTestFixture
+ {
+ [Test]
+ public void Verify_that_default_constructor_values_are_as_expected()
+ {
+ var propertyAttribute = new ReqIfPropertyAttribute();
+
+ Assert.That(propertyAttribute.Aggregation, Is.EqualTo(AggregationKind.None));
+ Assert.That(propertyAttribute.LowerValue, Is.EqualTo(1));
+ Assert.That(propertyAttribute.UpperValue, Is.EqualTo(1));
+ Assert.That(propertyAttribute.IsOrdered, Is.False);
+ Assert.That(propertyAttribute.IsReadOnly, Is.False);
+ Assert.That(propertyAttribute.IsDerived, Is.False);
+ Assert.That(propertyAttribute.IsDerivedUnion, Is.False);
+ Assert.That(propertyAttribute.IsUnique, Is.True);
+ Assert.That(propertyAttribute.DefaultValue, Is.Null);
+ }
+
+ [Test]
+ public void Verify_that_constructor_sets_properties_as_expected()
+ {
+ var propertyAttribute = new ReqIfPropertyAttribute(
+ aggregation: AggregationKind.Composite,
+ lowerValue: 0,
+ upperValue: int.MaxValue,
+ isOrdered: true,
+ isReadOnly: true,
+ isDerived: true,
+ isDerivedUnion: true,
+ isUnique: false,
+ defaultValue: "default");
+
+ Assert.That(propertyAttribute.Aggregation, Is.EqualTo(AggregationKind.Composite));
+ Assert.That(propertyAttribute.LowerValue, Is.EqualTo(0));
+ Assert.That(propertyAttribute.UpperValue, Is.EqualTo(int.MaxValue));
+ Assert.That(propertyAttribute.IsOrdered, Is.True);
+ Assert.That(propertyAttribute.IsReadOnly, Is.True);
+ Assert.That(propertyAttribute.IsDerived, Is.True);
+ Assert.That(propertyAttribute.IsDerivedUnion, Is.True);
+ Assert.That(propertyAttribute.IsUnique, Is.False);
+ Assert.That(propertyAttribute.DefaultValue, Is.EqualTo("default"));
+ }
+ }
+}
diff --git a/ReqIFSharp/AccessControlledElement.cs b/ReqIFSharp/AccessControlledElement.cs
index 71d4e65..ac3e273 100644
--- a/ReqIFSharp/AccessControlledElement.cs
+++ b/ReqIFSharp/AccessControlledElement.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// The is the base class for classes that may restrict user access to their information.
///
+ [ReqIfClass(name: "ACCESS-CONTROLLED-ELEMENT", isAbstract: true)]
public abstract class AccessControlledElement : Identifiable
{
///
@@ -66,6 +67,7 @@ protected AccessControlledElement(ILoggerFactory loggerFactory)
/// True means that the element’s contents may be modified by the user of a tool containing the element.
/// False or leaving isEditable out means that the element is read-only to the user of a tool containing the element.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public bool IsEditable { get; set; }
///
diff --git a/ReqIFSharp/AlternativeID.cs b/ReqIFSharp/AlternativeID.cs
index 1409d0a..c428522 100644
--- a/ReqIFSharp/AlternativeID.cs
+++ b/ReqIFSharp/AlternativeID.cs
@@ -28,6 +28,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to provide an alternative, tool-specific identification.
///
+ [ReqIfClass(name: "ALTERNATIVE-ID", isAbstract: false)]
public class AlternativeId
{
///
@@ -52,6 +53,7 @@ internal AlternativeId(Identifiable identifiable)
///
/// Gets or sets the optional alternative identifier, which may be a requirements management tool identifier or tool identifier
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Identifier { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinition.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinition.cs
index 50dcc75..b19d2f2 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinition.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinition.cs
@@ -36,6 +36,7 @@ namespace ReqIFSharp
/// type. In , each attribute value ( element) is related to its data type ( element) via
/// an attribute definition ( element).
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION", isAbstract: true)]
public abstract class AttributeDefinition : AccessControlledElement
{
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionBoolean.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionBoolean.cs
index 954f8d1..7b80687 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionBoolean.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionBoolean.cs
@@ -39,6 +39,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an attribute
/// value if no attribute value is supplied by the user of the requirements authoring tool
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-BOOLEAN", isAbstract: false)]
public class AttributeDefinitionBoolean : AttributeDefinitionSimple
{
///
@@ -84,11 +85,13 @@ internal AttributeDefinitionBoolean(SpecType specType, ILoggerFactory loggerFact
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueBoolean DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionBoolean Type { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionDate.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionDate.cs
index 2349c32..aa48001 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionDate.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionDate.cs
@@ -40,6 +40,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an attribute
/// value if no attribute value is supplied by the user of the requirements authoring tool
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-DATE", isAbstract: false)]
public class AttributeDefinitionDate : AttributeDefinitionSimple
{
///
@@ -85,11 +86,13 @@ internal AttributeDefinitionDate(SpecType specType, ILoggerFactory loggerFactory
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueDate DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionDate Type { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionEnumeration.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionEnumeration.cs
index 90d667d..76af9c8 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionEnumeration.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionEnumeration.cs
@@ -39,6 +39,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an
/// attribute value if no attribute value is supplied by the user of the requirements authoring tool.
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-ENUMERATION", isAbstract: false)]
public class AttributeDefinitionEnumeration : AttributeDefinition
{
///
@@ -84,11 +85,13 @@ internal AttributeDefinitionEnumeration(SpecType specType, ILoggerFactory logger
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueEnumeration DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionEnumeration Type { get; set; }
///
@@ -134,6 +137,7 @@ protected override void SetDatatypeDefinition(DatatypeDefinition datatypeDefinit
/// If set to false, this means that the user of a requirements authoring tool can pick exactly one of the values in the set of
/// specified values as an enumeration attribute value.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public bool IsMultiValued { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionInteger.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionInteger.cs
index 81df915..5d555d9 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionInteger.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionInteger.cs
@@ -1,292 +1,295 @@
-// -------------------------------------------------------------------------------------------------
-//
-//
-// Copyright 2017-2026 Starion Group S.A.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-// -------------------------------------------------------------------------------------------------
-
-namespace ReqIFSharp
-{
- using System;
- using System.Globalization;
- using System.Linq;
- using System.Runtime.Serialization;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Xml;
-
- using Microsoft.Extensions.Logging;
- using Microsoft.Extensions.Logging.Abstractions;
-
- ///
- /// The purpose of the class is to define an Integer attribute.
- ///
- ///
- /// An element relates an element to a
- /// element via its attribute.
- /// An element MAY contain a default value that represents the value that is used as an attribute
- /// value if no attribute value is supplied by the user of the requirements authoring tool.
- /// ReqIfSharp supports 64 bit singed integers (long) with the following range: -9223372036854775808 to 9223372036854775807
- ///
- public class AttributeDefinitionInteger : AttributeDefinitionSimple
- {
- ///
- /// The used to log
- ///
- private readonly ILogger logger;
-
- ///
- /// Initializes a new instance of the class.
- ///
- public AttributeDefinitionInteger()
- {
- this.logger = NullLogger.Instance;
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// The (injected) used to set up logging
- ///
- public AttributeDefinitionInteger(ILoggerFactory loggerFactory) : base(loggerFactory)
- {
- this.logger = this.loggerFactory == null ? NullLogger.Instance : this.loggerFactory.CreateLogger();
- }
-
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// The owning .
- ///
- ///
- /// The (injected) used to set up logging
- ///
- internal AttributeDefinitionInteger(SpecType specType, ILoggerFactory loggerFactory)
- : base(specType, loggerFactory)
- {
- this.logger = this.loggerFactory == null ? NullLogger.Instance : this.loggerFactory.CreateLogger();
- }
-
- ///
- /// Gets or sets the owned default value that is used if no attribute value is supplied
- /// by the user of the requirements authoring tool.
- ///
- public AttributeValueInteger DefaultValue { get; set; }
-
- ///
- /// Gets or sets the data type.
- ///
- public DatatypeDefinitionInteger Type { get; set; }
-
- ///
- /// Gets the
- ///
- ///
- /// An instance of
- ///
- protected override DatatypeDefinition GetDatatypeDefinition()
- {
- return this.Type;
- }
-
- ///
- /// Sets the
- ///
- ///
- /// The instance of that is to be set.
- ///
- protected override void SetDatatypeDefinition(DatatypeDefinition datatypeDefinition)
- {
- if (datatypeDefinition == null)
- {
- throw new ArgumentNullException(nameof(datatypeDefinition));
- }
-
- if (datatypeDefinition.GetType() != typeof(DatatypeDefinitionInteger))
- {
- throw new ArgumentException($"{nameof(datatypeDefinition)} must of type DatatypeDefinitionInteger");
- }
-
- this.Type = (DatatypeDefinitionInteger)datatypeDefinition;
- }
-
- ///
- /// Generates a object from its XML representation.
- ///
- ///
- /// an instance of
- ///
- internal override void ReadXml(XmlReader reader)
- {
- base.ReadXml(reader);
-
- while (reader.Read())
- {
- if (reader.MoveToContent() == XmlNodeType.Element)
- {
- var xmlLineInfo = reader as IXmlLineInfo;
-
- switch (reader.LocalName)
- {
- case "ALTERNATIVE-ID":
- this.ReadAlternativeId(reader);
- break;
- case "DATATYPE-DEFINITION-INTEGER-REF":
- var reference = reader.ReadElementContentAsString();
- var datatypeDefinition = (DatatypeDefinitionInteger)this.SpecType.ReqIFContent.DataTypes.SingleOrDefault(x => x.Identifier == reference);
- this.Type = datatypeDefinition;
-
- if (datatypeDefinition == null)
- {
- this.logger.LogTrace("The DatatypeDefinitionInteger:{Reference} could not be found and has been set to null on AttributeDefinitionInteger:{Identifier}", reference, Identifier);
- }
-
- break;
- case "ATTRIBUTE-VALUE-INTEGER":
- this.DefaultValue = new AttributeValueInteger(this, this.loggerFactory);
- using (var valueSubtree = reader.ReadSubtree())
- {
- valueSubtree.MoveToContent();
- this.DefaultValue.ReadXml(valueSubtree);
- }
- break;
- default:
- this.logger.LogWarning("The {LocalName} element at line:position {LineNumber}:{LinePosition} is not supported", reader.LocalName, xmlLineInfo?.LineNumber, xmlLineInfo?.LinePosition);
- break;
- }
- }
- }
- }
-
- ///
- /// Asynchronously generates a object from its XML representation.
- ///
- ///
- /// an instance of
- ///
- ///
- /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- ///
- internal override async Task ReadXmlAsync(XmlReader reader, CancellationToken token)
- {
- base.ReadXml(reader);
-
- while (await reader.ReadAsync())
- {
- token.ThrowIfCancellationRequested();
-
- if (await reader.MoveToContentAsync() == XmlNodeType.Element)
- {
- var xmlLineInfo = reader as IXmlLineInfo;
-
- switch (reader.LocalName)
- {
- case "ALTERNATIVE-ID":
- await this.ReadAlternativeIdAsync(reader, token);
- break;
- case "DATATYPE-DEFINITION-INTEGER-REF":
- var reference = await reader.ReadElementContentAsStringAsync();
- var datatypeDefinition = (DatatypeDefinitionInteger)this.SpecType.ReqIFContent.DataTypes.SingleOrDefault(x => x.Identifier == reference);
- this.Type = datatypeDefinition;
-
- if (datatypeDefinition == null)
- {
- this.logger.LogTrace("The DatatypeDefinitionInteger:{Reference} could not be found and has been set to null on AttributeDefinitionInteger:{Identifier}", reference, Identifier);
- }
-
- break;
- case "ATTRIBUTE-VALUE-INTEGER":
- this.DefaultValue = new AttributeValueInteger(this, this.loggerFactory);
- using (var valueSubtree = reader.ReadSubtree())
- {
- await valueSubtree.MoveToContentAsync();
- await this.DefaultValue.ReadXmlAsync(valueSubtree, token);
- }
- break;
- default:
- this.logger.LogWarning("The {LocalName} element at line:position {LineNumber}:{LinePosition} is not supported", reader.LocalName, xmlLineInfo?.LineNumber, xmlLineInfo?.LinePosition);
- break;
- }
- }
- }
- }
-
- ///
- /// Converts a object into its XML representation.
- ///
- ///
- /// an instance of
- ///
- ///
- /// The may not be null
- ///
- internal override void WriteXml(XmlWriter writer)
- {
- base.WriteXml(writer);
-
- if (this.DefaultValue != null)
- {
- writer.WriteStartElement("DEFAULT-VALUE");
- writer.WriteStartElement("ATTRIBUTE-VALUE-INTEGER");
- writer.WriteAttributeString("THE-VALUE", this.DefaultValue.TheValue.ToString(NumberFormatInfo.InvariantInfo));
- writer.WriteStartElement("DEFINITION");
- writer.WriteElementString("ATTRIBUTE-DEFINITION-INTEGER-REF", this.DefaultValue.Definition.Identifier);
- writer.WriteEndElement();
- writer.WriteEndElement();
- writer.WriteEndElement();
- }
-
- writer.WriteStartElement("TYPE");
- writer.WriteElementString("DATATYPE-DEFINITION-INTEGER-REF", this.Type.Identifier);
- writer.WriteEndElement();
- }
-
- ///
- /// Asynchronously converts a object into its XML representation.
- ///
- ///
- /// an instance of
- ///
- ///
- /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
- ///
- ///
- /// The may not be null
- ///
- internal override async Task WriteXmlAsync(XmlWriter writer, CancellationToken token)
- {
- await base.WriteXmlAsync(writer, token);
-
- if (this.DefaultValue != null)
- {
- await writer.WriteStartElementAsync(null,"DEFAULT-VALUE", null);
- await writer.WriteStartElementAsync(null, "ATTRIBUTE-VALUE-INTEGER", null);
- await writer.WriteAttributeStringAsync(null, "THE-VALUE", null, this.DefaultValue.TheValue.ToString(NumberFormatInfo.InvariantInfo));
- await writer.WriteStartElementAsync(null, "DEFINITION", null);
- await writer.WriteElementStringAsync(null, "ATTRIBUTE-DEFINITION-INTEGER-REF", null, this.DefaultValue.Definition.Identifier);
- await writer.WriteEndElementAsync();
- await writer.WriteEndElementAsync();
- await writer.WriteEndElementAsync();
- }
-
- await writer.WriteStartElementAsync(null, "TYPE", null);
- await writer.WriteElementStringAsync(null, "DATATYPE-DEFINITION-INTEGER-REF", null, this.Type.Identifier);
- await writer.WriteEndElementAsync();
- }
- }
-}
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// -------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp
+{
+ using System;
+ using System.Globalization;
+ using System.Linq;
+ using System.Runtime.Serialization;
+ using System.Threading;
+ using System.Threading.Tasks;
+ using System.Xml;
+
+ using Microsoft.Extensions.Logging;
+ using Microsoft.Extensions.Logging.Abstractions;
+
+ ///
+ /// The purpose of the class is to define an Integer attribute.
+ ///
+ ///
+ /// An element relates an element to a
+ /// element via its attribute.
+ /// An element MAY contain a default value that represents the value that is used as an attribute
+ /// value if no attribute value is supplied by the user of the requirements authoring tool.
+ /// ReqIfSharp supports 64 bit singed integers (long) with the following range: -9223372036854775808 to 9223372036854775807
+ ///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-INTEGER", isAbstract: false)]
+ public class AttributeDefinitionInteger : AttributeDefinitionSimple
+ {
+ ///
+ /// The used to log
+ ///
+ private readonly ILogger logger;
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AttributeDefinitionInteger()
+ {
+ this.logger = NullLogger.Instance;
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The (injected) used to set up logging
+ ///
+ public AttributeDefinitionInteger(ILoggerFactory loggerFactory) : base(loggerFactory)
+ {
+ this.logger = this.loggerFactory == null ? NullLogger.Instance : this.loggerFactory.CreateLogger();
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The owning .
+ ///
+ ///
+ /// The (injected) used to set up logging
+ ///
+ internal AttributeDefinitionInteger(SpecType specType, ILoggerFactory loggerFactory)
+ : base(specType, loggerFactory)
+ {
+ this.logger = this.loggerFactory == null ? NullLogger.Instance : this.loggerFactory.CreateLogger();
+ }
+
+ ///
+ /// Gets or sets the owned default value that is used if no attribute value is supplied
+ /// by the user of the requirements authoring tool.
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public AttributeValueInteger DefaultValue { get; set; }
+
+ ///
+ /// Gets or sets the data type.
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public DatatypeDefinitionInteger Type { get; set; }
+
+ ///
+ /// Gets the
+ ///
+ ///
+ /// An instance of
+ ///
+ protected override DatatypeDefinition GetDatatypeDefinition()
+ {
+ return this.Type;
+ }
+
+ ///
+ /// Sets the
+ ///
+ ///
+ /// The instance of that is to be set.
+ ///
+ protected override void SetDatatypeDefinition(DatatypeDefinition datatypeDefinition)
+ {
+ if (datatypeDefinition == null)
+ {
+ throw new ArgumentNullException(nameof(datatypeDefinition));
+ }
+
+ if (datatypeDefinition.GetType() != typeof(DatatypeDefinitionInteger))
+ {
+ throw new ArgumentException($"{nameof(datatypeDefinition)} must of type DatatypeDefinitionInteger");
+ }
+
+ this.Type = (DatatypeDefinitionInteger)datatypeDefinition;
+ }
+
+ ///
+ /// Generates a object from its XML representation.
+ ///
+ ///
+ /// an instance of
+ ///
+ internal override void ReadXml(XmlReader reader)
+ {
+ base.ReadXml(reader);
+
+ while (reader.Read())
+ {
+ if (reader.MoveToContent() == XmlNodeType.Element)
+ {
+ var xmlLineInfo = reader as IXmlLineInfo;
+
+ switch (reader.LocalName)
+ {
+ case "ALTERNATIVE-ID":
+ this.ReadAlternativeId(reader);
+ break;
+ case "DATATYPE-DEFINITION-INTEGER-REF":
+ var reference = reader.ReadElementContentAsString();
+ var datatypeDefinition = (DatatypeDefinitionInteger)this.SpecType.ReqIFContent.DataTypes.SingleOrDefault(x => x.Identifier == reference);
+ this.Type = datatypeDefinition;
+
+ if (datatypeDefinition == null)
+ {
+ this.logger.LogTrace("The DatatypeDefinitionInteger:{Reference} could not be found and has been set to null on AttributeDefinitionInteger:{Identifier}", reference, Identifier);
+ }
+
+ break;
+ case "ATTRIBUTE-VALUE-INTEGER":
+ this.DefaultValue = new AttributeValueInteger(this, this.loggerFactory);
+ using (var valueSubtree = reader.ReadSubtree())
+ {
+ valueSubtree.MoveToContent();
+ this.DefaultValue.ReadXml(valueSubtree);
+ }
+ break;
+ default:
+ this.logger.LogWarning("The {LocalName} element at line:position {LineNumber}:{LinePosition} is not supported", reader.LocalName, xmlLineInfo?.LineNumber, xmlLineInfo?.LinePosition);
+ break;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Asynchronously generates a object from its XML representation.
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ internal override async Task ReadXmlAsync(XmlReader reader, CancellationToken token)
+ {
+ base.ReadXml(reader);
+
+ while (await reader.ReadAsync())
+ {
+ token.ThrowIfCancellationRequested();
+
+ if (await reader.MoveToContentAsync() == XmlNodeType.Element)
+ {
+ var xmlLineInfo = reader as IXmlLineInfo;
+
+ switch (reader.LocalName)
+ {
+ case "ALTERNATIVE-ID":
+ await this.ReadAlternativeIdAsync(reader, token);
+ break;
+ case "DATATYPE-DEFINITION-INTEGER-REF":
+ var reference = await reader.ReadElementContentAsStringAsync();
+ var datatypeDefinition = (DatatypeDefinitionInteger)this.SpecType.ReqIFContent.DataTypes.SingleOrDefault(x => x.Identifier == reference);
+ this.Type = datatypeDefinition;
+
+ if (datatypeDefinition == null)
+ {
+ this.logger.LogTrace("The DatatypeDefinitionInteger:{Reference} could not be found and has been set to null on AttributeDefinitionInteger:{Identifier}", reference, Identifier);
+ }
+
+ break;
+ case "ATTRIBUTE-VALUE-INTEGER":
+ this.DefaultValue = new AttributeValueInteger(this, this.loggerFactory);
+ using (var valueSubtree = reader.ReadSubtree())
+ {
+ await valueSubtree.MoveToContentAsync();
+ await this.DefaultValue.ReadXmlAsync(valueSubtree, token);
+ }
+ break;
+ default:
+ this.logger.LogWarning("The {LocalName} element at line:position {LineNumber}:{LinePosition} is not supported", reader.LocalName, xmlLineInfo?.LineNumber, xmlLineInfo?.LinePosition);
+ break;
+ }
+ }
+ }
+ }
+
+ ///
+ /// Converts a object into its XML representation.
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// The may not be null
+ ///
+ internal override void WriteXml(XmlWriter writer)
+ {
+ base.WriteXml(writer);
+
+ if (this.DefaultValue != null)
+ {
+ writer.WriteStartElement("DEFAULT-VALUE");
+ writer.WriteStartElement("ATTRIBUTE-VALUE-INTEGER");
+ writer.WriteAttributeString("THE-VALUE", this.DefaultValue.TheValue.ToString(NumberFormatInfo.InvariantInfo));
+ writer.WriteStartElement("DEFINITION");
+ writer.WriteElementString("ATTRIBUTE-DEFINITION-INTEGER-REF", this.DefaultValue.Definition.Identifier);
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+ }
+
+ writer.WriteStartElement("TYPE");
+ writer.WriteElementString("DATATYPE-DEFINITION-INTEGER-REF", this.Type.Identifier);
+ writer.WriteEndElement();
+ }
+
+ ///
+ /// Asynchronously converts a object into its XML representation.
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
+ ///
+ ///
+ /// The may not be null
+ ///
+ internal override async Task WriteXmlAsync(XmlWriter writer, CancellationToken token)
+ {
+ await base.WriteXmlAsync(writer, token);
+
+ if (this.DefaultValue != null)
+ {
+ await writer.WriteStartElementAsync(null,"DEFAULT-VALUE", null);
+ await writer.WriteStartElementAsync(null, "ATTRIBUTE-VALUE-INTEGER", null);
+ await writer.WriteAttributeStringAsync(null, "THE-VALUE", null, this.DefaultValue.TheValue.ToString(NumberFormatInfo.InvariantInfo));
+ await writer.WriteStartElementAsync(null, "DEFINITION", null);
+ await writer.WriteElementStringAsync(null, "ATTRIBUTE-DEFINITION-INTEGER-REF", null, this.DefaultValue.Definition.Identifier);
+ await writer.WriteEndElementAsync();
+ await writer.WriteEndElementAsync();
+ await writer.WriteEndElementAsync();
+ }
+
+ await writer.WriteStartElementAsync(null, "TYPE", null);
+ await writer.WriteElementStringAsync(null, "DATATYPE-DEFINITION-INTEGER-REF", null, this.Type.Identifier);
+ await writer.WriteEndElementAsync();
+ }
+ }
+}
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionReal.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionReal.cs
index ef867e4..c9f4cbd 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionReal.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionReal.cs
@@ -40,6 +40,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an attribute
/// value if no attribute value is supplied by the user of the requirements authoring tool.
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-REAL", isAbstract: false)]
public class AttributeDefinitionReal : AttributeDefinitionSimple
{
///
@@ -85,11 +86,13 @@ internal AttributeDefinitionReal(SpecType specType, ILoggerFactory loggerFactory
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueReal DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionReal Type { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionSimple.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionSimple.cs
index b6aa7dc..55a8e55 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionSimple.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionSimple.cs
@@ -25,6 +25,7 @@ namespace ReqIFSharp
///
/// The is the base class for simple type attributes.
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-SIMPLE", isAbstract: true)]
public abstract class AttributeDefinitionSimple : AttributeDefinition
{
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionString.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionString.cs
index aa83263..2465bd0 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionString.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionString.cs
@@ -39,6 +39,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an attribute
/// value if no attribute value is supplied by the user of the requirements authoring tool.
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-STRING", isAbstract: false)]
public class AttributeDefinitionString : AttributeDefinitionSimple
{
///
@@ -84,11 +85,13 @@ internal AttributeDefinitionString(SpecType specType, ILoggerFactory loggerFacto
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueString DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionString Type { get; set; }
///
diff --git a/ReqIFSharp/AttributeDefinition/AttributeDefinitionXHTML.cs b/ReqIFSharp/AttributeDefinition/AttributeDefinitionXHTML.cs
index ca4021e..889ec51 100644
--- a/ReqIFSharp/AttributeDefinition/AttributeDefinitionXHTML.cs
+++ b/ReqIFSharp/AttributeDefinition/AttributeDefinitionXHTML.cs
@@ -39,6 +39,7 @@ namespace ReqIFSharp
/// An element MAY contain a default value that represents the value that is used as an attribute
/// value if no attribute value is supplied by the user of the requirements authoring tool.
///
+ [ReqIfClass(name: "ATTRIBUTE-DEFINITION-XHTML", isAbstract: false)]
public class AttributeDefinitionXHTML : AttributeDefinition
{
///
@@ -84,11 +85,13 @@ internal AttributeDefinitionXHTML(SpecType specType, ILoggerFactory loggerFactor
/// Gets or sets the owned default value that is used if no attribute value is supplied
/// by the user of the requirements authoring tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeValueXHTML DefaultValue { get; set; }
///
/// Gets or sets the data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DatatypeDefinitionXHTML Type { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValue.cs b/ReqIFSharp/AttributeValue/AttributeValue.cs
index f2f8d92..33835f9 100644
--- a/ReqIFSharp/AttributeValue/AttributeValue.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValue.cs
@@ -29,6 +29,7 @@ namespace ReqIFSharp
///
/// The is the base class for attribute values.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE", isAbstract: true)]
public abstract class AttributeValue
{
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueBoolean.cs b/ReqIFSharp/AttributeValue/AttributeValueBoolean.cs
index d99d326..f0a051d 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueBoolean.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueBoolean.cs
@@ -33,6 +33,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define a attribute value.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-BOOLEAN", isAbstract: false)]
public class AttributeValueBoolean : AttributeValueSimple
{
///
@@ -95,6 +96,7 @@ internal AttributeValueBoolean(SpecElementWithAttributes specElAt, ILoggerFactor
///
/// Gets or sets the attribute value.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public bool TheValue { get; set; }
///
@@ -120,6 +122,7 @@ public override object ObjectValue
///
/// Gets or sets a reference to the value definition
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionBoolean Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueDate.cs b/ReqIFSharp/AttributeValue/AttributeValueDate.cs
index 57b2549..ea559ea 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueDate.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueDate.cs
@@ -34,6 +34,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define a attribute value.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-DATE", isAbstract: false)]
public class AttributeValueDate : AttributeValueSimple
{
///
@@ -85,6 +86,7 @@ internal AttributeValueDate(SpecElementWithAttributes specElAt, ILoggerFactory l
///
/// Gets or sets the attribute value.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DateTime TheValue { get; set; }
///
@@ -110,6 +112,7 @@ public override object ObjectValue
///
/// Gets or sets the Reference to the value definition.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionDate Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueEnumeration.cs b/ReqIFSharp/AttributeValue/AttributeValueEnumeration.cs
index f091876..48154cf 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueEnumeration.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueEnumeration.cs
@@ -34,6 +34,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define an enumeration attribute value.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-ENUMERATION", isAbstract: false)]
public class AttributeValueEnumeration : AttributeValue
{
///
@@ -101,6 +102,7 @@ internal AttributeValueEnumeration(SpecElementWithAttributes specElAt, ILoggerFa
///
/// Gets s that are chosen from a set of specified values
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List Values => this.values;
///
@@ -127,6 +129,7 @@ public override object ObjectValue
///
/// Gets or sets the Reference to the attribute definition that relates the value to its data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionEnumeration Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueInteger.cs b/ReqIFSharp/AttributeValue/AttributeValueInteger.cs
index 51fb6fa..344fe03 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueInteger.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueInteger.cs
@@ -37,6 +37,7 @@ namespace ReqIFSharp
///
/// ReqIfSharp supports 64 bit signed integers (long) with the following range: -9223372036854775808 to 9223372036854775807
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-INTEGER", isAbstract: false)]
public class AttributeValueInteger : AttributeValueSimple
{
///
@@ -99,6 +100,7 @@ internal AttributeValueInteger(SpecElementWithAttributes specElAt, ILoggerFactor
///
/// Gets or sets the attribute value
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long TheValue { get; set; }
///
@@ -124,6 +126,7 @@ public override object ObjectValue
///
/// Gets or sets the Reference to the value definition.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionInteger Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueReal.cs b/ReqIFSharp/AttributeValue/AttributeValueReal.cs
index ee60e2f..4715b0c 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueReal.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueReal.cs
@@ -34,6 +34,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define a real attribute value.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-REAL", isAbstract: false)]
public class AttributeValueReal : AttributeValueSimple
{
///
@@ -96,6 +97,7 @@ internal AttributeValueReal(SpecElementWithAttributes specElAt, ILoggerFactory l
///
/// Gets or sets the attribute value
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public double TheValue { get; set; }
///
@@ -121,6 +123,7 @@ public override object ObjectValue
///
/// Gets or sets the reference to the value definition
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionReal Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueSimple.cs b/ReqIFSharp/AttributeValue/AttributeValueSimple.cs
index 9340185..ad6cf55 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueSimple.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueSimple.cs
@@ -25,6 +25,7 @@ namespace ReqIFSharp
///
/// The is the base class for simple type attribute values.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-SIMPLE", isAbstract: true)]
public abstract class AttributeValueSimple : AttributeValue
{
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueString.cs b/ReqIFSharp/AttributeValue/AttributeValueString.cs
index 8a12987..eb29206 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueString.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueString.cs
@@ -33,6 +33,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define a attribute value.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-STRING", isAbstract: false)]
public class AttributeValueString : AttributeValueSimple
{
///
@@ -85,6 +86,7 @@ internal AttributeValueString(SpecElementWithAttributes specElAt, ILoggerFactory
///
/// Gets or sets the attribute value
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string TheValue { get; set; }
///
@@ -102,6 +104,7 @@ public override object ObjectValue
///
/// Gets or sets reference to the value definition
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionString Definition { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/AttributeValueXHTML.cs b/ReqIFSharp/AttributeValue/AttributeValueXHTML.cs
index 777568a..3837cad 100644
--- a/ReqIFSharp/AttributeValue/AttributeValueXHTML.cs
+++ b/ReqIFSharp/AttributeValue/AttributeValueXHTML.cs
@@ -37,6 +37,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define an attribute value with XHTML contents.
///
+ [ReqIfClass(name: "ATTRIBUTE-VALUE-XHTML", isAbstract: false)]
public class AttributeValueXHTML : AttributeValue
{
///
@@ -103,11 +104,13 @@ internal AttributeValueXHTML(AttributeDefinitionXHTML attributeDefinition, ILogg
///
/// Gets or sets the XHTML Content
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string TheValue { get; set; }
///
/// Gets or sets the Linkage to the original attribute value that has been saved if isSimplified is true.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string TheOriginalValue { get; set; }
///
@@ -138,6 +141,7 @@ public override object ObjectValue
///
/// Gets or sets the Reference to the attribute definition that relates the value to its data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AttributeDefinitionXHTML Definition { get; set; }
///
@@ -180,6 +184,7 @@ protected override void SetAttributeDefinition(AttributeDefinition attributeDefi
///
/// Gets or sets a value indicating whether the attribute value is a simplified representation of the original value.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public bool IsSimplified { get; set; }
///
diff --git a/ReqIFSharp/AttributeValue/ExternalObject.cs b/ReqIFSharp/AttributeValue/ExternalObject.cs
index 5ab5438..5367a23 100644
--- a/ReqIFSharp/AttributeValue/ExternalObject.cs
+++ b/ReqIFSharp/AttributeValue/ExternalObject.cs
@@ -1,163 +1,168 @@
-// -------------------------------------------------------------------------------------------------
-//
-//
-// Copyright 2017-2026 Starion Group S.A.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-//
-// ------------------------------------------------------------------------------------------------
-
-namespace ReqIFSharp
-{
- using System;
- using System.IO;
- using System.IO.Compression;
-
- ///
- /// External objects are referenced binary objects that are referenced using the XHTML object element from the XHTML Object Module.
- /// The location of an external object MUST be specified via the data attribute which contains either
- /// a) a URL relative to the location of the exchange XML document, or
- /// b) an absolute URL.
- ///
- ///
- /// The specification for the XTHML object element defines several XML attributes. For ReqIF, only a subset of these attributes is relevant and used.
- ///
- public class ExternalObject
- {
- ///
- /// Initializes a new instance of the class.
- ///
- ///
- /// The owning
- ///
- public ExternalObject(AttributeValueXHTML attributeValueXhtml)
- {
- this.Owner = attributeValueXhtml;
- }
-
- ///
- /// Gets the owning
- ///
- public AttributeValueXHTML Owner { get; private set; }
-
- ///
- /// Gets or sets the Uri of the , this may be a relative uri or an absolute uri
- ///
- public string Uri { get; set; }
-
- ///
- /// Gets or sets the MimeType of the external object represented as a string
- ///
- public string MimeType { get; set; }
-
- ///
- /// Gets or sets the height of the external object in case it is an image
- ///
- public int? Height { get; set; }
-
- ///
- /// Gets or sets the width of the external object in case it is an image
- ///
- public int? Width { get; set; }
-
- ///
- /// Asserts whether the external object should be queried from the reqifz file or from
- /// another (absolute) location such as a resource available via HTTP or HTTPS
- ///
- ///
- public bool IsDataLocal()
- {
- return !this.Uri.StartsWith("http", StringComparison.OrdinalIgnoreCase);
- }
-
- ///
- /// Queries the local data from the reqifz file and writes the data to the provided target
- ///
- ///
- /// The path of the reqifz file that contains the data local data
- ///
- ///
- /// The target to which the data is written
- ///
- ///
- /// Thrown when the is null
- ///
- ///
- /// thrown when the is an absolute uri and not a relative Uri or
- /// when the reqifz file is unknown
- ///
- public void QueryLocalData(string reqifPath, Stream target)
- {
- if (string.IsNullOrEmpty(reqifPath))
- {
- throw new ArgumentException($"The {nameof(reqifPath)} file path may not be null or empty", nameof(reqifPath));
- }
-
- using (var reader = new FileStream(reqifPath, FileMode.Open))
- {
- this.QueryLocalData(reader, target);
- }
- }
-
- ///
- /// Queries the local data from the reqifz file and writes the data to the provided target
- ///
- ///
- /// The that contains the reqifz file to deserialize
- ///
- ///
- /// The target to which the data is written
- ///
- ///
- /// Thrown when the is null
- ///
- ///
- /// thrown when the is an absolute uri and not a relative Uri or
- /// when the reqifz file is unknown
- ///
- public void QueryLocalData(Stream reqifz, Stream target)
- {
- if (reqifz == null)
- {
- throw new ArgumentNullException(nameof(reqifz), $"The {nameof(reqifz)} may not be null");
- }
-
- if (reqifz.Length == 0)
- {
- throw new ArgumentException($"The {nameof(reqifz)} may not be empty", nameof(reqifz));
- }
-
- if (target == null)
- {
- throw new ArgumentNullException(nameof(target), "The target stream may not be null");
- }
-
- if (!this.IsDataLocal())
- {
- throw new InvalidOperationException($"The Uri of the External Object is not a relative Uri that can be found in the {nameof(reqifz)} file");
- }
-
- using (var archive = new ZipArchive(reqifz, ZipArchiveMode.Read))
- {
- var zipArchiveEntry = archive.GetEntry(this.Uri);
- if (zipArchiveEntry != null)
- {
- var sourceStream = zipArchiveEntry.Open();
- sourceStream.CopyTo(target);
- sourceStream.Dispose();
- }
- }
- }
- }
-}
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp
+{
+ using System;
+ using System.IO;
+ using System.IO.Compression;
+
+ ///
+ /// External objects are referenced binary objects that are referenced using the XHTML object element from the XHTML Object Module.
+ /// The location of an external object MUST be specified via the data attribute which contains either
+ /// a) a URL relative to the location of the exchange XML document, or
+ /// b) an absolute URL.
+ ///
+ ///
+ /// The specification for the XTHML object element defines several XML attributes. For ReqIF, only a subset of these attributes is relevant and used.
+ ///
+ [ReqIfClass(name: "EXTERNAL-OBJECT", isAbstract: false)]
+ public class ExternalObject
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The owning
+ ///
+ public ExternalObject(AttributeValueXHTML attributeValueXhtml)
+ {
+ this.Owner = attributeValueXhtml;
+ }
+
+ ///
+ /// Gets the owning
+ ///
+ public AttributeValueXHTML Owner { get; private set; }
+
+ ///
+ /// Gets or sets the Uri of the , this may be a relative uri or an absolute uri
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public string Uri { get; set; }
+
+ ///
+ /// Gets or sets the MimeType of the external object represented as a string
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public string MimeType { get; set; }
+
+ ///
+ /// Gets or sets the height of the external object in case it is an image
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public int? Height { get; set; }
+
+ ///
+ /// Gets or sets the width of the external object in case it is an image
+ ///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
+ public int? Width { get; set; }
+
+ ///
+ /// Asserts whether the external object should be queried from the reqifz file or from
+ /// another (absolute) location such as a resource available via HTTP or HTTPS
+ ///
+ ///
+ public bool IsDataLocal()
+ {
+ return !this.Uri.StartsWith("http", StringComparison.OrdinalIgnoreCase);
+ }
+
+ ///
+ /// Queries the local data from the reqifz file and writes the data to the provided target
+ ///
+ ///
+ /// The path of the reqifz file that contains the data local data
+ ///
+ ///
+ /// The target to which the data is written
+ ///
+ ///
+ /// Thrown when the is null
+ ///
+ ///
+ /// thrown when the is an absolute uri and not a relative Uri or
+ /// when the reqifz file is unknown
+ ///
+ public void QueryLocalData(string reqifPath, Stream target)
+ {
+ if (string.IsNullOrEmpty(reqifPath))
+ {
+ throw new ArgumentException($"The {nameof(reqifPath)} file path may not be null or empty", nameof(reqifPath));
+ }
+
+ using (var reader = new FileStream(reqifPath, FileMode.Open))
+ {
+ this.QueryLocalData(reader, target);
+ }
+ }
+
+ ///
+ /// Queries the local data from the reqifz file and writes the data to the provided target
+ ///
+ ///
+ /// The that contains the reqifz file to deserialize
+ ///
+ ///
+ /// The target to which the data is written
+ ///
+ ///
+ /// Thrown when the is null
+ ///
+ ///
+ /// thrown when the is an absolute uri and not a relative Uri or
+ /// when the reqifz file is unknown
+ ///
+ public void QueryLocalData(Stream reqifz, Stream target)
+ {
+ if (reqifz == null)
+ {
+ throw new ArgumentNullException(nameof(reqifz), $"The {nameof(reqifz)} may not be null");
+ }
+
+ if (reqifz.Length == 0)
+ {
+ throw new ArgumentException($"The {nameof(reqifz)} may not be empty", nameof(reqifz));
+ }
+
+ if (target == null)
+ {
+ throw new ArgumentNullException(nameof(target), "The target stream may not be null");
+ }
+
+ if (!this.IsDataLocal())
+ {
+ throw new InvalidOperationException($"The Uri of the External Object is not a relative Uri that can be found in the {nameof(reqifz)} file");
+ }
+
+ using (var archive = new ZipArchive(reqifz, ZipArchiveMode.Read))
+ {
+ var zipArchiveEntry = archive.GetEntry(this.Uri);
+ if (zipArchiveEntry != null)
+ {
+ var sourceStream = zipArchiveEntry.Open();
+ sourceStream.CopyTo(target);
+ sourceStream.Dispose();
+ }
+ }
+ }
+ }
+}
diff --git a/ReqIFSharp/Datatype/DatatypeDefinition.cs b/ReqIFSharp/Datatype/DatatypeDefinition.cs
index a684da8..ff03834 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinition.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinition.cs
@@ -30,6 +30,7 @@ namespace ReqIFSharp
///
/// The is the base class for all data types available to the Exchange Document.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION", isAbstract: true)]
public abstract class DatatypeDefinition : Identifiable
{
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionBoolean.cs b/ReqIFSharp/Datatype/DatatypeDefinitionBoolean.cs
index 595029e..22ba6a0 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionBoolean.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionBoolean.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// This element defines a data type for the representation of Boolean data values in the Exchange Document.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-BOOLEAN", isAbstract: false)]
public class DatatypeDefinitionBoolean : DatatypeDefinitionSimple
{
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionDate.cs b/ReqIFSharp/Datatype/DatatypeDefinitionDate.cs
index 5833f1a..0a25ed7 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionDate.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionDate.cs
@@ -33,6 +33,7 @@ namespace ReqIFSharp
///
/// This element defines a data type for the representation of Date and Time data values in the Exchange Document.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-DATE", isAbstract: false)]
public class DatatypeDefinitionDate : DatatypeDefinitionSimple
{
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionEnumeration.cs b/ReqIFSharp/Datatype/DatatypeDefinitionEnumeration.cs
index d6bf111..4082441 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionEnumeration.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionEnumeration.cs
@@ -37,6 +37,7 @@ namespace ReqIFSharp
/// Data type definition for enumeration types. The set of enumeration values referenced by specifiedValues constrains the
/// possible choices for enumeration attribute values
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-ENUMERATION", isAbstract: false)]
public class DatatypeDefinitionEnumeration : DatatypeDefinition
{
///
@@ -87,6 +88,7 @@ internal DatatypeDefinitionEnumeration(ReqIFContent reqIfContent, ILoggerFactory
///
/// Gets the owned enumeration literals
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecifiedValues => this.specifiedValues;
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionInteger.cs b/ReqIFSharp/Datatype/DatatypeDefinitionInteger.cs
index ffe525a..01fe767 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionInteger.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionInteger.cs
@@ -37,6 +37,7 @@ namespace ReqIFSharp
/// The representation of data values shall comply with the definitions in http://www.w3.org/TR/xmlschema-2/#integer
/// ReqIfSharp supports 64-bit signed integers (long) with the following range: -9223372036854775808 to 9223372036854775807
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-INTEGER", isAbstract: false)]
public class DatatypeDefinitionInteger : DatatypeDefinitionSimple
{
///
@@ -82,11 +83,13 @@ internal DatatypeDefinitionInteger(ReqIFContent reqIfContent, ILoggerFactory log
///
/// Gets or sets a value that denotes the largest negative data value representable by this data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long Min { get; set; }
///
/// Gets or sets a value that denotes the largest positive data value representable by this data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long Max { get; set; }
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionReal.cs b/ReqIFSharp/Datatype/DatatypeDefinitionReal.cs
index b600e8e..2822462 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionReal.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionReal.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// This element defines a data type for the representation of Real data values in the Exchange Document.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-REAL", isAbstract: false)]
public class DatatypeDefinitionReal : DatatypeDefinitionSimple
{
///
@@ -77,16 +78,19 @@ internal DatatypeDefinitionReal(ReqIFContent reqIfContent, ILoggerFactory logger
///
/// Gets or sets a value that Denotes the supported maximum precision of real numbers represented by this data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long Accuracy { get; set; }
///
/// Gets or sets a value that denotes the largest negative data value representable by this data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public double Min { get; set; }
///
/// Gets or sets a value that denotes the largest positive data value representable by this data type.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public double Max { get; set; }
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionSimple.cs b/ReqIFSharp/Datatype/DatatypeDefinitionSimple.cs
index 4830fa4..5426b6b 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionSimple.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionSimple.cs
@@ -25,6 +25,7 @@ namespace ReqIFSharp
///
/// The is the base class from which all primitive data types, except enumeration, are derived.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-SIMPLE", isAbstract: true)]
public abstract class DatatypeDefinitionSimple : DatatypeDefinition
{
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionString.cs b/ReqIFSharp/Datatype/DatatypeDefinitionString.cs
index e31813b..9212660 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionString.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionString.cs
@@ -35,7 +35,8 @@ namespace ReqIFSharp
///
/// This element defines a data type for the representation of String data values in the Exchange Document.
///
- public class DatatypeDefinitionString : DatatypeDefinitionSimple
+ [ReqIfClass(name: "DATATYPE-DEFINITION-STRING", isAbstract: false)]
+ public class DatatypeDefinitionString : DatatypeDefinitionSimple
{
///
/// The used to log
@@ -80,6 +81,7 @@ internal DatatypeDefinitionString(ReqIFContent reqIfContent, ILoggerFactory logg
///
/// Gets or sets the maximum permissible string length
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long MaxLength { get; set; }
///
diff --git a/ReqIFSharp/Datatype/DatatypeDefinitionXHTML.cs b/ReqIFSharp/Datatype/DatatypeDefinitionXHTML.cs
index 6b99074..0056e74 100644
--- a/ReqIFSharp/Datatype/DatatypeDefinitionXHTML.cs
+++ b/ReqIFSharp/Datatype/DatatypeDefinitionXHTML.cs
@@ -29,6 +29,7 @@ namespace ReqIFSharp
///
/// The purpose of the class is to define XHTML formatted data.
///
+ [ReqIfClass(name: "DATATYPE-DEFINITION-XHTML", isAbstract: false)]
public class DatatypeDefinitionXHTML : DatatypeDefinition
{
///
diff --git a/ReqIFSharp/Datatype/EmbeddedValue.cs b/ReqIFSharp/Datatype/EmbeddedValue.cs
index fada682..7f80ffe 100644
--- a/ReqIFSharp/Datatype/EmbeddedValue.cs
+++ b/ReqIFSharp/Datatype/EmbeddedValue.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// The class represents additional information related to enumeration literals.
///
+ [ReqIfClass(name: "EMBEDDED-VALUE", isAbstract: false)]
public class EmbeddedValue
{
///
@@ -67,6 +68,7 @@ internal EmbeddedValue(EnumValue enumValue, ILoggerFactory loggerFactory)
///
/// Gets or sets the numerical value corresponding to the enumeration literal.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public long Key { get; set; }
///
@@ -75,6 +77,7 @@ internal EmbeddedValue(EnumValue enumValue, ILoggerFactory loggerFactory)
///
/// example: a color
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string OtherContent { get; set; }
///
diff --git a/ReqIFSharp/Datatype/EnumValue.cs b/ReqIFSharp/Datatype/EnumValue.cs
index 0acd113..903f83c 100644
--- a/ReqIFSharp/Datatype/EnumValue.cs
+++ b/ReqIFSharp/Datatype/EnumValue.cs
@@ -29,6 +29,7 @@ namespace ReqIFSharp
///
/// The class represents enumeration literals.
///
+ [ReqIfClass(name: "ENUM-VALUE", isAbstract: false)]
public class EnumValue : Identifiable
{
///
@@ -68,6 +69,7 @@ internal EnumValue(DatatypeDefinitionEnumeration datatypeDefinitionEnumeration,
///
/// Gets or sets the owned
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public EmbeddedValue Properties { get; set; }
///
diff --git a/ReqIFSharp/Decorators/AggregationKind.cs b/ReqIFSharp/Decorators/AggregationKind.cs
new file mode 100644
index 0000000..279ce4a
--- /dev/null
+++ b/ReqIFSharp/Decorators/AggregationKind.cs
@@ -0,0 +1,45 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// -------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp
+{
+ ///
+ /// Specifies the kind of aggregation that applies to a property, mirroring the UML
+ /// AggregationKind enumeration. It documents whether a property merely references
+ /// another model element or owns it (containment).
+ ///
+ public enum AggregationKind
+ {
+ ///
+ /// The property is a plain reference (or a scalar value); the referenced element is not owned.
+ ///
+ None,
+
+ ///
+ /// The property is a shared aggregation; the referenced element may be shared by multiple owners.
+ ///
+ Shared,
+
+ ///
+ /// The property is a composite aggregation; the owning element contains and owns the value(s).
+ ///
+ Composite
+ }
+}
diff --git a/ReqIFSharp/Decorators/ReqIfClassAttribute.cs b/ReqIFSharp/Decorators/ReqIfClassAttribute.cs
new file mode 100644
index 0000000..2f4402e
--- /dev/null
+++ b/ReqIFSharp/Decorators/ReqIfClassAttribute.cs
@@ -0,0 +1,58 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// -------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp
+{
+ using System;
+
+ ///
+ /// Attribute used to decorate the model classes with metadata sourced from the ReqIF metamodel,
+ /// so that the relationships and characteristics of each class are self-documenting.
+ ///
+ [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
+ public sealed class ReqIfClassAttribute : Attribute
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The name of the ReqIF metaclass that the decorated class represents (e.g. SPEC-OBJECT).
+ ///
+ ///
+ /// A value indicating whether the decorated class is abstract. An abstract class does not provide
+ /// a complete declaration and cannot be instantiated on its own.
+ ///
+ public ReqIfClassAttribute(string name = "", bool isAbstract = false)
+ {
+ this.Name = name;
+ this.IsAbstract = isAbstract;
+ }
+
+ ///
+ /// Gets or sets the name of the ReqIF metaclass that the decorated class represents.
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the decorated class is abstract.
+ ///
+ public bool IsAbstract { get; set; }
+ }
+}
diff --git a/ReqIFSharp/Decorators/ReqIfPropertyAttribute.cs b/ReqIFSharp/Decorators/ReqIfPropertyAttribute.cs
new file mode 100644
index 0000000..2a60a8f
--- /dev/null
+++ b/ReqIFSharp/Decorators/ReqIfPropertyAttribute.cs
@@ -0,0 +1,126 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2017-2026 Starion Group S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// -------------------------------------------------------------------------------------------------
+
+namespace ReqIFSharp
+{
+ using System;
+
+ ///
+ /// Attribute used to decorate the model properties with metadata sourced from the ReqIF metamodel,
+ /// so that the multiplicity, ownership and characteristics of each property are self-documenting.
+ ///
+ [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
+ public sealed class ReqIfPropertyAttribute : Attribute
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ ///
+ /// The that specifies whether the property references or owns its value(s).
+ ///
+ ///
+ /// The lower bound (minimum multiplicity) of the property.
+ ///
+ ///
+ /// The upper bound (maximum multiplicity) of the property. Use for unbounded.
+ ///
+ ///
+ /// A value indicating whether the values of a multivalued property are ordered.
+ ///
+ ///
+ /// A value indicating whether the property is read-only.
+ ///
+ ///
+ /// A value indicating whether the property is derived (its value is computed from other values).
+ ///
+ ///
+ /// A value indicating whether the property is a derived union.
+ ///
+ ///
+ /// A value indicating whether the values of a multivalued property are unique.
+ ///
+ ///
+ /// The default value of the property, if any.
+ ///
+ public ReqIfPropertyAttribute(AggregationKind aggregation = AggregationKind.None, int lowerValue = 1, int upperValue = 1,
+ bool isOrdered = false,
+ bool isReadOnly = false,
+ bool isDerived = false,
+ bool isDerivedUnion = false,
+ bool isUnique = true,
+ string defaultValue = null)
+ {
+ this.Aggregation = aggregation;
+ this.LowerValue = lowerValue;
+ this.UpperValue = upperValue;
+ this.IsOrdered = isOrdered;
+ this.IsReadOnly = isReadOnly;
+ this.IsDerived = isDerived;
+ this.IsDerivedUnion = isDerivedUnion;
+ this.IsUnique = isUnique;
+ this.DefaultValue = defaultValue;
+ }
+
+ ///
+ /// Gets or sets the .
+ ///
+ public AggregationKind Aggregation { get; set; }
+
+ ///
+ /// Gets or sets the lower bound (minimum multiplicity) of the property.
+ ///
+ public int LowerValue { get; set; }
+
+ ///
+ /// Gets or sets the upper bound (maximum multiplicity) of the property.
+ ///
+ public int UpperValue { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the values of a multivalued property are ordered.
+ ///
+ public bool IsOrdered { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the property is read-only.
+ ///
+ public bool IsReadOnly { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the property is derived.
+ ///
+ public bool IsDerived { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the property is a derived union.
+ ///
+ public bool IsDerivedUnion { get; set; }
+
+ ///
+ /// Gets or sets a value indicating whether the values of a multivalued property are unique.
+ ///
+ public bool IsUnique { get; set; }
+
+ ///
+ /// Gets or sets the default value of the property, if any.
+ ///
+ public string DefaultValue { get; set; }
+ }
+}
diff --git a/ReqIFSharp/Identifiable.cs b/ReqIFSharp/Identifiable.cs
index 193f2e6..ac22ba2 100644
--- a/ReqIFSharp/Identifiable.cs
+++ b/ReqIFSharp/Identifiable.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// The Abstract base class provides an identification concept for elements.
///
+ [ReqIfClass(name: "IDENTIFIABLE", isAbstract: true)]
public abstract class Identifiable
{
///
@@ -77,6 +78,7 @@ protected Identifiable(ILoggerFactory loggerFactory)
///
/// Gets or sets the optional additional description for the information element.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Description { get; set; }
///
@@ -85,6 +87,7 @@ protected Identifiable(ILoggerFactory loggerFactory)
///
/// The value of the identifier must be a well-formed xsd:ID.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Identifier { get; set; }
///
@@ -95,16 +98,19 @@ protected Identifiable(ILoggerFactory loggerFactory)
///
/// date time formatting: 2005-03-04T10:24:18+01:00 (MET time zone).
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DateTime LastChange { get; set; }
///
/// Gets or sets the human-readable name for the information element.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string LongName { get; set; }
///
/// Gets or sets optional alternative identification element.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public AlternativeId AlternativeId { get; set; }
///
diff --git a/ReqIFSharp/ReqIF.cs b/ReqIFSharp/ReqIF.cs
index 358bb04..1685ce0 100644
--- a/ReqIFSharp/ReqIF.cs
+++ b/ReqIFSharp/ReqIF.cs
@@ -31,6 +31,7 @@ namespace ReqIFSharp
///
/// The class constitutes the root element of a ReqIF Exchange Document.
///
+ [ReqIfClass(name: "REQ-IF", isAbstract: false)]
public class ReqIF
{
///
@@ -73,16 +74,19 @@ internal ReqIF(ILoggerFactory loggerFactory)
///
/// Gets the mandatory Exchange Document header, which contains metadata relevant for this exchange.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public ReqIFHeader TheHeader { get; set; }
///
/// Gets the mandatory Exchange Document content.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public ReqIFContent CoreContent { get; set; }
///
/// Gets the optional Exchange Document content based on tool extensions, if such extensions and content are present.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List ToolExtension { get; set; } = new List();
///
@@ -91,6 +95,7 @@ internal ReqIF(ILoggerFactory loggerFactory)
///
/// The format is defined by the standard for specifying languages in XML documents proposed by the W3C
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Lang { get; set; }
///
diff --git a/ReqIFSharp/ReqIFContent.cs b/ReqIFSharp/ReqIFContent.cs
index 00669bc..b06aebf 100644
--- a/ReqIFSharp/ReqIFContent.cs
+++ b/ReqIFSharp/ReqIFContent.cs
@@ -32,6 +32,7 @@ namespace ReqIFSharp
///
/// The class represents the mandatory content of a ReqIF Exchange Document.
///
+ [ReqIfClass(name: "REQ-IF-CONTENT", isAbstract: false)]
public class ReqIFContent
{
///
@@ -98,31 +99,37 @@ internal ReqIFContent(ILoggerFactory loggerFactory)
///
/// Gets the s
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List DataTypes => this.dataTypes;
///
/// Gets the s
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecTypes => this.specTypes;
///
/// Gets the
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecObjects => this.specObjects;
///
/// Gets the
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecRelations => this.specRelations;
///
/// Gets the
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List Specifications => this.specifications;
///
/// Gets the
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecRelationGroups => this.specRelationGroups;
///
diff --git a/ReqIFSharp/ReqIFHeader.cs b/ReqIFSharp/ReqIFHeader.cs
index 179d6d2..a533dfa 100644
--- a/ReqIFSharp/ReqIFHeader.cs
+++ b/ReqIFSharp/ReqIFHeader.cs
@@ -34,6 +34,7 @@ namespace ReqIFSharp
///
/// Meta-information held in the element is applicable to the Exchange Document as a whole.
///
+ [ReqIfClass(name: "REQ-IF-HEADER", isAbstract: false)]
public class ReqIFHeader
{
///
@@ -63,6 +64,7 @@ internal ReqIFHeader(ILoggerFactory loggerFactory)
///
/// Gets or sets an optional comment associated with the Exchange Document as a whole
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Comment { get; set; }
///
@@ -74,6 +76,7 @@ internal ReqIFHeader(ILoggerFactory loggerFactory)
///
/// Example: 2005-03-04T10:24:18+01:00 (MET time zone).
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public DateTime CreationTime { get; set; }
///
@@ -82,26 +85,31 @@ internal ReqIFHeader(ILoggerFactory loggerFactory)
///
/// Examples for repositoryID: databaseId, URL.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string RepositoryId { get; set; }
///
/// Gets or sets the identifier of the exporting "ReqIF" tool.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string ReqIFToolId { get; set; }
///
/// Gets or sets the ReqIF interchange format and protocol version
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string ReqIFVersion { get; set; }
///
/// Gets or sets the identifier of the exporting requirements management tool
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string SourceToolId { get; set; }
///
/// Gets or sets the title of the Exchange Document.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Title { get; set; }
///
@@ -110,6 +118,7 @@ internal ReqIFHeader(ILoggerFactory loggerFactory)
///
/// The value of the identifier is of the XML Schema data type “xsd::ID”
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string Identifier { get; set; }
///
diff --git a/ReqIFSharp/ReqIFToolExtension.cs b/ReqIFSharp/ReqIFToolExtension.cs
index 106732d..03c309a 100644
--- a/ReqIFSharp/ReqIFToolExtension.cs
+++ b/ReqIFSharp/ReqIFToolExtension.cs
@@ -29,6 +29,7 @@ namespace ReqIFSharp
///
/// The class allows the optional inclusion of tool-specific information into a ReqIF Exchange Document.
///
+ [ReqIfClass(name: "REQ-IF-TOOL-EXTENSION", isAbstract: false)]
public class ReqIFToolExtension
{
///
@@ -51,6 +52,7 @@ internal ReqIFToolExtension(ILoggerFactory loggerFactory)
///
/// Gets or sets the InnerXml of the
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public string InnerXml { get; set; }
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/RelationGroup.cs b/ReqIFSharp/SpecElementWithAttributes/RelationGroup.cs
index a52b82b..6194d46 100644
--- a/ReqIFSharp/SpecElementWithAttributes/RelationGroup.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/RelationGroup.cs
@@ -40,6 +40,7 @@ namespace ReqIFSharp
///
/// a instance may represent a set of relations between a customer requirements and a system requirements .
///
+ [ReqIfClass(name: "RELATION-GROUP", isAbstract: false)]
public class RelationGroup : SpecElementWithAttributes
{
///
@@ -93,21 +94,25 @@ internal RelationGroup(ReqIFContent reqIfContent, ILoggerFactory loggerFactory)
///
/// Gets or sets the reference
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public RelationGroupType Type { get; set; }
///
/// Gets or sets the that contains instances that are source objects of the relations.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public Specification SourceSpecification { get; set; }
///
/// Gets or sets the that contains instances that are target objects of the relations.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public Specification TargetSpecification { get; set; }
///
/// Gets the grouped s
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecRelations => this.specRelations;
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/SpecElementWithAttributes.cs b/ReqIFSharp/SpecElementWithAttributes/SpecElementWithAttributes.cs
index 6fb8099..0c72b84 100644
--- a/ReqIFSharp/SpecElementWithAttributes/SpecElementWithAttributes.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/SpecElementWithAttributes.cs
@@ -37,6 +37,7 @@ namespace ReqIFSharp
/// While this class aggregates the values of the attributes, the association to the attributes’ types that define the acceptable
/// values for the attributes is realized by concrete sub classes of this class.
///
+ [ReqIfClass(name: "SPEC-ELEMENT-WITH-ATTRIBUTES", isAbstract: true)]
public abstract class SpecElementWithAttributes : Identifiable
{
///
@@ -89,6 +90,7 @@ protected SpecElementWithAttributes(ReqIFContent reqIfContent, ILoggerFactory lo
///
/// Gets the values of the attributes owned by the element.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List Values => this.values;
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/SpecHierarchy.cs b/ReqIFSharp/SpecElementWithAttributes/SpecHierarchy.cs
index 24db3d2..bcdcad8 100644
--- a/ReqIFSharp/SpecElementWithAttributes/SpecHierarchy.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/SpecHierarchy.cs
@@ -39,6 +39,7 @@ namespace ReqIFSharp
/// The tree is created by references of instances to other instances.
/// Each node has additionally a reference to a resulting in a hierarchical structure of s
///
+ [ReqIfClass(name: "SPEC-HIERARCHY", isAbstract: false)]
public class SpecHierarchy : AccessControlledElement
{
///
@@ -129,16 +130,19 @@ internal SpecHierarchy(SpecHierarchy container, Specification root, ReqIFContent
///
/// Gets the Down links to next level of owned SpecHierarchy.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List Children => this.children;
///
/// Gets the attributes whose values are editable for the by a tool user
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List EditableAtts => this.editableAtts;
///
/// Gets or sets the reference to the associated
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecObject Object { get; set; }
///
@@ -151,6 +155,7 @@ internal SpecHierarchy(SpecHierarchy container, Specification root, ReqIFContent
/// The root node of the table hierarchy is related to the SpecObject element that is the root of the table by the object
/// association.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 0, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public bool IsTableInternal { get; set; }
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/SpecObject.cs b/ReqIFSharp/SpecElementWithAttributes/SpecObject.cs
index 3427b79..287fc38 100644
--- a/ReqIFSharp/SpecElementWithAttributes/SpecObject.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/SpecObject.cs
@@ -38,6 +38,7 @@ namespace ReqIFSharp
/// The instance itself does not carry the requirements text or any other user defined content.
/// This data is stored in instances that are associated to the instance.
///
+ [ReqIfClass(name: "SPEC-OBJECT", isAbstract: false)]
public class SpecObject : SpecElementWithAttributes
{
///
@@ -85,6 +86,7 @@ internal SpecObject(ReqIFContent reqIfContent, ILoggerFactory loggerFactory)
///
/// Gets or sets the reference.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecObjectType Type { get; set; }
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/SpecRelation.cs b/ReqIFSharp/SpecElementWithAttributes/SpecRelation.cs
index 4fed31c..dd99d62 100644
--- a/ReqIFSharp/SpecElementWithAttributes/SpecRelation.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/SpecRelation.cs
@@ -33,6 +33,7 @@ namespace ReqIFSharp
///
/// Defines relations (links) between two instances.
///
+ [ReqIfClass(name: "SPEC-RELATION", isAbstract: false)]
public class SpecRelation : SpecElementWithAttributes
{
///
@@ -80,16 +81,19 @@ internal SpecRelation(ReqIFContent reqIfContent, ILoggerFactory loggerFactory)
///
/// Gets or sets the Source object of the relationship.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecObject Source { get; set; }
///
/// Gets or sets the Target object of the relationship.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecObject Target { get; set; }
///
/// Gets or sets the of the relationship
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecRelationType Type { get; set; }
///
diff --git a/ReqIFSharp/SpecElementWithAttributes/Specification.cs b/ReqIFSharp/SpecElementWithAttributes/Specification.cs
index f34f575..d6c7a05 100644
--- a/ReqIFSharp/SpecElementWithAttributes/Specification.cs
+++ b/ReqIFSharp/SpecElementWithAttributes/Specification.cs
@@ -35,6 +35,7 @@ namespace ReqIFSharp
/// Represents a hierarchically structured requirements specification.
/// It is the root node of the tree that hierarchically structures instances.
///
+ [ReqIfClass(name: "SPECIFICATION", isAbstract: false)]
public class Specification : SpecElementWithAttributes
{
///
@@ -78,11 +79,13 @@ internal Specification(ReqIFContent reqIfContent, ILoggerFactory loggerFactory)
///
/// Gets the links to next level of owned SpecHierarchy.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List Children => this.children;
///
/// Gets or sets the reference.
///
+ [ReqIfProperty(aggregation: AggregationKind.None, lowerValue: 1, upperValue: 1, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public SpecificationType Type { get; set; }
///
diff --git a/ReqIFSharp/SpecType/RelationGroupType.cs b/ReqIFSharp/SpecType/RelationGroupType.cs
index 97877b9..08e2f87 100644
--- a/ReqIFSharp/SpecType/RelationGroupType.cs
+++ b/ReqIFSharp/SpecType/RelationGroupType.cs
@@ -29,6 +29,7 @@ namespace ReqIFSharp
/// Inherits a set of attribute definitions from . By using elements, elements can
/// be associated with attribute names, default values, data types, etc.
///
+ [ReqIfClass(name: "RELATION-GROUP-TYPE", isAbstract: false)]
public class RelationGroupType : SpecType
{
///
diff --git a/ReqIFSharp/SpecType/SpecObjectType.cs b/ReqIFSharp/SpecType/SpecObjectType.cs
index b7d54c9..aeca3f1 100644
--- a/ReqIFSharp/SpecType/SpecObjectType.cs
+++ b/ReqIFSharp/SpecType/SpecObjectType.cs
@@ -27,6 +27,7 @@ namespace ReqIFSharp
/// Inherits a set of attribute definitions from SpecType. By using SpecObjectType elements, multiple requirements can be
/// associated with the same set of attribute definitions (attribute names, default values, data types, etc.).
///
+ [ReqIfClass(name: "SPEC-OBJECT-TYPE", isAbstract: false)]
public class SpecObjectType : SpecType
{
///
diff --git a/ReqIFSharp/SpecType/SpecRelationType.cs b/ReqIFSharp/SpecType/SpecRelationType.cs
index 538b441..8ce7a91 100644
--- a/ReqIFSharp/SpecType/SpecRelationType.cs
+++ b/ReqIFSharp/SpecType/SpecRelationType.cs
@@ -27,6 +27,7 @@ namespace ReqIFSharp
/// Inherits a set of attribute definitions from SpecType. By using SpecObjectType elements, multiple requirements can be
/// associated with the same set of attribute definitions (attribute names, default values, data types, etc.).
///
+ [ReqIfClass(name: "SPEC-RELATION-TYPE", isAbstract: false)]
public class SpecRelationType : SpecType
{
///
diff --git a/ReqIFSharp/SpecType/SpecType.cs b/ReqIFSharp/SpecType/SpecType.cs
index b57e7d5..765c0f4 100644
--- a/ReqIFSharp/SpecType/SpecType.cs
+++ b/ReqIFSharp/SpecType/SpecType.cs
@@ -33,6 +33,7 @@ namespace ReqIFSharp
/// Contains a set of attribute definitions. By using an instance of a subclass of , multiple elements can be
/// associated with the same set of attribute definitions (attribute names, default values, data types, etc.).
///
+ [ReqIfClass(name: "SPEC-TYPE", isAbstract: true)]
public abstract class SpecType : Identifiable
{
///
@@ -91,6 +92,7 @@ protected SpecType(ReqIFContent reqIfContent, ILoggerFactory loggerFactory)
///
/// Gets the set of attribute definitions.
///
+ [ReqIfProperty(aggregation: AggregationKind.Composite, lowerValue: 0, upperValue: int.MaxValue, isOrdered: false, isReadOnly: false, isDerived: false, isDerivedUnion: false, isUnique: true, defaultValue: null)]
public List SpecAttributes => this.specAttributes;
///
diff --git a/ReqIFSharp/SpecType/SpecificationType.cs b/ReqIFSharp/SpecType/SpecificationType.cs
index 004ede7..bd7c00f 100644
--- a/ReqIFSharp/SpecType/SpecificationType.cs
+++ b/ReqIFSharp/SpecType/SpecificationType.cs
@@ -27,6 +27,7 @@ namespace ReqIFSharp
/// Inherits a set of attribute definitions from SpecType. By using SpecificationType elements, multiple specifications can be
/// associated with the same set of attribute definitions (attribute names, default values, data types, etc.).
///
+ [ReqIfClass(name: "SPECIFICATION-TYPE", isAbstract: false)]
public class SpecificationType : SpecType
{
///