UAObjectType.ts 912 B

1234567891011121314151617181920212223242526272829
  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 UAObjectType extends UABaseNode{
  6. public isAbstract: boolean;
  7. constructor(options: UAObjectTypeOptions) {
  8. super(options)
  9. this.isAbstract=options.isAbstract||false;
  10. }
  11. static fromXML(xmlObjType: any, addressSpace: IAddressSpace): UAObjectType{
  12. const bn=super.fromXML(xmlObjType, addressSpace)
  13. return new UAObjectType(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 UAObjectTypeOptions extends UABaseNodeOptions{
  22. isAbstract?: boolean
  23. }