@abaplint/core
Version:
abaplint - Core API
79 lines • 2.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Interface = void 0;
const _abap_object_1 = require("./_abap_object");
class Interface extends _abap_object_1.ABAPObject {
constructor() {
super(...arguments);
this.def = undefined;
this.parsedXML = undefined;
}
getType() {
return "INTF";
}
setDefinition(def) {
this.def = def;
}
getSequencedFiles() {
const main = this.getMainABAPFile();
if (main === undefined) {
return [];
}
return [main];
}
getDefinition() {
return this.def;
}
getInterface() {
var _a;
return (_a = this.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().getInterfaceDefinitionByName(this.getName());
}
getIdentifier() {
var _a;
return (_a = this.getInterface()) === null || _a === void 0 ? void 0 : _a.identifier;
}
getAllowedNaming() {
return {
maxLength: 30,
allowNamespace: true,
};
}
setDirty() {
this.def = undefined;
this.parsedXML = undefined;
super.setDirty();
}
getNameFromXML() {
var _a;
this.parseXML();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.name;
}
getDescription() {
var _a;
this.parseXML();
return (_a = this.parsedXML) === null || _a === void 0 ? void 0 : _a.description;
}
/////////////////////////
parseXML() {
if (this.parsedXML !== undefined) {
return;
}
this.parsedXML = {};
const parsed = super.parseRaw2();
if (parsed === undefined
|| parsed.abapGit["asx:abap"]["asx:values"] === undefined) {
return;
}
const vseo = parsed.abapGit["asx:abap"]["asx:values"].VSEOINTERF;
if (vseo === undefined) {
this.parsedXML.description = "";
this.parsedXML.name = "";
}
else {
this.parsedXML.description = vseo.DESCRIPT ? vseo.DESCRIPT : "";
this.parsedXML.name = vseo.CLSNAME ? vseo.CLSNAME : "";
}
}
}
exports.Interface = Interface;
//# sourceMappingURL=interface.js.map