UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

51 lines (50 loc) 1.96 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isIfcElementAccessor = exports.IfcElementAccessor = void 0; const ObjectAccessor_js_1 = require("./ObjectAccessor.js"); const IfcRootObjectAccessor_js_1 = require("./IfcRootObjectAccessor.js"); const StringValue_js_1 = require("../value/StringValue.js"); const IfcExpressionUtils_js_1 = require("../util/IfcExpressionUtils.js"); class IfcElementAccessor extends IfcRootObjectAccessor_js_1.IfcRootObjectAccessor { getNestedObjectAccessor(name) { if (name === "type") { return this.getIfcTypeObjectAccessor(); } let val = this.getIfcPropertySetAccessor(name); if ((0, IfcExpressionUtils_js_1.isPresent)(val)) { return val; } return this.getIfcPropertyAccessor(name); } getAttribute(name) { switch (name) { case "ifcClass": return new StringValue_js_1.StringValue(this.getIfcClass()); default: return super.getAttribute(name); } } listNestedObjects() { return [ "type", ...this.listIfcPropertyNames(), ...this.listIfcPropertySetNames(), ]; } listAttributes() { return ["ifcClass", ...super.listAttributes()]; } } exports.IfcElementAccessor = IfcElementAccessor; function isIfcElementAccessor(arg) { return (typeof arg.getGuid === "function" && typeof arg.getName === "function" && typeof arg.getDescription === "function" && typeof arg.getIfcClass === "function" && typeof arg.getIfcPropertySetAccessor === "function" && typeof arg.getIfcPropertyAccessor === "function" && typeof arg.getIfcTypeObjectAccessor === "function" && (0, ObjectAccessor_js_1.isObjectAccessor)(arg)); } exports.isIfcElementAccessor = isIfcElementAccessor; //# sourceMappingURL=IfcElementAccessor.js.map