Example usage for com.google.gson GsonBuilder generateNonExecutableJson

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

Introduction

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

Prototype

boolean generateNonExecutableJson

To view the source code for com.google.gson GsonBuilder generateNonExecutableJson.

Click Source Link

Usage

From source file:com.ruesga.rview.gerrit.GsonHelper.java

License:Apache License

public static GsonBuilder createGerritGsonBuilder(boolean nonExecutable,
        PlatformAbstractionLayer abstractionLayer) {
    GsonBuilder builder = new GsonBuilder().setVersion(GerritApi.API_VERSION)
            .registerTypeAdapter(Date.class, new GerritUtcDateAdapter())
            .registerTypeAdapter(ServerVersion.class, new GerritServerVersionAdapter())
            .registerTypeAdapter(ApprovalInfo.class, new GerritApprovalInfoAdapter())
            .registerTypeAdapter(Base64Data.class, new GerritBas64Adapter(abstractionLayer)).setLenient();
    if (nonExecutable) {
        builder.generateNonExecutableJson();
    }//from   w  w w .  j  a v  a 2 s  . c  o  m
    return builder;
}