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