"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JavaTargetLanguage = exports.javaLanguageConfig = exports.javaOptions = void 0;
const index_js_1 = require("../../RendererOptions/index.js");
const Acronyms_js_1 = require("../../support/Acronyms.js");
const TargetLanguage_js_1 = require("../../TargetLanguage.js");
const JavaJacksonRenderer_js_1 = require("./JavaJacksonRenderer.js");
const JavaRenderer_js_1 = require("./JavaRenderer.js");
exports.javaOptions = {
    useList: new index_js_1.EnumOption("array-type", "Use T[] or List<T>", { array: false, list: true }, "array"),
    justTypes: new index_js_1.BooleanOption("just-types", "Plain types only", false),
    dateTimeProvider: new index_js_1.EnumOption("datetime-provider", "Date time provider type", { java8: "java8", legacy: "legacy" }, "java8"),
    acronymStyle: (0, Acronyms_js_1.acronymOption)(Acronyms_js_1.AcronymStyleOptions.Pascal),
    // FIXME: Do this via a configurable named eventually.
    packageName: new index_js_1.StringOption("package", "Generated package name", "NAME", "io.quicktype"),
    lombok: new index_js_1.BooleanOption("lombok", "Use lombok", false, "primary"),
    lombokCopyAnnotations: new index_js_1.BooleanOption("lombok-copy-annotations", "Copy accessor annotations", true, "secondary"),
};
exports.javaLanguageConfig = {
    displayName: "Java",
    names: ["java"],
    extension: "java",
};
class JavaTargetLanguage extends TargetLanguage_js_1.TargetLanguage {
    constructor() {
        super(exports.javaLanguageConfig);
    }
    getOptions() {
        return exports.javaOptions;
    }
    get supportsUnionsWithBothNumberTypes() {
        return true;
    }
    makeRenderer(renderContext, untypedOptionValues) {
        const options = (0, index_js_1.getOptionValues)(exports.javaOptions, untypedOptionValues);
        if (options.justTypes) {
            return new JavaRenderer_js_1.JavaRenderer(this, renderContext, options);
        }
        return new JavaJacksonRenderer_js_1.JacksonRenderer(this, renderContext, options);
    }
    get stringTypeMapping() {
        const mapping = new Map();
        mapping.set("date", "date");
        mapping.set("time", "time");
        mapping.set("date-time", "date-time");
        mapping.set("uuid", "uuid");
        return mapping;
    }
}
exports.JavaTargetLanguage = JavaTargetLanguage;
