编写 JSON 序列化程序 [英] Writing JSON serializer

查看:37
本文介绍了编写 JSON 序列化程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想为一种尚不存在的语言(例如 ABAP)开发一个序列化程序,其中可能需要付出哪些努力?它是否仅涉及编写 ABAP 序列化器的文本等效" - 我将如何处理复杂的对象.最好的起点是什么?

If I want to develop a serializer for a language for which one doesnt exist already (e.g. ABAP), what could be the efforts involved in it? Does it involve merely writing "text equivalent" of ABAP serialzer - how would I tackle complex objects. What would be the best starting point for this?

推荐答案

更新: 从版本 7.02 和 7.03/7.31(内核补丁 116)开始,ABAP 原生支持 JSON - 检查 此博客,作者 Horst Keller.

Update: Starting with Releases 7.02 and 7.03/7.31 (kernel patch 116), JSON is supported natively in ABAP - check this blog by Horst Keller.

您应该首先使用 site:sap.com 搜索 ABAP 和 JSON,然后选择一个现有项目来学习和贡献.但是,如果您仍然无法获得 NIH 奖励积分,请确保您知道如何使用泛型类型、字段符号、RTTI 和由内而外的递归,然后练习使用 RTTI 递归地处理复杂的数据结构.完成此操作后,组装任何类型的输出字符串都很容易.

You should search for ABAP and JSON using site:sap.com first and then choose one of the existing projects to learn from and contribute. However, if you're still out for the NIH bonus points, make sure you know how to use generic types, field symbols, RTTI and recursion inside out, then practice walking complex data structure recursively using RTTI. Once you've done that, assembling any kind of output string is easy.

这篇关于编写 JSON 序列化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