From 56a2261e64796db61af24b68bb92216fdac91147 Mon Sep 17 00:00:00 2001 From: samatstarion Date: Sun, 17 Nov 2024 09:40:34 +0100 Subject: [PATCH] [Update] PackageImportReader --- .../CommonStructure/PackageImportReader.cs | 19 +++++++++++-------- .../POCO/CommonStructure/IPackageImport.cs | 5 ----- uml4net/POCO/CommonStructure/PackageImport.cs | 6 ------ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/uml4net.xmi/Readers/CommonStructure/PackageImportReader.cs b/uml4net.xmi/Readers/CommonStructure/PackageImportReader.cs index fae9d94a..ac26fcc2 100644 --- a/uml4net.xmi/Readers/CommonStructure/PackageImportReader.cs +++ b/uml4net.xmi/Readers/CommonStructure/PackageImportReader.cs @@ -20,14 +20,15 @@ namespace uml4net.xmi.Readers.CommonStructure { - using Cache; using System; using System.Xml; using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; - using Readers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -67,14 +68,16 @@ public override IPackageImport Read(XmlReader xmlReader) packageImport.XmiId = xmlReader.GetAttribute("xmi:id"); var importedPackage = xmlReader.GetAttribute("importedPackage"); - if (importedPackage != null) + if (!string.IsNullOrEmpty(importedPackage)) { - packageImport.ReferencePropertyValueIdentifies.Add("ImportedPackage", importedPackage); + packageImport.SingleValueReferencePropertyIdentifiers.Add("ImportedPackage", importedPackage); } - // TODO: figure out an algorithm to interpret how to set the "importingNamespace" property - this.Logger.LogInformation("TODO: figure out an algorithm to interpret how to set the \"importingNamespace\" property"); - packageImport.ImportingNamespace = null; + var importingNamespace = xmlReader.GetAttribute("importingNamespace"); + if (!string.IsNullOrEmpty(importingNamespace)) + { + packageImport.SingleValueReferencePropertyIdentifiers.Add("ImportingNamespace", importingNamespace); + } string visibility = xmlReader.GetAttribute("visibility"); if (visibility != null) diff --git a/uml4net/POCO/CommonStructure/IPackageImport.cs b/uml4net/POCO/CommonStructure/IPackageImport.cs index 053b17ee..13c20274 100644 --- a/uml4net/POCO/CommonStructure/IPackageImport.cs +++ b/uml4net/POCO/CommonStructure/IPackageImport.cs @@ -33,11 +33,6 @@ namespace uml4net.POCO.CommonStructure /// public interface IPackageImport : IDirectedRelationship { - /// - /// Gets or sets a dictionary of reference properties and the associated unique identifiers - /// - public Dictionary ReferencePropertyValueIdentifies { get; set; } - /// /// Specifies the Package whose members are imported into a Namespace. /// diff --git a/uml4net/POCO/CommonStructure/PackageImport.cs b/uml4net/POCO/CommonStructure/PackageImport.cs index e1eb6152..50007dbd 100644 --- a/uml4net/POCO/CommonStructure/PackageImport.cs +++ b/uml4net/POCO/CommonStructure/PackageImport.cs @@ -36,12 +36,6 @@ namespace uml4net.POCO.CommonStructure /// public class PackageImport : XmiElement, IPackageImport { - /// - /// Gets or sets a dictionary of reference properties and the associated unique identifiers - /// - [Implements(implementation: "IPackageImport.ReferencePropertyValueIdentifiers")] - public Dictionary ReferencePropertyValueIdentifies { get; set; } = new Dictionary(); - /// /// The Comments owned by this Element. ///