UNPKG

isoxml-angular

Version:

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

70 lines (69 loc) 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AttachedFile = void 0; const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = { A: { name: "FilenameWithExtension", type: "xs:ID", isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, B: { name: "Preserve", type: "xs:NMTOKEN", isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, C: { name: "ManufacturerGLN", type: "xs:anyURI", isPrimaryId: false, isOptional: false, isOnlyV4: undefined, }, D: { name: "FileType", type: "xs:unsignedByte", isPrimaryId: false, isOptional: false, isOnlyV4: undefined, minValue: 1, maxValue: 254, }, E: { name: "FileVersion", type: "xs:string", isPrimaryId: false, isOptional: true, isOnlyV4: undefined, }, F: { name: "FileLength", type: "xs:unsignedLong", isPrimaryId: false, isOptional: true, isOnlyV4: undefined, minValue: 0, maxValue: 4294967294, }, }; const CHILD_TAGS = {}; class AttachedFile { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = "AFE" /* TAGS.AttachedFile */; } static fromXML(xml, isoxmlManager, internalId, targetClass = AttachedFile) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.AttachedFile = AttachedFile; (0, classRegistry_1.registerEntityClass)("main", "AFE" /* TAGS.AttachedFile */, AttachedFile);