类 JacksonHelper

java.lang.Object
cool.scx.common.jackson.JacksonHelper

public final class JacksonHelper extends Object
JacksonHelper
版本:
0.0.1
作者:
scx567888
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    static <M extends com.fasterxml.jackson.databind.ObjectMapper, B extends com.fasterxml.jackson.databind.cfg.MapperBuilder<M, B>>
    M
    createObjectMapper(com.fasterxml.jackson.databind.cfg.MapperBuilder<M,B> mapperBuilder, BuildOptions o)
    根据 MapperBuilder 获取 ObjectMapper 对象 并对默认属性进行一些设置,具体如下 如需获得原始的 ObjectMapper 对象请使用 MapperBuilder; 自行创建 1, 针对 LocalDateTime 类型设置默认的日期格式化格式 默认为 ScxDateTimeFormatter.yyyy_MM_dd_HH_mm_ss 决定 2, DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES 设置为 false 3, SerializationFeature.FAIL_ON_EMPTY_BEANS 设置为 false 4, NullKeySerializer 设置为 JacksonHelper.NULL_KEY_SERIALIZER
    static com.fasterxml.jackson.databind.ser.FilterProvider
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

    • JacksonHelper

      public JacksonHelper()
  • 方法详细资料

    • createObjectMapper

      public static <M extends com.fasterxml.jackson.databind.ObjectMapper, B extends com.fasterxml.jackson.databind.cfg.MapperBuilder<M, B>> M createObjectMapper(com.fasterxml.jackson.databind.cfg.MapperBuilder<M,B> mapperBuilder, BuildOptions o)
      根据 MapperBuilder 获取 ObjectMapper 对象 并对默认属性进行一些设置,具体如下 如需获得原始的 ObjectMapper 对象请使用 MapperBuilder; 自行创建 1, 针对 LocalDateTime 类型设置默认的日期格式化格式 默认为 ScxDateTimeFormatter.yyyy_MM_dd_HH_mm_ss 决定 2, DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES 设置为 false 3, SerializationFeature.FAIL_ON_EMPTY_BEANS 设置为 false 4, NullKeySerializer 设置为 JacksonHelper.NULL_KEY_SERIALIZER
      类型参数:
      M - a M class
      B - a B class
      参数:
      mapperBuilder - a MapperBuilder object
      返回:
      a ObjectMapper object
    • getFilterProvider

      public static com.fasterxml.jackson.databind.ser.FilterProvider getFilterProvider(FieldFilter fieldFilter)