JsonValueHandler { public abstract void writeValue(T value, JsonGenerator g) throws IOException;  @SuppressWarnings({"unchecked", "rawtypes"}) static JsonValueHandler<T> getValueHandler(TypeDef type, Class<T> javaClass, SymbolMapping<T> symbolMapping, 
            boolean jsSafe, Accessor<?, ?> accessor); abstract void writeValue(T value, JsonGenerator g); abstract T readValue(JsonParser p); static final JsonValueHandler<Byte> INT8; static final JsonValueHandler<Short> INT16; static final JsonValueHandler<Integer> INT32; static final JsonValueHandler<Long> INT64; static final JsonValueHandler<Long> INT64_SAFE; static final JsonValueHandler<Byte> UINT8; static final JsonValueHandler<Short> UINT16; static final JsonValueHandler<Character> CHAR; static final JsonValueHandler<Integer> UINT32; static final JsonValueHandler<Long> UINT64; static final JsonValueHandler<Long> UINT64_SAFE; static final JsonValueHandler<String> STRING; static final JsonValueHandler<byte[]> BINARY; static final JsonValueHandler<Boolean> BOOLEAN; static final JsonValueHandler<BigDecimal> DECIMAL; static final JsonValueHandler<BigDecimal> DECIMAL_SAFE; static final JsonValueHandler<BigDecimal> BIGDECIMAL; static final JsonValueHandler<BigDecimal> BIGDECIMAL_SAFE; static final JsonValueHandler<BigInteger> BIGINT; static final JsonValueHandler<BigInteger> BIGINT_SAFE; static final JsonValueHandler<Float> FLOAT32; static final JsonValueHandler<Double> FLOAT64; }
@Test public void testSafeUInt64EncodeMaxUInt64() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.UINT64_SAFE.writeValue(-1L, g); g.flush(); assertEquals("\"18446744073709551615\"", out.toString()); }
@Test public void testUInt64EncodeMaxUInt64() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.UINT64.writeValue(-1L, g); g.flush(); assertEquals("18446744073709551615", out.toString()); }
@Test public void testSafeUInt64EncodeMaxLong() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.UINT64_SAFE.writeValue(Long.MAX_VALUE, g); g.flush(); assertEquals("\"9223372036854775807\"", out.toString()); }
@Test public void testUInt64EncodeMaxLong() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.UINT64.writeValue(Long.MAX_VALUE, g); g.flush(); assertEquals("9223372036854775807", out.toString()); }
@Test public void testSafeUInt64Encode10() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.UINT64_SAFE.writeValue(10L, g); g.flush(); assertEquals("10", out.toString()); }
@Test public void testSafeInt64EncodeMinValue() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.INT64_SAFE.writeValue(Long.MIN_VALUE, g); g.flush(); assertEquals("\"-9223372036854775808\"", out.toString()); }
@Test public void testInt64EncodeMinValue() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.INT64.writeValue(Long.MIN_VALUE, g); g.flush(); assertEquals("-9223372036854775808", out.toString()); }
@Test public void testSafeInt64EncodeMaxLong() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.INT64_SAFE.writeValue(Long.MAX_VALUE, g); g.flush(); assertEquals("\"9223372036854775807\"", out.toString()); }
@Test public void testInt64EncodeMaxLong() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.INT64.writeValue(Long.MAX_VALUE, g); g.flush(); assertEquals("9223372036854775807", out.toString()); }
@Test public void testSafeInt64Encode10() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.INT64_SAFE.writeValue(10L, g); g.flush(); assertEquals("10", out.toString()); }
@Test public void testFloat64EncodeNaN() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT64.writeValue(Double.NaN, g); g.flush(); assertEquals("\"NaN\"", out.toString()); }
@Test public void testFloat64EncodePosInfinity() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT64.writeValue(Double.POSITIVE_INFINITY, g); g.flush(); assertEquals("\"Infinity\"", out.toString()); }
@Test public void testFloat64EncodeNegInfinity() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT64.writeValue(Double.NEGATIVE_INFINITY, g); g.flush(); assertEquals("\"-Infinity\"", out.toString()); }
@Test public void testFloat32EncodeNaN() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT32.writeValue(Float.NaN, g); g.flush(); assertEquals("\"NaN\"", out.toString()); }
@Test public void testFloat32EncodePosInfinity() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT32.writeValue(Float.POSITIVE_INFINITY, g); g.flush(); assertEquals("\"Infinity\"", out.toString()); }
@Test public void testFloat32EncodeNegInfinity() throws IOException { StringWriter out = new StringWriter(); JsonGenerator g = f.createGenerator(out); JsonValueHandler.FLOAT32.writeValue(Float.NEGATIVE_INFINITY, g); g.flush(); assertEquals("\"-Infinity\"", out.toString()); }