/**
 * Constructor.
 * @param {*[]} visitors
 * @class
 * @author eric.wittmann@gmail.com
 */
var CompositeVisitor = /** @class */ (function () {
    function CompositeVisitor(visitors) {
        this.visitors = ([]);
        this.visitors = visitors;
    }
    /**
     * Adds a visitor.
     * @param {*} visitor
     */
    CompositeVisitor.prototype.addVisitor = function (visitor) {
        /* add */ (this.visitors.push(visitor) > 0);
    };
    /**
     * Adds multiple visitors.
     * @param {Bound[]} visitors
     */
    CompositeVisitor.prototype.addVisitors = function (visitors) {
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(this.visitors, visitors);
    };
    /**
     * Make the node accept all of the visitors.
     * @param {*} node
     */
    CompositeVisitor.prototype.acceptAll = function (node) {
        this.visitors.forEach(function (visitor) {
            node.accept(visitor);
        });
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitValidationProblem(io.apicurio.datamodels.core.models.ValidationProblem)
     * @param {ValidationProblem} problem
     */
    CompositeVisitor.prototype.visitValidationProblem = function (problem) {
        this.acceptAll(problem);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    CompositeVisitor.prototype.visitDocument = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExtension(io.apicurio.datamodels.core.models.Extension)
     * @param {Extension} node
     */
    CompositeVisitor.prototype.visitExtension = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitInfo(io.apicurio.datamodels.core.models.common.Info)
     * @param {Info} node
     */
    CompositeVisitor.prototype.visitInfo = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitContact(io.apicurio.datamodels.core.models.common.Contact)
     * @param {Contact} node
     */
    CompositeVisitor.prototype.visitContact = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitLicense(io.apicurio.datamodels.core.models.common.License)
     * @param {License} node
     */
    CompositeVisitor.prototype.visitLicense = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitTag(io.apicurio.datamodels.core.models.common.Tag)
     * @param {Tag} node
     */
    CompositeVisitor.prototype.visitTag = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityRequirement(io.apicurio.datamodels.core.models.common.SecurityRequirement)
     * @param {SecurityRequirement} node
     */
    CompositeVisitor.prototype.visitSecurityRequirement = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExternalDocumentation(io.apicurio.datamodels.core.models.common.ExternalDocumentation)
     * @param {ExternalDocumentation} node
     */
    CompositeVisitor.prototype.visitExternalDocumentation = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    CompositeVisitor.prototype.visitSchema = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameter(io.apicurio.datamodels.core.models.common.Parameter)
     * @param {Parameter} node
     */
    CompositeVisitor.prototype.visitParameter = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    CompositeVisitor.prototype.visitOperation = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityScheme(io.apicurio.datamodels.core.models.common.SecurityScheme)
     * @param {SecurityScheme} node
     */
    CompositeVisitor.prototype.visitSecurityScheme = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchemaDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    CompositeVisitor.prototype.visitSchemaDefinition = function (node) {
        this.acceptAll(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameterDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    CompositeVisitor.prototype.visitParameterDefinition = function (node) {
        this.acceptAll(node);
    };
    return CompositeVisitor;
}());
export { CompositeVisitor };
CompositeVisitor["__class"] = "io.apicurio.datamodels.core.visitors.CompositeVisitor";
CompositeVisitor["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor"];
//# sourceMappingURL=CompositeVisitor.js.map