public static function register(CodeGeneratorInterface $codeGenerator)
    {
        $class = get_class($codeGenerator);
        if (!defined("$class::ENTITY_CLASS")) {
            throw new \Exception($class . ' must define a ENTITY_CLASS constant.');
        }
        if (!defined("$class::ENTITY_FIELD")) {
            throw new \Exception($class . ' must define a ENTITY_FIELD constant.');
        }
        self::$generators[$codeGenerator::ENTITY_CLASS][$codeGenerator::ENTITY_FIELD] = $codeGenerator;
    }