いつもお世話になっております。
Springが提供しているサポートクラスについて質問があります。
下記のようなSpringが提供しているサポートクラスを作成しました
java
1package com.tuyano.springboot.json; 2import org.springframework.context.annotation.Bean; 3import org.springframework.context.annotation.Configuration; 4import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; 5 6import com.fasterxml.jackson.databind.ObjectMapper; 7 8@Configuration 9public class JacksonConfigure { 10 @Bean 11 protected ObjectMapper objectMapper() { 12 return Jackson2ObjectMapperBuilder.json()..failOnEmptyBeans(true).indentOutput(true).build(); 13 } 14}
JSONとJavaオブジェクトを相互変換するために上記のようなサポートクラスを作成したのですが、いまいち使い方がわかりません。
上記のサポートクラスをどのようにして他のクラスに適用させたりして
JSONとJavaオブジェクトを相互変換したらいいでしょうか?
以上、宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/23 07:19