| 9 | |
| 10 | // Fast Binary Encoding proto JSON engine |
| 11 | public final class Json |
| 12 | { |
| 13 | private static final com.google.gson.Gson _engine; |
| 14 | |
| 15 | // Get the JSON engine |
| 16 | public static com.google.gson.Gson getEngine() { return _engine; } |
| 17 | |
| 18 | static |
| 19 | { |
| 20 | _engine = register(new com.google.gson.GsonBuilder()).create(); |
| 21 | } |
| 22 | |
| 23 | private Json() {} |
| 24 | |
| 25 | public static com.google.gson.GsonBuilder register(com.google.gson.GsonBuilder builder) |
| 26 | { |
| 27 | com.chronoxor.fbe.Json.register(builder); |
| 28 | builder.registerTypeAdapter(com.chronoxor.proto.OrderSide.class, new OrderSideJson()); |
| 29 | builder.registerTypeAdapter(com.chronoxor.proto.OrderType.class, new OrderTypeJson()); |
| 30 | builder.registerTypeAdapter(com.chronoxor.proto.State.class, new StateJson()); |
| 31 | return builder; |
| 32 | } |
| 33 | } |