@param DenormalizationObjectMappingInterface $objectMapping
@param string                                $path
@param string|null                           $type

@return object
760205
private function createNewObject(
        DenormalizationObjectMappingInterface $objectMapping,
        string $path,
        string $type = null
    ) {
        $factory = $objectMapping->getDenormalizationFactory($path, $type);
        $object = $factory();

        if (is_object($object)) {
            return $object;
        }

        $exception = DeserializerLogicException::createFactoryDoesNotReturnObject($path, gettype($object));

        $this->logger->error('deserialize: {exception}', ['exception' => $exception->getMessage()]);

        throw $exception;
    }
861308
public static function create($mapping): Mapping
    {
        if (\is_array($mapping)) {
            $mappingObject = new self();
            $mappingObject->setProperties($mapping);

            return $mappingObject;
        }

        if ($mapping instanceof self) {
            return $mapping;
        }

        throw new InvalidException('Invalid object type');
    }
67706
public function mapToCollection(CollectionType $collectionType, callable $mapperCallback = null, callable $reverseMapperCallback = null)
    {
        $collectionClass = $collectionType->getCollectionClass();

        if ($collectionClass === TypedCollection::class || $collectionClass === ITypedCollection::class) {
            $collectionFactory = function (array $input) use ($collectionType) {
                return new TypedCollection($collectionType->getElementType(), $input);
            };
        } elseif ($collectionClass === EntityIdCollection::class) {
            $collectionFactory = function (array $input) use ($collectionType) {
                return new EntityIdCollection($input);
            };
        } elseif ($collectionType->isSubsetOf(TypedObject::collectionType())) {
            $objectType = $collectionType->getElementType()->asTypeString();
            $collectionFactory = function (array $input) use ($objectType) {
                /** @var string|TypedObject $objectType */
                return $objectType::collection($input);
            };
        } else {
            throw InvalidArgumentException::format(
                'Invalid collection type supplied to %s: expecting one of (%s), %s given',
                get_class($this) . '::' . __FUNCTION__,
                Debug::formatValues([TypedCollection::class, EntityIdCollection::class, TypedObject::collectionType()->asTypeString()]),
                $collectionType->asTypeString()
            );
        }

        $this->customProcessorCallbacks[] = function (IType $currentType) use (
            $collectionType,
            $collectionFactory,
            $mapperCallback,
            $reverseMapperCallback
        ) {
            return new CustomProcessor(
                $currentType->isNullable() ? $collectionType->nullable() : $collectionType,
                function (array $elements) use ($collectionFactory, $mapperCallback) {
                    $elements = $mapperCallback ? array_map($mapperCallback, $elements) : $elements;

                    return $collectionFactory($elements);
                },
                function (ITypedCollection $collection) use ($collectionType, $reverseMapperCallback) {
                    $elements = [];

                    foreach ($collection as $key => $element) {
                        $elements[$key] = $element;
                    }

                    return $reverseMapperCallback ? array_map($reverseMapperCallback, $elements) : $elements;
                }
            );
        };

        return $this;
    }
289540
private function getValue(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null !== $this->accessor) {
            return $this->accessor->getValue($object);
        }

        return $this->fieldNormalizer->normalizeField($path, $object, $context, $normalizer);
    }
809720
protected function denormalizeProperty($value, $class, $name, $format = null, array $context = array())
    {
        /** @var ClassMetadata $meta */
        $meta = $context['entityMeta'];

        if ($meta->hasField($name)) {
            return $value;
        }

        if (isset($meta->embeddedClasses[$name])) {
            return parent::denormalize($value, null, $format, $context);
        }

        if (!isset($meta->associationMappings[$name])) {
            return parent::denormalizeProperty($value, $class, $name, $format, $context);
        }

        switch ($meta->associationMappings[$name]['type']) {
            case ClassMetadata::ONE_TO_ONE:
            case ClassMetadata::MANY_TO_ONE:
                return $this->denormalizeAssociation($value, null, $name, $format, $context);

            case ClassMetadata::ONE_TO_MANY:
            case ClassMetadata::MANY_TO_MANY:
                return $this->denormalizeCollection($value, null, $name, $format, $context);
        }
    }
