UAReferenceType.ts 923 B

12345678910111213141516171819202122232425262728
  1. import { XMLElem } from "@/util/XmlElem";
  2. import type { NamespaceTable } from "./NameSpaceTable";
  3. import { UABaseNode, type UABaseNodeOptions } from "./UABaseNode";
  4. import type { IAddressSpace } from "./IAddressSpace";
  5. export class UAReferenceType extends UABaseNode{
  6. public isAbstract: boolean;
  7. constructor(options: UAReferenceTypeOptions) {
  8. super(options)
  9. this.isAbstract=options.isAbstract||false;
  10. }
  11. static fromXML(xmlRefType: any, addressSpace: IAddressSpace): UAReferenceType{
  12. const bn=super.fromXML(xmlRefType, addressSpace)
  13. return new UAReferenceType(bn as UABaseNodeOptions);
  14. }
  15. toXML(lnst:NamespaceTable, gnst:NamespaceTable): XMLElem {
  16. const elem=super.toXML(lnst, gnst);
  17. elem.attr('IsAbstract', this.isAbstract);
  18. return elem;
  19. }
  20. }
  21. export interface UAReferenceTypeOptions extends UABaseNodeOptions{
  22. isAbstract?: boolean
  23. }