var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { NodeCompat } from '../../compat/NodeCompat';
import { Traverser } from '../../core/visitors/Traverser';
/**
 * Constructor.
 * @param {*} visitor
 * @class
 * @extends Traverser
 * @author eric.wittmann@gmail.com
 */
var OasTraverser = /** @class */ (function (_super) {
    __extends(OasTraverser, _super);
    function OasTraverser(visitor) {
        return _super.call(this, visitor) || this;
    }
    /**
     * @see io.apicurio.datamodels.core.visitors.Traverser#traverseDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    OasTraverser.prototype.traverseDocument = function (node) {
        var doc = node;
        _super.prototype.traverseDocument.call(this, node);
        this.traverseIfNotNull(doc.paths);
        this.traverseCollection(doc.security);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPaths(io.apicurio.datamodels.openapi.models.OasPaths)
     * @param {OasPaths} node
     */
    OasTraverser.prototype.visitPaths = function (node) {
        node.accept(this.visitor);
        this.traverseIndexedNode(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPathItem(io.apicurio.datamodels.openapi.models.OasPathItem)
     * @param {OasPathItem} node
     */
    OasTraverser.prototype.visitPathItem = function (node) {
        node.accept(this.visitor);
        this.traversePathItem(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * Traverses a path item.
     * @param {OasPathItem} node
     */
    OasTraverser.prototype.traversePathItem = function (node) {
        this.traverseIfNotNull(node.get);
        this.traverseIfNotNull(node.put);
        this.traverseIfNotNull(node.post);
        this.traverseIfNotNull(node.delete);
        this.traverseIfNotNull(node.options);
        this.traverseIfNotNull(node.head);
        this.traverseIfNotNull(node.patch);
        this.traverseCollection(node.parameters);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponse(io.apicurio.datamodels.openapi.models.OasResponse)
     * @param {OasResponse} node
     */
    OasTraverser.prototype.visitResponse = function (node) {
        node.accept(this.visitor);
        this.traverseResponse(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    OasTraverser.prototype.traverseResponse = function (node) {
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponses(io.apicurio.datamodels.openapi.models.OasResponses)
     * @param {OasResponses} node
     */
    OasTraverser.prototype.visitResponses = function (node) {
        node.accept(this.visitor);
        this.traverseIndexedNode(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitXML(io.apicurio.datamodels.openapi.models.OasXML)
     * @param {OasXML} node
     */
    OasTraverser.prototype.visitXML = function (node) {
        node.accept(this.visitor);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitAllOfSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    OasTraverser.prototype.visitAllOfSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitItemsSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    OasTraverser.prototype.visitItemsSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitAdditionalPropertiesSchema(io.apicurio.datamodels.openapi.models.OasSchema)
     * @param {OasSchema} node
     */
    OasTraverser.prototype.visitAdditionalPropertiesSchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitPropertySchema(io.apicurio.datamodels.openapi.models.IOasPropertySchema)
     * @param {*} node
     */
    OasTraverser.prototype.visitPropertySchema = function (node) {
        this.visitSchema(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.Traverser#traverseSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    OasTraverser.prototype.traverseSchema = function (node) {
        _super.prototype.traverseSchema.call(this, node);
        var schema = node;
        if (NodeCompat.isList(schema.items)) {
            this.traverseCollection(schema.items);
        }
        else {
            this.traverseIfNotNull(schema.items);
        }
        this.traverseCollection(schema.allOf);
        this.traverseCollection(schema.getProperties());
        if (NodeCompat.isNode(schema.additionalProperties)) {
            this.traverseIfNotNull(schema.additionalProperties);
        }
        this.traverseIfNotNull(schema.xml);
        this.traverseIfNotNull(schema.externalDocs);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitHeader(io.apicurio.datamodels.openapi.models.OasHeader)
     * @param {OasHeader} node
     */
    OasTraverser.prototype.visitHeader = function (node) {
        node.accept(this.visitor);
        this.traverseHeader(node);
        this.traverseExtensions(node);
        this.traverseValidationProblems(node);
    };
    OasTraverser.prototype.traverseHeader = function (node) {
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitResponseDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    OasTraverser.prototype.visitResponseDefinition = function (node) {
        this.visitResponse(node);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.Traverser#traverseOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    OasTraverser.prototype.traverseOperation = function (node) {
        var operation = node;
        this.traverseCollection(operation.parameters);
        this.traverseIfNotNull(operation.responses);
        this.traverseCollection(operation.security);
        _super.prototype.traverseOperation.call(this, node);
    };
    /**
     * @see io.apicurio.datamodels.openapi.visitors.IOasVisitor#visitExample(io.apicurio.datamodels.core.models.common.IExample)
     * @param {*} node
     */
    OasTraverser.prototype.visitExample = function (node) {
        throw Object.defineProperty(new Error("Must be implemented by subclasses."), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
    };
    return OasTraverser;
}(Traverser));
export { OasTraverser };
OasTraverser["__class"] = "io.apicurio.datamodels.openapi.visitors.OasTraverser";
OasTraverser["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.core.visitors.ITraverser", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=OasTraverser.js.map