import Validator from './validator.js';
import { reservedKeywords } from '../jhipster/index.js';
const { isReservedClassName } = reservedKeywords;
export default class EnumValidator extends Validator {
    constructor() {
        super('enum', ['name']);
    }
    validate(jdlEnum, options = {}) {
        super.validate(jdlEnum);
        if (options.checkReservedKeywords) {
            checkForReservedClassName(jdlEnum);
        }
    }
}
function checkForReservedClassName(jdlEnum) {
    if (isReservedClassName(jdlEnum.name)) {
        throw new Error(`The enum name '${jdlEnum.name}' is reserved keyword and can not be used as enum class name.`);
    }
}
