UNPKG

woltlab-compiler

Version:

A compiler for WoltLab-Package Archives and WoltLab-Package Components

45 lines 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const XML_1 = require("../Serialization/XML"); const XMLEditor_1 = require("../Serialization/XMLEditor"); const WoltLabXMLCompiler_1 = require("./WoltLabXMLCompiler"); /** * Provides the functionality to compile files with an import- and a delete-section. */ class ImportFileCompiler extends WoltLabXMLCompiler_1.WoltLabXMLCompiler { /** * Initializes a new instance of the `ImportFileCompiler<T>` class. * * @param item * The item to compile. */ constructor(item) { super(item); } /** * @inheritdoc */ CreateDocument() { let document = super.CreateDocument(); let editor = new XMLEditor_1.XMLEditor(document.documentElement); editor.Add(this.CreateImport()); editor.Add(this.CreateDelete()); return document; } /** * Serializes the import-section of the document. */ CreateImport() { let editor = new XMLEditor_1.XMLEditor(XML_1.XML.CreateDocument("import").documentElement); return editor.Element; } /** * Serializes the delete-section of the document. */ CreateDelete() { let editor = new XMLEditor_1.XMLEditor(XML_1.XML.CreateDocument("delete").documentElement); return editor.Element; } } exports.ImportFileCompiler = ImportFileCompiler; //# sourceMappingURL=ImportFileCompiler.js.map