ern-api-gen
Version:
Electrode Native API generator
44 lines • 1.41 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Property_1 = require("./Property");
const GenericRef_1 = __importDefault(require("../refs/GenericRef"));
const RefType_1 = __importDefault(require("../refs/RefType"));
class RefProperty extends Property_1.Property {
constructor(ref) {
super();
if (ref && ref.$ref) {
this.set$ref(ref.$ref);
}
else if (typeof ref === 'string') {
this.set$ref(ref);
}
}
set$ref(ref) {
this.genericRef = new GenericRef_1.default(RefType_1.default.DEFINITION, ref);
}
get$ref() {
return this.genericRef.getRef();
}
asDefault(ref) {
this.set$ref(RefType_1.default.DEFINITION.getInternalPrefix() + ref);
return this;
}
getSimpleRef() {
if (this.genericRef != null) {
const simp = this.genericRef.getSimpleRef();
return simp;
}
}
getRefFormat() {
if (this.genericRef != null) {
return this.genericRef.getFormat();
}
}
}
RefProperty.TYPE = 'ref';
RefProperty.allowedProps = [...Property_1.Property.allowedProps, '$ref'];
exports.RefProperty = RefProperty;
//# sourceMappingURL=RefProperty.js.map