/v3.2/nimbits-android/src/com/nimbits/android/json/GsonFactory.java

http://nimbits-server.googlecode.com/ · Java · 40 lines · 13 code · 9 blank · 18 comment · 1 complexity · 061346dbbf6813d44dd9d20aafb83fb1 MD5 · raw file

  1. /*
  2. * Copyright (c) 2010 Tonic Solutions LLC.
  3. *
  4. * http://www.nimbits.com
  5. *
  6. *
  7. * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
  8. *
  9. * http://www.gnu.org/licenses/gpl.html
  10. *
  11. * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  12. */
  13. package com.nimbits.android.json;
  14. import com.google.gson.Gson;
  15. import com.google.gson.GsonBuilder;
  16. import com.nimbits.client.model.Const;
  17. /**
  18. * Created by bsautner
  19. * User: benjamin
  20. * Date: 7/12/11
  21. * Time: 10:02 PM
  22. */
  23. public class GsonFactory {
  24. private static Gson instance;
  25. public static Gson getInstance() {
  26. if (instance==null ) {
  27. instance = new GsonBuilder().setDateFormat(Const.GSON_DATE_FORMAT).serializeNulls().create();
  28. }
  29. return instance;
  30. }
  31. }