/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { NodeCompat } from '../../compat/NodeCompat';
import { Constants } from '../Constants';
import { NodePath } from '../models/NodePath';
/**
 * Constructor.
 * @class
 * @author eric.wittmann@gmail.com
 */
var NodePathVisitor = /** @class */ (function () {
    function NodePathVisitor() {
        this.path = new NodePath();
    }
    /**
     * Gets the path that was created.
     * @return {NodePath}
     */
    NodePathVisitor.prototype.getPath = function () {
        return this.path;
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitValidationProblem(io.apicurio.datamodels.core.models.ValidationProblem)
     * @param {ValidationProblem} problem
     */
    NodePathVisitor.prototype.visitValidationProblem = function (problem) {
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitDocument(io.apicurio.datamodels.core.models.Document)
     * @param {Document} node
     */
    NodePathVisitor.prototype.visitDocument = function (node) {
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExtension(io.apicurio.datamodels.core.models.Extension)
     * @param {Extension} node
     */
    NodePathVisitor.prototype.visitExtension = function (node) {
        this.path.prependSegment(node.name, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitInfo(io.apicurio.datamodels.core.models.common.Info)
     * @param {Info} node
     */
    NodePathVisitor.prototype.visitInfo = function (node) {
        this.path.prependSegment(Constants.PROP_INFO, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitContact(io.apicurio.datamodels.core.models.common.Contact)
     * @param {Contact} node
     */
    NodePathVisitor.prototype.visitContact = function (node) {
        this.path.prependSegment(Constants.PROP_CONTACT, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitLicense(io.apicurio.datamodels.core.models.common.License)
     * @param {License} node
     */
    NodePathVisitor.prototype.visitLicense = function (node) {
        this.path.prependSegment(Constants.PROP_LICENSE, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitTag(io.apicurio.datamodels.core.models.common.Tag)
     * @param {Tag} node
     */
    NodePathVisitor.prototype.visitTag = function (node) {
        var idx = NodeCompat.indexOf(node, node.parent(), Constants.PROP_TAGS);
        if (idx !== -1) {
            this.path.prependSegment(/* valueOf */ new String(idx).toString(), true);
            this.path.prependSegment(Constants.PROP_TAGS, false);
        }
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSecurityRequirement(io.apicurio.datamodels.core.models.common.SecurityRequirement)
     * @param {SecurityRequirement} node
     */
    NodePathVisitor.prototype.visitSecurityRequirement = function (node) {
        var idx = NodeCompat.indexOf(node, node.parent(), Constants.PROP_SECURITY);
        if (idx !== -1) {
            this.path.prependSegment(/* valueOf */ new String(idx).toString(), true);
            this.path.prependSegment(Constants.PROP_SECURITY, false);
        }
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitExternalDocumentation(io.apicurio.datamodels.core.models.common.ExternalDocumentation)
     * @param {ExternalDocumentation} node
     */
    NodePathVisitor.prototype.visitExternalDocumentation = function (node) {
        this.path.prependSegment(Constants.PROP_EXTERNAL_DOCS, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchema(io.apicurio.datamodels.core.models.common.Schema)
     * @param {Schema} node
     */
    NodePathVisitor.prototype.visitSchema = function (node) {
        this.path.prependSegment(Constants.PROP_SCHEMA, false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameter(io.apicurio.datamodels.core.models.common.Parameter)
     * @param {Parameter} node
     */
    NodePathVisitor.prototype.visitParameter = function (node) {
        var idx = NodeCompat.indexOf(node, node.parent(), Constants.PROP_PARAMETERS);
        if (idx !== -1) {
            this.path.prependSegment(/* valueOf */ new String(idx).toString(), true);
            this.path.prependSegment(Constants.PROP_PARAMETERS, false);
        }
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitOperation(io.apicurio.datamodels.core.models.common.Operation)
     * @param {Operation} node
     */
    NodePathVisitor.prototype.visitOperation = function (node) {
        this.path.prependSegment(node.getType(), false);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.NodePathVisitor#visitSecurityScheme(io.apicurio.datamodels.core.models.common.SecurityScheme)
     * @param {SecurityScheme} node
     */
    NodePathVisitor.prototype.visitSecurityScheme = function (node) {
        this.path.prependSegment(node.getSchemeName(), true);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitSchemaDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    NodePathVisitor.prototype.visitSchemaDefinition = function (node) {
        this.path.prependSegment(node.getName(), true);
    };
    /**
     * @see io.apicurio.datamodels.core.visitors.IVisitor#visitParameterDefinition(io.apicurio.datamodels.core.models.common.IDefinition)
     * @param {*} node
     */
    NodePathVisitor.prototype.visitParameterDefinition = function (node) {
        this.path.prependSegment(node.getName(), true);
    };
    return NodePathVisitor;
}());
export { NodePathVisitor };
NodePathVisitor["__class"] = "io.apicurio.datamodels.core.visitors.NodePathVisitor";
NodePathVisitor["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor"];
//# sourceMappingURL=NodePathVisitor.js.map