Class ObjectMapperBuilder

java.lang.Object
io.leandev.appfuse.json.ObjectMapperBuilder

public class ObjectMapperBuilder extends Object
  • Method Details

    • create

      public static ObjectMapperBuilder create()
      創建新的 ObjectMapperBuilder 實例
    • createWithDefaults

      public static ObjectMapperBuilder createWithDefaults()

      創建具有預設配置的 ObjectMapperBuilder

      Jackson 3.x 已內建 Java 8 日期時間類型支援 (LocalDate、LocalDateTime、LocalTime 等)

    • withDateFormat

      public ObjectMapperBuilder withDateFormat(String pattern, ZoneId zoneId)
      設置日期時間格式
    • withDateFormat

      public ObjectMapperBuilder withDateFormat(String pattern)
    • withZonedDateTime

      public ObjectMapperBuilder withZonedDateTime()
      添加日期時間序列化器
    • withInstant

      public ObjectMapperBuilder withInstant()
    • withDuration

      public ObjectMapperBuilder withDuration()
      添加自Duration序列化器
    • withBytes

      public ObjectMapperBuilder withBytes()
      添加Byte序列化器
    • withSerializationFeature

      public ObjectMapperBuilder withSerializationFeature(tools.jackson.databind.SerializationFeature feature, boolean state)
      添加序列化功能配置
    • withModule

      public ObjectMapperBuilder withModule(tools.jackson.databind.JacksonModule customModule)
      註冊自定義模組
    • build

      public tools.jackson.databind.ObjectMapper build()
      構建 ObjectMapper 實例
    • defaultObjectMapper

      public static tools.jackson.databind.ObjectMapper defaultObjectMapper()
      快速創建具有預設配置的 ObjectMapper