春季消息传递将json字符串转换为地图

编程入门 行业动态 更新时间:2024-10-25 02:19:50
本文介绍了春季消息传递将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字符串转换为地图

本文发布于:2023-10-12 01:28:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483367.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   字符串   春季   消息   地图

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!