| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Core.Classes; |
| | 4 | | using Spdx3.Model.Lite; |
| | 5 | | using Spdx3.Serialization; |
| | 6 | | using Spdx3.Utility; |
| | 7 | |
|
| | 8 | | namespace Spdx3.Model.SimpleLicensing.Classes; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// A license or addition that is not listed on the SPDX License List. |
| | 12 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/SimpleLicensing/Classes/SimpleLicensingText/ |
| | 13 | | /// </summary> |
| | 14 | | public class SimpleLicensingText : Element, ILiteDomainCompliantElement |
| | 15 | | { |
| | 16 | | [JsonPropertyName("simplelicensing_licenseText")] |
| | 17 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 8 | 18 | | public required string LicenseText { get; set; } |
| | 19 | |
|
| | 20 | | // protected internal no-parm constructor required for deserialization |
| | 21 | | // ReSharper disable once UnusedMember.Global |
| 1 | 22 | | protected internal SimpleLicensingText() |
| | 23 | | { |
| 1 | 24 | | } |
| | 25 | |
|
| | 26 | | [SetsRequiredMembers] |
| 2 | 27 | | public SimpleLicensingText(Catalog catalog, CreationInfo creationInfo, string licenseText) : base(catalog, |
| 2 | 28 | | creationInfo) |
| | 29 | | { |
| 2 | 30 | | LicenseText = licenseText; |
| 2 | 31 | | } |
| | 32 | |
|
| | 33 | | public void Accept(ILiteDomainComplianceVisitor visitor) |
| | 34 | | { |
| 0 | 35 | | visitor.Visit(this); |
| 0 | 36 | | } |
| | 37 | |
|
| | 38 | | public override void Validate() |
| | 39 | | { |
| 3 | 40 | | base.Validate(); |
| 2 | 41 | | ValidateRequiredProperty(nameof(LicenseText)); |
| 2 | 42 | | } |
| | 43 | | } |