1341459
public function getObjectMapping(string $class): DenormalizationObjectMappingInterface
    {
        $reflectionClass = new \ReflectionClass($class);

        if (in_array('Doctrine\Common\Persistence\Proxy', $reflectionClass->getInterfaceNames(), true)) {
            $reflectionParentClass = (new \ReflectionClass($class))->getParentClass();
            if ($reflectionParentClass instanceof \ReflectionClass) {
                $class = $reflectionParentClass->getName();
            }
        }

        if (isset($this->objectMappings[$class])) {
            return $this->objectMappings[$class];
        }

        throw DeserializerLogicException::createMissingMapping($class);
    }
615125
public function normalize($object, NormalizerContextInterface $context = null, string $path = ''): array
    {
        return $this->normalizer->normalize($object, $context, $path);
    }
504002
public function object($objectType = null): ObjectInterface
    {
        //====================================================================//
        // Build Objects Type Index Key
        $index = get_class($this->getConnector())."::".$objectType;

        //====================================================================//
        // If Object Manager is New
        if (!isset($this->objectManagers[$index])) {
            $this->objectManagers[$index] = new Manager($this->getConnector(), $objectType);
        }

        //====================================================================//
        // Return Object Manager
        return $this->objectManagers[$index];
    }
67656
public static function createReferenceMany(
        string $name,
        callable $repository
    ): DenormalizationFieldMappingBuilderInterface {
        $self = new self($name);
        $self->fieldDenormalizer = new ReferenceManyFieldDenormalizer($repository, new PropertyAccessor($name));

        return $self;
    }
1372968
@Override
	@Nullable
	public String getMapping(Class<?> type) {

		Assert.notNull(type, "Type must not be null!");

		String[] mapping = getMappingFrom(findMergedAnnotation(type, annotationType));

		return mapping.length == 0 ? null : mapping[0];
	}
26480
public function normalize(PathInterface $path)
    {
        if ($path instanceof WindowsPathInterface) {
            return $this->windowsNormalizer()->normalize($path);
        }

        return $this->unixNormalizer()->normalize($path);
    }
127561
protected function createRequestObject($objectType)
    {
        $repository = $this->getRepository();

        switch ($objectType) {
            case 'SessionInput':
                $this->requestObject = new SessionInput();
                break;
            case 'ContentTypeGroupCreateStruct':
                $this->requestObject = $repository
                    ->getContentTypeService()
                    ->newContentTypeGroupCreateStruct('identifier');
                break;

            case 'ContentTypeGroupUpdateStruct':
                $this->requestObject = $repository
                    ->getContentTypeService()
                    ->newContentTypeGroupUpdateStruct();
                break;

            case 'ViewInput':
                $this->requestObject = new ViewInput();
                break;

            default:
                throw new InvalidArgumentException($objectType, 'type is not defined yet');
        }
    }
551072
public function supportsDenormalization($data, $type, $format = null)
    {
        if (!($class = $this->getClassFromArray($data))) {
            return parent::supportsDenormalization($data, $type ?: $class, $format);
        }

        return true;
    }
698221
private function getLinksByLinkNormalizationMappings(
        NormalizerContextInterface $context,
        array $normalizationLinkMappings,
        string $path,
        $object
    ): array {
        $links = [];
        foreach ($normalizationLinkMappings as $normalizationLinkMapping) {
            if (!$this->isWithinGroup($context, $normalizationLinkMapping)) {
                continue;
            }

            $linkNormalizer = $normalizationLinkMapping->getLinkNormalizer();

            if (null === $link = $linkNormalizer->normalizeLink($path, $object, $context)) {
                continue;
            }

            $links[$normalizationLinkMapping->getName()] = $link;
        }

        return $links;
    }
25912
public function convert($value, string $path = '', bool $allowSerializeEmpty = false): AbstractNode
    {
        if (null === $value) {
            return NullNode::create();
        }

        $type = gettype($value);

        if (!isset($this->typeMapping[$type])) {
            throw new \InvalidArgumentException(
                sprintf('Type %s is not supported, at path %s', is_object($value) ? get_class($value) : $type, $path)
            );
        }

        $node = $this->typeMapping[$type];

        return $node::create($value, $allowSerializeEmpty);
    }
