Java Json和基于位置的数组转换,使用jolt
我是个新手。 您能告诉我如何使用数组将下面的json消息根据在中的位置转换为下面使用jolt输出的json消息吗 输入消息:Java Json和基于位置的数组转换,使用jolt,java,json,jolt,Java,Json,Jolt,我是个新手。 您能告诉我如何使用数组将下面的json消息根据在中的位置转换为下面使用jolt输出的json消息吗 输入消息: [ ["20084541", "12020584", "Frohmann Dov", "2017", "2", "75", "T7", "DFZ", "CES", "", "", "0", "90", "2010"], ["20084541", "12020584", "Frohmann Dov", "2017", "3", "21", "T7", "DF
[
["20084541", "12020584", "Frohmann Dov", "2017", "2", "75", "T7", "DFZ", "CES", "", "", "0", "90", "2010"],
["20084541", "12020584", "Frohmann Dov", "2017", "3", "21", "T7", "DFZ", "CES", "", "", "0", "90", "2010"],
]
输出消息:
[{
"policyReference": "20084541",
"insuredId": "12020584",
"insuredName": "Frohmann Dov",
"uwy": "2017",
"subLOB": "2",
"typeOfRisk": "75",
"aircraftcountryCode": "T7",
"aircraftId": "DFZ",
"manufacturerId": "CES",
"aircraftTypeCode": "",
"aircraftSubTypeCode": "",
"aircraftValueAmt": "0",
"aircraftWorkNo": "90",
"yearBuilt": "2010"
}, {
"policyReference": "20084541",
"insuredId": "12020584",
"insuredName": "Frohmann Dov",
"uwy": "2017",
"subLOB": "2",
"typeOfRisk": "75",
"aircraftcountryCode": "T7",
"aircraftId": "DFZ",
"manufacturerId": "CES",
"aircraftTypeCode": "",
"aircraftSubTypeCode": "",
"aircraftValueAmt": "0",
"aircraftWorkNo": "90",
"yearBuilt": "2010"
}]
感谢您的帮助。Spec
[
{
"operation": "shift",
"spec": {
"*": { // loop thru the outer array
// each item of the outer array, is an array
// match individual array indicies, and then send them to the
// output with the nice name.
"0": "[&1].policyReference",
"1": "[&1].insuredId",
"2": "[&1].insuredName"
// etc
}
}
}
]
亲爱的米洛,非常感谢你的回复。效果很好。有没有一个很好的教程来理解Jolt?我在谷歌上找不到太多。我得到的是幻灯片组的链接,以及包含大量文本的Javadocs和演示站点注释示例。