本文介绍了春季消息传递将json字符串转换为地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用Spring Integration,我有一个json字符串(见下文)和以下代码:
Using Spring Integration and I have a json string (see below) and the following code:
public SomethingBean convert(Message<?> inMessage) {...}Json字符串
{ "addressIdentification": { "identifierType": "nemtom", "addressIdentifier": "eztse" }, "postcode": "BH1EH", "country": "5" }我想使用以下方法签名:
I'd like to use the following method signature:
public SomethingBean convert(Message<Map<String, ?>> inMessage) {...}是否可以将json字符串自动转换为Map?
Is it possible to convert the json string to Map automatically?
谢谢, V.
推荐答案只需使用Spring Integration即可使用的组件:
Just use Spring Integration out of the box component:
<json-to-object-trnsfrormer type="java.util.Map"/>在您调用SomethingBean之前.
更多推荐
春季消息传递将json字符串转换为地图
发布评论