- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果 ByteArrayToObject 返回 String,它的用途是什么?
在我的流程中,我正在使用 mule 请求器从文件中读取 Json 内容,通过执行以下 3 个步骤在数据编织之前转换为 java.lang.Object (1) 字节数组转字符串 (2) 对象转JSON (3) JSONTOObject
我想使用 ByteArrayToObject 转换器将上述 3 个步骤合并为一个,但根据文档,ByteArrayToObject 返回 String
https://docs.mulesoft.com/mule-user-guide/v/3.6/using-transformers
有没有办法将 3 个步骤合并为 1 个步骤?
最佳答案
您无法将有效负载转换为 java.lang.Object,因为它已经是 java.lang.Object 的实例。在Java中,所有对象都继承Object :类对象是类层次结构的根。每个类都有 Object 作为父类(super class),
如果您正在从文件中读取 JSON 内容,并且想要将内容转换为某个类实例,例如 com.mycompany.Apple,您可以直接使用 JSONToObject Transformer,指定 >returnClass 参数
<json:json-to-object-transformer returnClass="com.mycompany.Apple" doc:name="JSON to Apple"/>
您可能想看看 native Json support documentation
根据文档,ByteArrayToObject 可以以两种方式使用:
关于mule - 一步将 ByteArray 转换为 java.lang.Object,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40664108/
我已按照以下步骤将 firebase 添加到我们的 xamarin(表单)应用程序:https://learn.microsoft.com/en-us/xamarin/android/data-clo
我是一名优秀的程序员,十分优秀!