クラス SecurityJackson2Modules
java.lang.ObjectSE
org.springframework.security.jackson2.SecurityJackson2Modules
このユーティリティクラスは、クラスパス内のすべての SecurityModules を検索します。
ObjectMapper mapper = new ObjectMapper();
mapper.registerModules(SecurityJackson2Modules.getModules());
上記のコードは以下と同等です
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL, JsonTypeInfo.As.PROPERTY);
mapper.registerModule(new CoreJackson2Module());
mapper.registerModule(new CasJackson2Module());
mapper.registerModule(new WebJackson2Module());
mapper.registerModule(new WebServletJackson2Module());
mapper.registerModule(new WebServerJackson2Module());
mapper.registerModule(new OAuth2ClientJackson2Module());
mapper.registerModule(new Saml2Jackson2Module());
- 導入:
- 4.2
メソッドのサマリー
修飾子と型メソッド説明static voidenableDefaultTyping(com.fasterxml.jackson.databind.ObjectMapper mapper) static ListSE<com.fasterxml.jackson.databind.Module>getModules(ClassLoaderSE loader)
メソッドの詳細
enableDefaultTyping
public static void enableDefaultTyping(com.fasterxml.jackson.databind.ObjectMapper mapper) getModules
- パラメーター:
loader- 使用する ClassLoader- 戻り値:
- クラスパスで使用可能なセキュリティモジュールのリスト。