/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Library } from '../Library';
/**
 * @author eric.wittmann@gmail.com
 * @class
 */
var ModelClonerVisitor = /** @class */ (function () {
    function ModelClonerVisitor() {
        if (this.__clone === undefined)
            this.__clone = null;
    }
    ModelClonerVisitor.prototype.getClone = function () {
        if (this.__clone.ownerDocument() == null && this.__clone.parent() != null) {
            this.__clone._ownerDocument = this.__clone.parent().ownerDocument();
        }
        return this.__clone;
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitContact(io.apicurio.datamodels.core.models.common.Contact)
     * @param {Contact} node
     */
    ModelClonerVisitor.prototype.visitContact = function (node) {
        this.__clone = node.ownerDocument().createInfo().createContact();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    ModelClonerVisitor.prototype.visitDocument = function (node) {
        this.__clone = Library.createDocument(node.getDocumentType());
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExtension(io.apicurio.datamodels.core.models.Extension)
     * @param {Extension} node
     */
    ModelClonerVisitor.prototype.visitExtension = function (node) {
        this.__clone = node.ownerDocument().createExtension();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExternalDocumentation(io.apicurio.datamodels.core.models.common.ExternalDocumentation)
     * @param {ExternalDocumentation} node
     */
    ModelClonerVisitor.prototype.visitExternalDocumentation = function (node) {
        this.__clone = node.ownerDocument().createExternalDocumentation();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitInfo(io.apicurio.datamodels.core.models.common.Info)
     * @param {Info} node
     */
    ModelClonerVisitor.prototype.visitInfo = function (node) {
        this.__clone = node.ownerDocument().createInfo();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitLicense(io.apicurio.datamodels.core.models.common.License)
     * @param {License} node
     */
    ModelClonerVisitor.prototype.visitLicense = function (node) {
        this.__clone = node.ownerDocument().createInfo().createLicense();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitTag(io.apicurio.datamodels.core.models.common.Tag)
     * @param {Tag} node
     */
    ModelClonerVisitor.prototype.visitTag = function (node) {
        this.__clone = node.ownerDocument().createTag();
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitValidationProblem(io.apicurio.datamodels.core.models.ValidationProblem)
     * @param {ValidationProblem} problem
     */
    ModelClonerVisitor.prototype.visitValidationProblem = function (problem) {
    };
    return ModelClonerVisitor;
}());
export { ModelClonerVisitor };
ModelClonerVisitor["__class"] = "io.apicurio.datamodels.cloning.ModelClonerVisitor";
ModelClonerVisitor["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor"];
//# sourceMappingURL=ModelClonerVisitor.js.map