UNPKG

ern-api-gen

Version:

Electrode Native API generator

56 lines 1.36 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Xml_1 = __importDefault(require("../Xml")); const javaUtil_1 = require("../../java/javaUtil"); class Property { constructor(obj, parent) { if (parent) { this.getParent = () => parent; } } getType() { return this.type || this.constructor.TYPE; } getFormat() { return this.format || this.constructor.FORMAT; } setXml(xml) { if (xml instanceof Xml_1.default) { this.xml = xml; } this.xml = new Xml_1.default(xml); } getVendorExtensions() { if (!this.vendorExtensions) { return javaUtil_1.newHashMap(); } return this.vendorExtensions; } toString() { return `[${this.constructor.name}]${JSON.stringify(this, null, 2)}`; } toXml() { // Emtpy } } Property.allowedProps = [ 'title', 'type', 'format', 'description', 'name', 'readOnly', 'position', 'access', 'enum', 'example', 'externalDocs', 'required', 'xml', ['default', null, '_'], ]; exports.Property = Property; //# sourceMappingURL=Property.js.map