import { DocumentType } from '../core/models/DocumentType';
/**
 * Class used to create an empty clone of any data model node.
 * @author eric.wittmann@gmail.com
 * @class
 */
var ModelCloner = /** @class */ (function () {
    function ModelCloner() {
    }
    ModelCloner.createEmptyClone = function (source) {
        var visitor = null;
        switch ((source.ownerDocument().getDocumentType())) {
            case DocumentType.asyncapi2:
                visitor = new Aai20ModelClonerVisitor();
                break;
            case DocumentType.openapi2:
                visitor = new Oas20ModelClonerVisitor();
                break;
            case DocumentType.openapi3:
                visitor = new Oas30ModelClonerVisitor();
                break;
            default:
                break;
        }
        if (visitor == null) {
            throw Object.defineProperty(new Error("No model cloner found for: " + source.ownerDocument().getDocumentType()), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
        }
        source.accept(visitor);
        return visitor.getClone();
    };
    return ModelCloner;
}());
export { ModelCloner };
ModelCloner["__class"] = "io.apicurio.datamodels.cloning.ModelCloner";
import { Oas30ModelClonerVisitor } from './Oas30ModelClonerVisitor';
import { Oas20ModelClonerVisitor } from './Oas20ModelClonerVisitor';
import { Aai20ModelClonerVisitor } from './Aai20ModelClonerVisitor';
//# sourceMappingURL=ModelCloner.js.map