568995
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        @trigger_error(sprintf('Use %s instead', DateTimeFieldNormalizer::class), E_USER_DEPRECATED);

        return $this->fieldNormalizer->normalizeField($path, $object, $context, $normalizer);
    }
922952
@Singleton
    @Primary
    @BootstrapContextCompatible
    public ObjectMapper objectMapper(@Nullable JacksonConfiguration jacksonConfiguration,
                                     @Nullable JsonFactory jsonFactory) {

        ObjectMapper objectMapper = jsonFactory != null ? new ObjectMapper(jsonFactory) : new ObjectMapper();

        final boolean hasConfiguration = jacksonConfiguration != null;
        if (!hasConfiguration || jacksonConfiguration.isModuleScan()) {
            objectMapper.findAndRegisterModules();
        }
        objectMapper.registerModules(jacksonModules);
        SimpleModule module = new SimpleModule(MICRONAUT_MODULE);
        for (JsonSerializer serializer : serializers) {
            Class<? extends JsonSerializer> type = serializer.getClass();
            Type annotation = type.getAnnotation(Type.class);
            if (annotation != null) {
                Class[] value = annotation.value();
                for (Class aClass : value) {
                    module.addSerializer(aClass, serializer);
                }
            } else {
                Optional<Class> targetType = GenericTypeUtils.resolveSuperGenericTypeArgument(type);
                if (targetType.isPresent()) {
                    module.addSerializer(targetType.get(), serializer);
                } else {
                    module.addSerializer(serializer);
                }
            }
        }

        for (JsonDeserializer deserializer : deserializers) {
            Class<? extends JsonDeserializer> type = deserializer.getClass();
            Type annotation = type.getAnnotation(Type.class);
            if (annotation != null) {
                Class[] value = annotation.value();
                for (Class aClass : value) {
                    module.addDeserializer(aClass, deserializer);
                }
            } else {
                Optional<Class> targetType = GenericTypeUtils.resolveSuperGenericTypeArgument(type);
                targetType.ifPresent(aClass -> module.addDeserializer(aClass, deserializer));
            }
        }
        objectMapper.registerModule(module);

        for (BeanSerializerModifier beanSerializerModifier : beanSerializerModifiers) {
            objectMapper.setSerializerFactory(
                objectMapper.getSerializerFactory().withSerializerModifier(
                    beanSerializerModifier
                ));
        }

        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
        objectMapper.configure(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS, true);

        if (hasConfiguration) {

            ObjectMapper.DefaultTyping defaultTyping = jacksonConfiguration.getDefaultTyping();
            if (defaultTyping != null) {
                objectMapper.enableDefaultTyping(defaultTyping);
            }

            JsonInclude.Include include = jacksonConfiguration.getSerializationInclusion();
            if (include != null) {
                objectMapper.setSerializationInclusion(include);
            }
            String dateFormat = jacksonConfiguration.getDateFormat();
            if (dateFormat != null) {
                objectMapper.setDateFormat(new SimpleDateFormat(dateFormat));
            }
            Locale locale = jacksonConfiguration.getLocale();
            if (locale != null) {
                objectMapper.setLocale(locale);
            }
            TimeZone timeZone = jacksonConfiguration.getTimeZone();
            if (timeZone != null) {
                objectMapper.setTimeZone(timeZone);
            }
            PropertyNamingStrategy propertyNamingStrategy = jacksonConfiguration.getPropertyNamingStrategy();
            if (propertyNamingStrategy != null) {
                objectMapper.setPropertyNamingStrategy(propertyNamingStrategy);
            }
            
            jacksonConfiguration.getSerializationSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getDeserializationSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getMapperSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getParserSettings().forEach(objectMapper::configure);
            jacksonConfiguration.getGeneratorSettings().forEach(objectMapper::configure);
        }
        return objectMapper;
    }