/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Aai20DataModelReader } from '../../asyncapi/v2/io/Aai20DataModelReader';
import { Aai20DataModelReaderDispatcher } from '../../asyncapi/v2/io/Aai20DataModelReaderDispatcher';
import { Aai20DataModelWriter } from '../../asyncapi/v2/io/Aai20DataModelWriter';
import { Aai20NodeFactory } from '../../asyncapi/v2/models/Aai20NodeFactory';
import { DocumentType } from '../models/DocumentType';
import { ValidationProblemsResetVisitor } from '../validation/ValidationProblemsResetVisitor';
import { ValidationVisitor } from '../validation/ValidationVisitor';
import { Oas20DataModelReader } from '../../openapi/v2/io/Oas20DataModelReader';
import { Oas20DataModelReaderDispatcher } from '../../openapi/v2/io/Oas20DataModelReaderDispatcher';
import { Oas20DataModelWriter } from '../../openapi/v2/io/Oas20DataModelWriter';
import { Oas30DataModelReader } from '../../openapi/v3/io/Oas30DataModelReader';
import { Oas30DataModelReaderDispatcher } from '../../openapi/v3/io/Oas30DataModelReaderDispatcher';
import { Oas30DataModelWriter } from '../../openapi/v3/io/Oas30DataModelWriter';
/**
 * @author eric.wittmann@gmail.com
 * @class
 */
var VisitorFactory = /** @class */ (function () {
    function VisitorFactory() {
    }
    VisitorFactory.aai20NodeFactory_$LI$ = function () { if (VisitorFactory.aai20NodeFactory == null)
        VisitorFactory.aai20NodeFactory = new Aai20NodeFactory(); return VisitorFactory.aai20NodeFactory; };
    ;
    VisitorFactory.createValidationProblemsResetVisitor = function (doc) {
        return new ValidationProblemsResetVisitor();
    };
    VisitorFactory.createValidationVisitor = function (doc) {
        return new ValidationVisitor(doc);
    };
    VisitorFactory.createDataModelReader = function (type) {
        switch ((type)) {
            case DocumentType.asyncapi2:
                return new Aai20DataModelReader(VisitorFactory.aai20NodeFactory_$LI$());
            case DocumentType.openapi2:
                return new Oas20DataModelReader();
            case DocumentType.openapi3:
                return new Oas30DataModelReader();
            default:
                throw Object.defineProperty(new Error("Failed to create a data model reader for type: " + type), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
        }
    };
    VisitorFactory.createDataModelWriter = function (doc) {
        switch ((doc.getDocumentType())) {
            case DocumentType.asyncapi2:
                return new Aai20DataModelWriter();
            case DocumentType.openapi2:
                return new Oas20DataModelWriter();
            case DocumentType.openapi3:
                return new Oas30DataModelWriter();
            default:
                throw Object.defineProperty(new Error("Failed to create a validation visitor for type: " + doc.getDocumentType()), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
        }
    };
    VisitorFactory.createDataModelReaderDispatcher = function (type, json, reader) {
        switch ((type)) {
            case DocumentType.asyncapi2:
                return new Aai20DataModelReaderDispatcher(json, reader);
            case DocumentType.openapi2:
                return new Oas20DataModelReaderDispatcher(json, reader);
            case DocumentType.openapi3:
                return new Oas30DataModelReaderDispatcher(json, reader);
            default:
                throw Object.defineProperty(new Error("Failed to create a data model reader dispatcher for type: " + type), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
        }
    };
    return VisitorFactory;
}());
export { VisitorFactory };
VisitorFactory["__class"] = "io.apicurio.datamodels.core.factories.VisitorFactory";
//# sourceMappingURL=VisitorFactory.js.map