private function getFieldNormalizer(\ReflectionProperty $reflectionProperty, \ReflectionClass $reflectionClass)
    {
        $classMetadata = $this->doctrine->getManager()->getMetadataFactory()->getMetadataFor($reflectionClass->getName());

        $fieldName = $reflectionProperty->getName();
        $fieldMapping = $classMetadata->getFieldMapping($fieldName);

        if (!isset($fieldMapping['_old_type'])) {
            throw new EncryptionException('Field metadata not updated');
        }

        switch ($fieldMapping['_old_type']) {
            case 'string':
            case 'text':
                $normalizerClass = FieldNormalizer\DefaultFieldNormalizer::class;
                break;
            case 'date':
            case 'datetime':
            case 'time':
                $normalizerClass = FieldNormalizer\DateTimeFieldNormalizer::class;
                break;
            case 'json_array':
                $normalizerClass = FieldNormalizer\JsonArrayFieldNormalizer::class;
                break;
            case 'simple_array':
                $normalizerClass = FieldNormalizer\SimpleArrayFieldNormalizer::class;
                break;
            case 'array':
            case 'object':
                $normalizerClass = FieldNormalizer\SerializableObjectFieldNormalizer::class;
                break;
            case 'boolean':
            case 'smallint':
            case 'integer':
            case 'bigint':
            case 'float':
                $normalizerClass = FieldNormalizer\PrimitiveFieldNormalizer::class;
                $fieldType = $fieldMapping['_old_type'];
                if (!isset($this->normalizers[$normalizerClass][$fieldType])) {
                    $this->normalizers[$normalizerClass][$fieldType] =
                    new $normalizerClass($fieldType);
                }
                return $this->normalizers[$normalizerClass][$fieldType];
                break;
            default:
                throw new EncryptionException('Field type '.$fieldMapping['_old_type'].' not supported.');
        }

        if (!isset($this->normalizers[$normalizerClass])) {
            $this->normalizers[$normalizerClass] = new $normalizerClass();
        }

        return $this->normalizers[$normalizerClass];
    }