| 103 | |
| 104 | // Fast Binary Encoding base JSON engine |
| 105 | public final class Json |
| 106 | { |
| 107 | private static final com.google.gson.Gson _engine; |
| 108 | |
| 109 | // Get the JSON engine |
| 110 | public static com.google.gson.Gson getEngine() { return _engine; } |
| 111 | |
| 112 | static |
| 113 | { |
| 114 | _engine = register(new com.google.gson.GsonBuilder()).create(); |
| 115 | } |
| 116 | |
| 117 | private Json() {} |
| 118 | |
| 119 | public static com.google.gson.GsonBuilder register(com.google.gson.GsonBuilder builder) |
| 120 | { |
| 121 | builder.serializeNulls(); |
| 122 | builder.registerTypeAdapter(java.nio.ByteBuffer.class, new ByteBufferJson()); |
| 123 | builder.registerTypeAdapter(char.class, new CharacterJson()); |
| 124 | builder.registerTypeAdapter(Character.class, new CharacterJson()); |
| 125 | builder.registerTypeAdapter(java.util.Date.class, new DateJson()); |
| 126 | builder.registerTypeAdapter(java.time.Instant.class, new InstantJson()); |
| 127 | builder.registerTypeAdapter(java.math.BigDecimal.class, new BigDecimalJson()); |
| 128 | builder.registerTypeAdapter(java.util.UUID.class, new UUIDJson()); |
| 129 | return builder; |
| 130 | } |
| 131 | } |