Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Feature_SupportNonPublicField_cn

高铁 edited this page Nov 18, 2016 · 2 revisions

在某些场景下,反序列化需要支持NonPublicField,在1.2.22 & 1.1.54.android之后提供了相应的支持。

Demo 1

public class Model {
    private int id;
}

Model model = JSON.parseObject("{\"id\":123}"
                                , Model.class
                                , Feature.SupportNonPublicField);
assertEquals(123, model.id);
Clone this wiki locally