| | 1 | | using System.Diagnostics.CodeAnalysis; |
| | 2 | | using System.Text.Json.Serialization; |
| | 3 | | using Spdx3.Model.Lite; |
| | 4 | | using Spdx3.Model.SimpleLicensing.Classes; |
| | 5 | | using Spdx3.Serialization; |
| | 6 | | using Spdx3.Utility; |
| | 7 | |
|
| | 8 | | namespace Spdx3.Model.Core.Classes; |
| | 9 | |
|
| | 10 | | /// <summary> |
| | 11 | | /// A collection of SPDX Elements that could potentially be serialized. |
| | 12 | | /// See https://spdx.github.io/spdx-spec/v3.0.1/model/Core/Classes/SpdxDocument/ |
| | 13 | | /// </summary> |
| | 14 | | public class SpdxDocument : ElementCollection, ILiteDomainCompliantElement |
| | 15 | | { |
| | 16 | | [JsonPropertyName("dataLicense")] |
| | 17 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 16 | 18 | | public AnyLicenseInfo? DataLicense { get; set; } |
| | 19 | |
|
| | 20 | | [JsonPropertyName("import")] |
| | 21 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 32 | 22 | | public IList<ExternalMap> Import { get; } = new List<ExternalMap>(); |
| | 23 | |
|
| | 24 | | [JsonPropertyName("namespaceMap")] |
| | 25 | | [JsonConverter(typeof(SpdxModelConverterFactory))] |
| 36 | 26 | | public IList<NamespaceMap> NamespaceMap { get; } = new List<NamespaceMap>(); |
| | 27 | |
|
| | 28 | | // protected internal no-parm constructor required for deserialization |
| | 29 | | // ReSharper disable once UnusedMember.Global |
| 5 | 30 | | protected internal SpdxDocument() |
| | 31 | | { |
| 5 | 32 | | } |
| | 33 | |
|
| | 34 | | [SetsRequiredMembers] |
| 10 | 35 | | public SpdxDocument(Catalog catalog, CreationInfo creationInfo) : base(catalog, creationInfo) |
| | 36 | | { |
| 10 | 37 | | } |
| | 38 | |
|
| | 39 | | public void Accept(ILiteDomainComplianceVisitor visitor) |
| | 40 | | { |
| 3 | 41 | | visitor.Visit(this); |
| 3 | 42 | | } |
| | 43 | | } |