UNPKG

isoxml

Version:

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

41 lines (40 loc) 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExternalFileContents = void 0; const constants_1 = require("./constants"); const classRegistry_1 = require("../classRegistry"); const utils_1 = require("../utils"); const ATTRIBUTES = {}; const CHILD_TAGS = { BSN: { name: 'BaseStation', isOnlyV4: undefined }, CCT: { name: 'CodedComment', isOnlyV4: undefined }, CCG: { name: 'CodedCommentGroup', isOnlyV4: undefined }, CLD: { name: 'ColourLegend', isOnlyV4: undefined }, CTP: { name: 'CropType', isOnlyV4: undefined }, CPC: { name: 'CulturalPractice', isOnlyV4: undefined }, CTR: { name: 'Customer', isOnlyV4: undefined }, DVC: { name: 'Device', isOnlyV4: undefined }, FRM: { name: 'Farm', isOnlyV4: undefined }, OTQ: { name: 'OperationTechnique', isOnlyV4: undefined }, PFD: { name: 'Partfield', isOnlyV4: undefined }, PDT: { name: 'Product', isOnlyV4: undefined }, PGP: { name: 'ProductGroup', isOnlyV4: undefined }, TSK: { name: 'Task', isOnlyV4: undefined }, VPN: { name: 'ValuePresentation', isOnlyV4: undefined }, WKR: { name: 'Worker', isOnlyV4: undefined }, }; class ExternalFileContents { constructor(attributes, isoxmlManager) { this.attributes = attributes; this.isoxmlManager = isoxmlManager; this.tag = constants_1.TAGS.ExternalFileContents; } static fromXML(xml, isoxmlManager, internalId, targetClass = ExternalFileContents) { return (0, utils_1.fromXML)(xml, isoxmlManager, targetClass, ATTRIBUTES, CHILD_TAGS, internalId); } toXML() { return (0, utils_1.toXML)(this, ATTRIBUTES, CHILD_TAGS); } } exports.ExternalFileContents = ExternalFileContents; (0, classRegistry_1.registerEntityClass)('main', constants_1.TAGS.ExternalFileContents, ExternalFileContents);