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

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

问题描述

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

解决方案

更新:从7.02版和7.03/7.31版(内核修补程序116)开始,ABAP本机支持JSON-检查此博客. /p>

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

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?

解决方案

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.

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天全站免登陆