Android Open Source - spotastop Gson Configurator

From Project

Back to project page spotastop.


The source code is released under:

MIT License

If you think the Android project spotastop listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.nicfix.gsoncompatibility;
// ww w . j  ava 2 s  .  c om
import resources.Resource;
import responses.beContentResponse;


public class GsonConfigurator {

  private GsonBuilder gsonBuilder;

  private static GsonConfigurator instance;

  public static GsonConfigurator getInstance() {
    if (instance == null) {
      instance = new GsonConfigurator();
    return instance;

  private GsonConfigurator() {
    gsonBuilder=new GsonBuilder();
        new beContentResponse());

  public Gson build() {
    return gsonBuilder.create();

  public void registerDeserializer(Resource resource, Class T) {
    gsonBuilder.registerTypeAdapter(T, resource);


Java Source Code List