import Validator from './validator.js';
import { reservedKeywords } from '../jhipster/index.mjs';
const { isReservedClassName } = reservedKeywords;
export default class EnumValidator extends Validator {
    constructor() {
        super('enum', ['name']);
    }
    validate(jdlEnum) {
        super.validate(jdlEnum);
        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.`);
    }
}
