Example usage for com.google.gson GsonBuilder setDateFormat

List of usage examples for com.google.gson GsonBuilder setDateFormat

Introduction

In this page you can find the example usage for com.google.gson GsonBuilder setDateFormat.

Prototype

public GsonBuilder setDateFormat(int dateStyle, int timeStyle) 

Source Link

Document

Configures Gson to to serialize Date objects according to the style value provided.

Usage

From source file:com.balajeetm.mystique.util.gson.lever.JsonLever.java

License:Open Source License

/** Instantiates a new json lever. */
protected JsonLever() {
    jsonParser = GsonFactory.getInstance().getJsonParser();
    GsonBuilder gsonBuilder = new GsonBuilder();
    gsonBuilder.setDateFormat(DateFormat.LONG, DateFormat.LONG);
    gson = gsonBuilder.create();/*from www  .  j  a  va 2 s . c  om*/
}