FxGsonBuilder.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:fx-gson 作者:
/**
 * Creates a {@link GsonBuilder} instance pre-configured based on the current configuration. This method is NOT free
 * of side-effects to this {@code FxGsonBuilder} instance and hence should not be called multiple times.
 *
 * @return an instance of GsonBuilder configured with the options currently set in this builder
 */
public GsonBuilder builder() {
    // serialization of nulls is necessary to have properties with null values deserialized properly
    builder.serializeNulls()
           .registerTypeAdapter(ObservableList.class, new ObservableListCreator())
           .registerTypeAdapter(ObservableSet.class, new ObservableSetCreator())
           .registerTypeAdapter(ObservableMap.class, new ObservableMapCreator())
           .registerTypeAdapterFactory(new JavaFxPropertyTypeAdapterFactory(strictProperties, strictPrimitives));
    if (includeExtras) {
        builder.registerTypeAdapterFactory(new JavaFxExtraTypeAdapterFactory());
    }
    return builder;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号