From b1ba8bd5af2f860bfd3ba2531ed3f61111ab4cf7 Mon Sep 17 00:00:00 2001 From: samatstarion Date: Sun, 17 Nov 2024 15:18:51 +0100 Subject: [PATCH] [Cleanup] using statements and at lineinfo for notsupported xml elements --- .../Classification/GeneralizationReader.cs | 7 ++++--- .../Classification/InstanceValueReader.cs | 4 ++-- .../Readers/Classification/OperationReader.cs | 7 ++++--- .../Readers/Classification/ParameterReader.cs | 7 ++++--- .../Readers/Classification/PropertyReader.cs | 3 ++- .../Readers/CommonStructure/CommentReader.cs | 11 ++++++----- .../Readers/CommonStructure/ConstraintReader.cs | 16 ++++++++-------- .../CommonStructure/RealizationReader.cs | 12 ++++++------ uml4net.xmi/Readers/Packages/PackageReader.cs | 15 ++++++++------- .../EnumerationLiteralReader.cs | 13 +++++++------ .../SimpleClassifiers/EnumerationReader.cs | 16 ++++++++++------ .../SimpleClassifiers/InterfaceReader.cs | 17 ++++++++--------- .../SimpleClassifiers/PrimitiveTypeReader.cs | 13 ++++++++----- .../StructuredClassifiers/AssociationReader.cs | 17 ++++++++--------- .../StructuredClassifiers/ClassReader.cs | 15 ++++++++------- .../Readers/Values/LiteralBooleanReader.cs | 3 ++- .../Readers/Values/LiteralIntegerReader.cs | 3 ++- .../Values/LiteralUnlimitedNaturalReader.cs | 9 +++++---- .../Readers/Values/OpaqueExpressionReader.cs | 10 ++++++---- 19 files changed, 108 insertions(+), 90 deletions(-) diff --git a/uml4net.xmi/Readers/Classification/GeneralizationReader.cs b/uml4net.xmi/Readers/Classification/GeneralizationReader.cs index ec199909..4e31ec63 100644 --- a/uml4net.xmi/Readers/Classification/GeneralizationReader.cs +++ b/uml4net.xmi/Readers/Classification/GeneralizationReader.cs @@ -23,10 +23,11 @@ namespace uml4net.xmi.Readers.Classification using System.Xml; using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.Classification; - using Cache; - using Readers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of diff --git a/uml4net.xmi/Readers/Classification/InstanceValueReader.cs b/uml4net.xmi/Readers/Classification/InstanceValueReader.cs index affbb816..d06bb39c 100644 --- a/uml4net.xmi/Readers/Classification/InstanceValueReader.cs +++ b/uml4net.xmi/Readers/Classification/InstanceValueReader.cs @@ -28,7 +28,6 @@ namespace uml4net.xmi.Readers.Classification using uml4net.POCO; using uml4net.POCO.Classification; using uml4net.POCO.CommonStructure; - using uml4net.POCO.Values; using uml4net.xmi.Cache; using uml4net.xmi.Readers; @@ -119,7 +118,8 @@ public override IInstanceValue Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"InstanceValueReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"InstanceValueReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Classification/OperationReader.cs b/uml4net.xmi/Readers/Classification/OperationReader.cs index ead68c44..3968b607 100644 --- a/uml4net.xmi/Readers/Classification/OperationReader.cs +++ b/uml4net.xmi/Readers/Classification/OperationReader.cs @@ -20,8 +20,8 @@ namespace uml4net.xmi.Readers.Classification { - using Cache; using System; + using System.Collections.Generic; using System.Xml; using Microsoft.Extensions.Logging; @@ -29,8 +29,8 @@ namespace uml4net.xmi.Readers.Classification using uml4net.POCO; using uml4net.POCO.Classification; using uml4net.POCO.CommonStructure; + using uml4net.xmi.Cache; using uml4net.xmi.Readers; - using System.Collections.Generic; /// /// The purpose of the is to read an instance of @@ -179,7 +179,8 @@ public override IOperation Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"OperationReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"OperationReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Classification/ParameterReader.cs b/uml4net.xmi/Readers/Classification/ParameterReader.cs index 70de8e46..83ae2627 100644 --- a/uml4net.xmi/Readers/Classification/ParameterReader.cs +++ b/uml4net.xmi/Readers/Classification/ParameterReader.cs @@ -20,7 +20,6 @@ namespace uml4net.xmi.Readers.Classification { - using Cache; using System; using System.Xml; @@ -29,8 +28,9 @@ namespace uml4net.xmi.Readers.Classification using uml4net.POCO; using uml4net.POCO.Classification; using uml4net.POCO.CommonStructure; - using uml4net.xmi.Readers; using uml4net.POCO.Values; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -206,7 +206,8 @@ public override IParameter Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"ParameterReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"ParameterReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Classification/PropertyReader.cs b/uml4net.xmi/Readers/Classification/PropertyReader.cs index 87373b71..cbf69d11 100644 --- a/uml4net.xmi/Readers/Classification/PropertyReader.cs +++ b/uml4net.xmi/Readers/Classification/PropertyReader.cs @@ -318,7 +318,8 @@ public override IProperty Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"PropertyReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"PropertyReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/CommonStructure/CommentReader.cs b/uml4net.xmi/Readers/CommonStructure/CommentReader.cs index a34ddb69..3922aa08 100644 --- a/uml4net.xmi/Readers/CommonStructure/CommentReader.cs +++ b/uml4net.xmi/Readers/CommonStructure/CommentReader.cs @@ -20,15 +20,16 @@ namespace uml4net.xmi.Readers.CommonStructure { + using System; + using System.Linq; using System.Xml; using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; - using Cache; - using Readers; - using System; - using System.Linq; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of diff --git a/uml4net.xmi/Readers/CommonStructure/ConstraintReader.cs b/uml4net.xmi/Readers/CommonStructure/ConstraintReader.cs index dd2d09e3..22a4956f 100644 --- a/uml4net.xmi/Readers/CommonStructure/ConstraintReader.cs +++ b/uml4net.xmi/Readers/CommonStructure/ConstraintReader.cs @@ -20,18 +20,17 @@ namespace uml4net.xmi.Readers.CommonStructure { - using Cache; using System; + using System.Collections.Generic; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.Values; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; - - using Readers; - using System.Collections.Generic; - using uml4net.POCO.StructuredClassifiers; + using uml4net.POCO.Values; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -133,7 +132,8 @@ public override IConstraint Read(XmlReader xmlReader) this.ReadValueSpecification(constraint, xmlReader); break; default: - throw new NotImplementedException($"ConstraintReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"ConstraintReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/CommonStructure/RealizationReader.cs b/uml4net.xmi/Readers/CommonStructure/RealizationReader.cs index a7e2e680..a16ea3c9 100644 --- a/uml4net.xmi/Readers/CommonStructure/RealizationReader.cs +++ b/uml4net.xmi/Readers/CommonStructure/RealizationReader.cs @@ -20,16 +20,16 @@ namespace uml4net.xmi.Readers.CommonStructure { + using System; + using System.Linq; using System.Xml; using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; - using Cache; - using Readers; - using System; - using System.Collections.Generic; - using System.Linq; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of diff --git a/uml4net.xmi/Readers/Packages/PackageReader.cs b/uml4net.xmi/Readers/Packages/PackageReader.cs index 676c1b93..f41ed54c 100644 --- a/uml4net.xmi/Readers/Packages/PackageReader.cs +++ b/uml4net.xmi/Readers/Packages/PackageReader.cs @@ -20,18 +20,18 @@ namespace uml4net.xmi.Readers.Packages { - using Cache; using System; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.SimpleClassifiers; - using POCO.StructuredClassifiers; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; using uml4net.POCO.Packages; - - using Readers; + using uml4net.POCO.SimpleClassifiers; + using uml4net.POCO.StructuredClassifiers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -173,7 +173,8 @@ public override IPackage Read(XmlReader xmlReader) this.ReadPackagedElements(package, xmlReader); break; default: - throw new NotImplementedException($"PackageReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"PackageReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/SimpleClassifiers/EnumerationLiteralReader.cs b/uml4net.xmi/Readers/SimpleClassifiers/EnumerationLiteralReader.cs index f054eb01..576be696 100644 --- a/uml4net.xmi/Readers/SimpleClassifiers/EnumerationLiteralReader.cs +++ b/uml4net.xmi/Readers/SimpleClassifiers/EnumerationLiteralReader.cs @@ -20,16 +20,16 @@ namespace uml4net.xmi.Readers.SimpleClassifiers { - using Cache; using System; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.CommonStructure; - using POCO; - using uml4net.POCO.SimpleClassifiers; - using Readers; + using uml4net.POCO; + using uml4net.POCO.CommonStructure; + using uml4net.POCO.SimpleClassifiers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -100,7 +100,8 @@ public override IEnumerationLiteral Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"EnumerationLiteralReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"EnumerationLiteralReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/SimpleClassifiers/EnumerationReader.cs b/uml4net.xmi/Readers/SimpleClassifiers/EnumerationReader.cs index b9cb4209..d92170f9 100644 --- a/uml4net.xmi/Readers/SimpleClassifiers/EnumerationReader.cs +++ b/uml4net.xmi/Readers/SimpleClassifiers/EnumerationReader.cs @@ -20,14 +20,17 @@ namespace uml4net.xmi.Readers.SimpleClassifiers { + using System; + using System.Collections.Generic; + using System.Xml; + using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; using uml4net.POCO.SimpleClassifiers; - using Cache; - using Readers; - using System; - using System.Xml; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -110,7 +113,8 @@ public override IEnumeration Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"EnumerationReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"EnumerationReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/SimpleClassifiers/InterfaceReader.cs b/uml4net.xmi/Readers/SimpleClassifiers/InterfaceReader.cs index 31798501..58fb2928 100644 --- a/uml4net.xmi/Readers/SimpleClassifiers/InterfaceReader.cs +++ b/uml4net.xmi/Readers/SimpleClassifiers/InterfaceReader.cs @@ -20,19 +20,17 @@ namespace uml4net.xmi.Readers.SimpleClassifiers { - using Cache; using System; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.Classification; - using POCO; - using uml4net.POCO.CommonStructure; - using uml4net.POCO.Packages; - using Packages; - using POCO.SimpleClassifiers; - using Readers; + using uml4net.POCO; + using uml4net.POCO.Classification; + using uml4net.POCO.CommonStructure; + using uml4net.POCO.SimpleClassifiers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -157,7 +155,8 @@ public override IInterface Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"InterfaceReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"InterfaceReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/SimpleClassifiers/PrimitiveTypeReader.cs b/uml4net.xmi/Readers/SimpleClassifiers/PrimitiveTypeReader.cs index a35ad4cc..cf848b17 100644 --- a/uml4net.xmi/Readers/SimpleClassifiers/PrimitiveTypeReader.cs +++ b/uml4net.xmi/Readers/SimpleClassifiers/PrimitiveTypeReader.cs @@ -20,14 +20,16 @@ namespace uml4net.xmi.Readers.SimpleClassifiers { + using System; + using System.Xml; + using Microsoft.Extensions.Logging; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; using uml4net.POCO.SimpleClassifiers; using uml4net.xmi.Cache; - - using POCO; - using System.Xml; - using System; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -98,7 +100,8 @@ public override IPrimitiveType Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"PrimitiveTypeReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"PrimitiveTypeReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/StructuredClassifiers/AssociationReader.cs b/uml4net.xmi/Readers/StructuredClassifiers/AssociationReader.cs index 0694c73e..1fcc10f7 100644 --- a/uml4net.xmi/Readers/StructuredClassifiers/AssociationReader.cs +++ b/uml4net.xmi/Readers/StructuredClassifiers/AssociationReader.cs @@ -20,20 +20,18 @@ namespace uml4net.xmi.Readers.StructuredClassifiers { - using Cache; using System; + using System.Collections.Generic; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.Classification; - using POCO; + + using uml4net.POCO; + using uml4net.POCO.Classification; using uml4net.POCO.CommonStructure; using uml4net.POCO.StructuredClassifiers; - using uml4net.POCO.Packages; - - using Packages; - using Readers; - using System.Collections.Generic; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -182,7 +180,8 @@ public override IAssociation Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"ClassReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"AssociationReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/StructuredClassifiers/ClassReader.cs b/uml4net.xmi/Readers/StructuredClassifiers/ClassReader.cs index 5947bb83..6ff78635 100644 --- a/uml4net.xmi/Readers/StructuredClassifiers/ClassReader.cs +++ b/uml4net.xmi/Readers/StructuredClassifiers/ClassReader.cs @@ -20,19 +20,19 @@ namespace uml4net.xmi.Readers.StructuredClassifiers { - using Cache; using System; using System.Xml; using Microsoft.Extensions.Logging; - using POCO.Classification; - using POCO; + + using uml4net.POCO; + using uml4net.POCO.Classification; using uml4net.POCO.CommonStructure; using uml4net.POCO.StructuredClassifiers; using uml4net.POCO.Packages; - - using Packages; - using Readers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers.Packages; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -163,7 +163,8 @@ public override IClass Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"ClassReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"ClassReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Values/LiteralBooleanReader.cs b/uml4net.xmi/Readers/Values/LiteralBooleanReader.cs index d05e1863..5530fe4c 100644 --- a/uml4net.xmi/Readers/Values/LiteralBooleanReader.cs +++ b/uml4net.xmi/Readers/Values/LiteralBooleanReader.cs @@ -104,7 +104,8 @@ public override ILiteralBoolean Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"LiteralIntegerReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"LiteralBooleanReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Values/LiteralIntegerReader.cs b/uml4net.xmi/Readers/Values/LiteralIntegerReader.cs index 563095c2..287ef1bc 100644 --- a/uml4net.xmi/Readers/Values/LiteralIntegerReader.cs +++ b/uml4net.xmi/Readers/Values/LiteralIntegerReader.cs @@ -104,7 +104,8 @@ public override ILiteralInteger Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"LiteralIntegerReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"LiteralIntegerReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Values/LiteralUnlimitedNaturalReader.cs b/uml4net.xmi/Readers/Values/LiteralUnlimitedNaturalReader.cs index aa835130..2a7fe286 100644 --- a/uml4net.xmi/Readers/Values/LiteralUnlimitedNaturalReader.cs +++ b/uml4net.xmi/Readers/Values/LiteralUnlimitedNaturalReader.cs @@ -25,11 +25,11 @@ namespace uml4net.xmi.Readers.Values using Microsoft.Extensions.Logging; - using POCO; + using uml4net.POCO; using uml4net.POCO.CommonStructure; using uml4net.POCO.Values; - using Cache; - using Readers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -109,7 +109,8 @@ public override ILiteralUnlimitedNatural Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"LiteralIntegerReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"LiteralUnlimitedNaturalReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } } diff --git a/uml4net.xmi/Readers/Values/OpaqueExpressionReader.cs b/uml4net.xmi/Readers/Values/OpaqueExpressionReader.cs index 0b648427..c0cbe4bf 100644 --- a/uml4net.xmi/Readers/Values/OpaqueExpressionReader.cs +++ b/uml4net.xmi/Readers/Values/OpaqueExpressionReader.cs @@ -24,11 +24,12 @@ namespace uml4net.xmi.Readers.Values using System.Xml; using Microsoft.Extensions.Logging; - using POCO; + + using uml4net.POCO; using uml4net.POCO.CommonStructure; using uml4net.POCO.Values; - using Cache; - using Readers; + using uml4net.xmi.Cache; + using uml4net.xmi.Readers; /// /// The purpose of the is to read an instance of @@ -104,7 +105,8 @@ public override IOpaqueExpression Read(XmlReader xmlReader) } break; default: - throw new NotImplementedException($"OpaqueExpressionReader: {xmlReader.LocalName}"); + var defaultLineInfo = xmlReader as IXmlLineInfo; + throw new NotImplementedException($"OpaqueExpressionReader: {xmlReader.LocalName} at line:position {defaultLineInfo.LineNumber}:{defaultLineInfo.LinePosition}"); } } }