类 MappingJackson2CborHttpMessageConverter
- 所有已实现的接口:
GenericHttpMessageConverter<Object>,HttpMessageConverter<Object>
HttpMessageConverter that can read and write the CBOR
data format using
the dedicated Jackson 2.x extension.
By default, this converter supports the MediaType.APPLICATION_CBOR_VALUE
media type. This can be overridden by setting the supportedMediaTypes property.
The default constructor uses the default configuration provided by
Jackson2ObjectMapperBuilder.
Compatible with Jackson 2.9 to 2.12
- 从以下版本开始:
- 4.0
- 作者:
- Sebastien Deleuze
-
字段概要
从类继承的字段 cn.taketoday.http.converter.json.AbstractJackson2HttpMessageConverter
defaultObjectMapper从类继承的字段 cn.taketoday.http.converter.AbstractHttpMessageConverter
logger -
构造器概要
构造器构造器说明Construct a newMappingJackson2CborHttpMessageConverterusing the default configuration provided byJackson2ObjectMapperBuilder.MappingJackson2CborHttpMessageConverter(ObjectMapper objectMapper) Construct a newMappingJackson2CborHttpMessageConverterwith a customObjectMapper(must be configured with aCBORFactoryinstance). -
方法概要
修饰符和类型方法说明voidsetObjectMapper(ObjectMapper objectMapper) Configure the mainObjectMapperto use for Object conversion.从类继承的方法 cn.taketoday.http.converter.json.AbstractJackson2HttpMessageConverter
canRead, canRead, canWrite, customizeReader, customizeWriter, getCharset, getContentLength, getDefaultContentType, getJavaType, getJsonEncoding, getMediaTypesForProblemDetail, getObjectMapper, getObjectMappersForType, getSupportedMediaTypes, logWarningIfNecessary, read, readInternal, registerObjectMappersForType, setPrettyPrint, writeInternal, writePrefix, writeSuffix从类继承的方法 cn.taketoday.http.converter.AbstractGenericHttpMessageConverter
canWrite, supports, write, writeInternal从类继承的方法 cn.taketoday.http.converter.AbstractHttpMessageConverter
addDefaultHeaders, canRead, canWrite, getDefaultCharset, getSupportedMediaTypes, read, setDefaultCharset, setSupportedMediaTypes, write从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 cn.taketoday.http.converter.HttpMessageConverter
getSupportedMediaTypes, read, write
-
构造器详细资料
-
MappingJackson2CborHttpMessageConverter
public MappingJackson2CborHttpMessageConverter()Construct a newMappingJackson2CborHttpMessageConverterusing the default configuration provided byJackson2ObjectMapperBuilder. -
MappingJackson2CborHttpMessageConverter
Construct a newMappingJackson2CborHttpMessageConverterwith a customObjectMapper(must be configured with aCBORFactoryinstance).You can use
Jackson2ObjectMapperBuilderto build it easily.
-
-
方法详细资料
-
setObjectMapper
Configure the mainObjectMapperto use for Object conversion. If not set, a defaultObjectMapperinstance is created.Setting a custom-configured
ObjectMapperis one way to take further control of the JSON serialization process. For example, an extendedSerializerFactorycan be configured that provides custom serializers for specific types. Another option for refining the serialization process is to use Jackson's provided annotations on the types to be serialized, in which case a custom-configured ObjectMapper is unnecessary. TheObjectMappermust be configured with aCBORFactoryinstance.
-