类 JacksonAdvice


  • public final class JacksonAdvice
    extends Object
    作者:
    qiushui on 2020-09-15.
    • 构造器详细资料

      • JacksonAdvice

        public JacksonAdvice()
    • 方法详细资料

      • defaultObjectMapper

        public static com.fasterxml.jackson.databind.ObjectMapper defaultObjectMapper()
        常用默认的ObjectMapper配置
      • serializeQuietly

        public static String serializeQuietly​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                              Object object,
                                              boolean pretty)
        安静地序列化
      • deserializeValue

        public static <T> T deserializeValue​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                             com.fasterxml.jackson.databind.JsonNode rootNode,
                                             String expressionValue,
                                             Class<T> clazz)
        用表达式从json中取值
      • deserializeArray

        public static <T> T[] deserializeArray​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                               com.fasterxml.jackson.databind.JsonNode rootNode,
                                               String expressionValue,
                                               Class<T> clazz)
        用表达式从json中取数组
      • deserializeList

        public static <T> List<T> deserializeList​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                  com.fasterxml.jackson.databind.JsonNode rootNode,
                                                  String expressionValue,
                                                  Class<T> clazz)
        用表达式从json中取列表
      • deserializeValues

        @SafeVarargs
        public static Object[] deserializeValues​(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                 com.fasterxml.jackson.databind.JsonNode rootNode,
                                                 KeyValuePair<String,​Class<?>>... expressionValues)