UNPKG

isoxml-angular

Version:

JavaScript library to parse and generate ISOXML (ISO11783-10) files

45 lines (44 loc) 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Link = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: 'ObjectIdRef', type: 'xs:IDREF', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, B: { name: 'LinkValue', type: 'xs:token', isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, C: { name: 'LinkDesignator', type: 'xs:string', isPrimaryId: false, isOptional: true, isOnlyV4: undefined, }, }; const CHILD_TAGS = {}; class Link { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "LNK" /* TAGS.Link */; } static fromXML(xml, isoxmlManager, internalId, targetClass = Link) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.Link = Link; (0, classRegistry_1.registerEntityClass)('main', "LNK" /* TAGS.Link */, Link);