PowerJSON JSON 开发包开源项目

我要开发同款
匿名用户2015年05月12日
30阅读
开发技术C#
所属分类Web应用开发、JSON/BSON开发包
授权协议未知

作品详情

PowerJSON是fastJSON的一个扩展版本,提供一些新方法、类和接口,以及对发现的问题进行修复。详细列表请看这里。

示例代码:

// marks the internal DemoClass class deserializable[JsonSerializable]internal class DemoClass{    // marks MyProperty property to be serialized to a field named "prop"    [JsonField ("prop")]    public string MyProperty { get; set; }    // marks MyEnumProperty property to be serialized to a field named "enum"    [JsonField ("enum")]    public MyEnum MyEnumProperty { get; set; }    // marks not to serialize the Number property, if its value is 0    [System.ComponentModel.DefaultValue (0)]    public int Number { get; set; }    // marks the serialized name of Identifier will be "a", if its type is ClassA,    //     and "b" for ClassB, and "variant" for other types    [JsonField ("a", typeof (ClassA))]    [JsonField ("b", typeof (ClassB))]    [JsonField ("variant")]    public object Identifier { get; set; }    // marks the InternalValue property will not be serialized    [JsonInclude (false)]    // marks the InternalValue property will not be deserialized    [System.ComponentModel.ReadOnly (true)]    public int InternalValue { get; set; }}public enum MyEnum{    None,    // marks the serialized name of Vip to "VIP"    [JsonEnumValue ("VIP")]    Vip}
查看全文
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论