Explorar el Código

parse requiredmodels

Martin Kunz hace 9 meses
padre
commit
7f8afa74ab
Se han modificado 1 ficheros con 28 adiciones y 0 borrados
  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']);
+    }
+}