UNPKG

isoxml-angular

Version:

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

77 lines (76 loc) 2.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ProductAllocation = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: "ProductIdRef", type: "xs:IDREF", isPrimaryId: false, isOptional: false, isOnlyV4: false, }, B: { name: "QuantityDDI", type: "xs:hexBinary", isPrimaryId: false, isOptional: true, isOnlyV4: false, }, C: { name: "QuantityValue", type: "xs:long", isPrimaryId: false, isOptional: true, isOnlyV4: false, minValue: 0, maxValue: 2147483647, }, D: { name: "TransferMode", type: "xs:NMTOKEN", isPrimaryId: false, isOptional: true, isOnlyV4: false, }, E: { name: "DeviceElementIdRef", type: "xs:IDREF", isPrimaryId: false, isOptional: true, isOnlyV4: false, }, F: { name: "ValuePresentationIdRef", type: "xs:IDREF", isPrimaryId: false, isOptional: true, isOnlyV4: false, }, G: { name: "ProductSubTypeIdRef", type: "xs:IDREF", isPrimaryId: false, isOptional: true, isOnlyV4: true, }, }; const CHILD_TAGS = { ASP: { name: "AllocationStamp", isOnlyV4: false }, }; class ProductAllocation { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "PAN" /* TAGS.ProductAllocation */; } static fromXML(xml, isoxmlManager, internalId, targetClass = ProductAllocation) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.ProductAllocation = ProductAllocation; (0, classRegistry_1.registerEntityClass)("main", "PAN" /* TAGS.ProductAllocation */, ProductAllocation);