diff --git a/MtconnectTranspiler/Contracts/XmlHelper.cs b/MtconnectTranspiler/Contracts/XmlHelper.cs index 3c42793..34e216b 100644 --- a/MtconnectTranspiler/Contracts/XmlHelper.cs +++ b/MtconnectTranspiler/Contracts/XmlHelper.cs @@ -170,6 +170,14 @@ public class UmlStructure /// <ownedAttribute xmi:type='uml:Property' /> /// public const string Property = "uml:Property"; + /// + /// <ownedAttribute xmi:type='uml:AssociationClass' /> + /// + public const string AssociationClass = "uml:AssociationClass"; + /// + /// <ownedAttribute xmi:type='uml:Association' /> + /// + public const string Association = "uml:Association"; #endregion } } diff --git a/MtconnectTranspiler/MtconnectTranspiler.csproj b/MtconnectTranspiler/MtconnectTranspiler.csproj index 78e1fb2..c8069c9 100644 --- a/MtconnectTranspiler/MtconnectTranspiler.csproj +++ b/MtconnectTranspiler/MtconnectTranspiler.csproj @@ -6,7 +6,7 @@ enable True MTConnect Transpiler - 1.0.6 + 1.0.7 mtconnect, tbm0115 MTConnect Institute; TAMS; A library capable of parsing an XMI for the MTConnect Standard and passing it to an implemented transpiler. diff --git a/MtconnectTranspiler/Xmi/UML/UmlAssociation.cs b/MtconnectTranspiler/Xmi/UML/UmlAssociation.cs new file mode 100644 index 0000000..e8cbc4e --- /dev/null +++ b/MtconnectTranspiler/Xmi/UML/UmlAssociation.cs @@ -0,0 +1,21 @@ +using MtconnectTranspiler.Contracts; +using System; +using System.Xml.Serialization; + +namespace MtconnectTranspiler.Xmi.UML +{ + /// + /// where xmi:type='uml:Association' + /// + [Serializable, XmlRoot(ElementName = XmlHelper.XmiStructure.PACKAGED_ELEMENT, Namespace = "")] + public class UmlAssociation : PackagedElement + { + /// + /// Collection of + /// + [XmlElement(ElementName = XmlHelper.XmiStructure.MEMBER_END, Namespace = "")] + public MemberEnd[]? MemberEnds { get; set; } + + // TODO: Add + } +} \ No newline at end of file diff --git a/MtconnectTranspiler/Xmi/UML/UmlAssociationClass.cs b/MtconnectTranspiler/Xmi/UML/UmlAssociationClass.cs new file mode 100644 index 0000000..68dc527 --- /dev/null +++ b/MtconnectTranspiler/Xmi/UML/UmlAssociationClass.cs @@ -0,0 +1,19 @@ +using MtconnectTranspiler.Contracts; +using System; +using System.Xml.Serialization; + +namespace MtconnectTranspiler.Xmi.UML +{ + /// + /// where xmi:type='uml:AssociationClass' + /// + [Serializable, XmlRoot(ElementName = XmlHelper.XmiStructure.PACKAGED_ELEMENT, Namespace = "")] + public class UmlAssociationClass : UmlClass + { + /// + /// Collection of + /// + [XmlElement(ElementName = XmlHelper.XmiStructure.MEMBER_END, Namespace = "")] + public MemberEnd[]? MemberEnds { get; set; } + } +} \ No newline at end of file diff --git a/MtconnectTranspiler/Xmi/UML/UmlPackage.cs b/MtconnectTranspiler/Xmi/UML/UmlPackage.cs index 944cc72..f8aaf31 100644 --- a/MtconnectTranspiler/Xmi/UML/UmlPackage.cs +++ b/MtconnectTranspiler/Xmi/UML/UmlPackage.cs @@ -26,6 +26,8 @@ public class UmlPackage : PackagedElement /// <packagedElement xmi:type='uml:Stereotype' /> /// <packagedElement xmi:type='uml:Extension' /> /// <packagedElement xmi:type='uml:Package' /> + /// <packagedElement xmi:type='uml:Association' /> + /// <packagedElement xmi:type='uml:AssociationClass' /> /// /// [XmlAnyElement(XmlHelper.XmiStructure.PACKAGED_ELEMENT, Namespace = "")] @@ -97,6 +99,27 @@ public class UmlPackage : PackagedElement [XmlIgnore] public PackagedElementCollection DataTypes => _dataTypes ??= PackagedElementCollection.Deserialize(PackagedElements, XmlHelper.UmlStructure.DataType); + /// + /// Internal switch property for . + /// + [XmlIgnore] + private PackagedElementCollection? _associations; + /// + /// Collection of + /// + [XmlIgnore] + public PackagedElementCollection Associations => _associations ??= PackagedElementCollection.Deserialize(PackagedElements, XmlHelper.UmlStructure.Association); + + /// + /// Internal switch property for . + /// + [XmlIgnore] + private PackagedElementCollection? _associationClasses; + /// + /// Collection of + /// + [XmlIgnore] + public PackagedElementCollection AssociationClasses => _associationClasses ??= PackagedElementCollection.Deserialize(PackagedElements, XmlHelper.UmlStructure.AssociationClass); //// TODO: Add xmi:Extension }