UARequiredModel.ts 1.1 KB

12345678910111213141516171819202122232425262728
  1. import { XMLElem, type IToXML } from "@/util/XmlElem";
  2. export class UARequiredModel implements IToXML{
  3. constructor(public modelUri: string,
  4. public xmlSchemaUri: string,
  5. public version: string,
  6. public publicationDate: string,
  7. public modelVersion: string,
  8. public accessRestrictions: string
  9. )
  10. {
  11. }
  12. toXML(): XMLElem {
  13. return new XMLElem('RequiredModel')
  14. .attr('ModelUri', this.modelUri)
  15. .attr('XmlSchemaUri', this.xmlSchemaUri)
  16. .attr('Version', this.version)
  17. .attr('PublicationDate', this.publicationDate)
  18. .attr('ModelVersion', this.modelVersion)
  19. .attr('AccessRestrictions', this.accessRestrictions)
  20. }
  21. static fromXML(xmlObject: any): UARequiredModel{
  22. return new UARequiredModel(xmlObject['@_ModelUri'], xmlObject['@_XmlSchemaUri'],xmlObject['@_Version'], xmlObject['@_PublicationDate'], xmlObject['@_ModelVersion'], xmlObject['@_AccessRestrictions']);
  23. }
  24. }