Class PulsarHeaderObjectMapperUtils
java.lang.Object
org.springframework.pulsar.annotation.PulsarHeaderObjectMapperUtils
Resolves header mapper configuration beans (object mapper and trusted packages) for
use during JSON header deserialization.
- Since:
- 1.2.0
- Author:
- Chris Bono
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<com.fasterxml.jackson.databind.ObjectMapper> customMapper(BeanFactory beanFactory) Gets the optionalObjectMapperto use when deserializing JSON header values.trustedPackages(BeanFactory beanFactory) Gets the optional trusted packages to use when deserializing JSON header values.
-
Method Details
-
customMapper
public static Optional<com.fasterxml.jackson.databind.ObjectMapper> customMapper(BeanFactory beanFactory) Gets the optionalObjectMapperto use when deserializing JSON header values. The mapper bean is expected to be registered with the name'pulsarHeaderObjectMapper'.- Parameters:
beanFactory- the bean factory that may contain the mapper bean- Returns:
- optional mapper or empty if bean not registered under the expected name
-
trustedPackages
Gets the optional trusted packages to use when deserializing JSON header values. The bean is expected to be aString[]registered with the name'pulsarHeaderTrustedPackages'. Trust is by exact package match; sub-packages must be listed explicitly. Pass"*"as the sole entry to trust all packages.- Parameters:
beanFactory- the bean factory that may contain the trusted packages bean- Returns:
- optional trusted packages or empty if bean not registered under the expected name
-