Class ObjectMapperBuilder
java.lang.Object
io.leandev.appfuse.json.ObjectMapperBuilder
-
Method Summary
Modifier and TypeMethodDescriptiontools.jackson.databind.ObjectMapperbuild()構建 ObjectMapper 實例static ObjectMapperBuildercreate()創建新的 ObjectMapperBuilder 實例static ObjectMapperBuilder創建具有預設配置的 ObjectMapperBuilderstatic tools.jackson.databind.ObjectMapper快速創建具有預設配置的 ObjectMapper添加Byte序列化器withDateFormat(String pattern) withDateFormat(String pattern, ZoneId zoneId) 設置日期時間格式添加自Duration序列化器withModule(tools.jackson.databind.JacksonModule customModule) 註冊自定義模組withSerializationFeature(tools.jackson.databind.SerializationFeature feature, boolean state) 添加序列化功能配置添加日期時間序列化器
-
Method Details
-
create
創建新的 ObjectMapperBuilder 實例 -
createWithDefaults
創建具有預設配置的 ObjectMapperBuilder
Jackson 3.x 已內建 Java 8 日期時間類型支援 (LocalDate、LocalDateTime、LocalTime 等)
-
withDateFormat
設置日期時間格式 -
withDateFormat
-
withZonedDateTime
添加日期時間序列化器 -
withInstant
-
withDuration
添加自Duration序列化器 -
withBytes
添加Byte序列化器 -
withSerializationFeature
public ObjectMapperBuilder withSerializationFeature(tools.jackson.databind.SerializationFeature feature, boolean state) 添加序列化功能配置 -
withModule
註冊自定義模組 -
build
public tools.jackson.databind.ObjectMapper build()構建 ObjectMapper 實例 -
defaultObjectMapper
public static tools.jackson.databind.ObjectMapper defaultObjectMapper()快速創建具有預設配置的 ObjectMapper
-