com.fatboyindustrial.gsonjodatime.Converters Java Examples

The following examples show how to use com.fatboyindustrial.gsonjodatime.Converters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: WebIDE-Backend   Author: Coding   File: WebConfig.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private Gson gson() {
    final GsonBuilder builder = new GsonBuilder();
    // support swagger json
    builder.registerTypeAdapter(Json.class, new SpringfoxJsonToGsonAdapter());

    return Converters.registerDateTime(builder).create();
}
 
Example #2
Source Project: WebIDE-Backend   Author: Coding   File: WebSocketConfig.java    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public boolean configureMessageConverters(List<MessageConverter> messageConverters) {
    messageConverters.add(new StringMessageConverter());
    messageConverters.add(new ByteArrayMessageConverter());

    GsonMessageConverter gsonMessageConverter = new GsonMessageConverter();
    gsonMessageConverter.setGson(Converters.registerDateTime(new GsonBuilder()).create());
    messageConverters.add(gsonMessageConverter);

    return false;
}
 
Example #3
Source Project: android-rxmvp-tutorial   Author: patrick-doyle   File: GsonModule.java    License: Apache License 2.0 5 votes vote down vote up
@AppScope
@Provides
public Gson context() {
  return Converters.registerAll(new GsonBuilder())
      .registerTypeAdapterFactory(GithubAdapterFactory.create())
      .create();
}
 
Example #4
Source Project: android-rxmvp   Author: patrick-doyle   File: GsonModule.java    License: Apache License 2.0 5 votes vote down vote up
@AppScope
@Provides
public Gson gson() {
    GsonBuilder builder = new GsonBuilder();
    Converters.registerAll(builder);
    return builder.create();
}