Browse Source

parse requiredmodels

Martin Kunz 1 month ago
parent
commit
7f8afa74ab
1 changed files with 28 additions and 0 deletions
  1. 28 0
      src/ua/UARequiredModel.ts

+ 28 - 0
src/ua/UARequiredModel.ts

@@ -0,0 +1,28 @@
+import { XMLElem, type IToXML } from "@/util/XmlElem";
+
+export class UARequiredModel implements IToXML{
+    constructor(public modelUri: string,
+                public xmlSchemaUri: string,
+                public version: string,
+                public publicationDate: string,
+                public modelVersion: string,
+                public accessRestrictions: string
+                )
+    {
+
+    }
+
+    toXML(): XMLElem {
+        return new XMLElem('RequiredModel')
+                .attr('ModelUri', this.modelUri)
+                .attr('XmlSchemaUri', this.xmlSchemaUri)
+                .attr('Version', this.version)
+                .attr('PublicationDate', this.publicationDate)
+                .attr('ModelVersion', this.modelVersion)
+                .attr('AccessRestrictions', this.accessRestrictions)
+    }
+
+    static fromXML(xmlObject: any): UARequiredModel{
+        return new UARequiredModel(xmlObject['@_ModelUri'], xmlObject['@_XmlSchemaUri'],xmlObject['@_Version'], xmlObject['@_PublicationDate'],  xmlObject['@_ModelVersion'], xmlObject['@_AccessRestrictions']);
+    }
+}