@Test public final void testDecodeNull() { JSONDecoder decoder = new JSONDecoder("[null]"); JSONValue result = decoder.decode(); TestCase.assertEquals("[null]", result.toJSON()); }
private JSONNull decodeNull() { StringBuffer sb = new StringBuffer(); sb.append(reader.current()); int i = 1; while(i < 4) { reader.next(); char temp = reader.current(); sb.append(temp); i++; } if(!"NULL".equalsIgnoreCase(sb.toString())) { System.err.print("JSON expected null value, was: " + sb.toString()); } return new JSONNull(); }
JSONDecoder { private JSONNull decodeNull() { StringBuffer sb = new StringBuffer(); sb.append(reader.current()); int i = 1; while(i < 4) { reader.next(); char temp = reader.current(); sb.append(temp); i++; } if(!"NULL".equalsIgnoreCase(sb.toString())) { System.err.print("JSON expected null value, was: " + sb.toString()); } return new JSONNull(); } }
JSONDecoder { private JSONNull decodeNull() { StringBuffer sb = new StringBuffer(); sb.append(reader.current()); int i = 1; while(i < 4) { reader.next(); char temp = reader.current(); sb.append(temp); i++; } if(!"NULL".equalsIgnoreCase(sb.toString())) { System.err.print("JSON expected null value, was: " + sb.toString()); } return new JSONNull(); } JSONDecoder(final String json); }
JSONDecoder { private JSONNull decodeNull() { StringBuffer sb = new StringBuffer(); sb.append(reader.current()); int i = 1; while(i < 4) { reader.next(); char temp = reader.current(); sb.append(temp); i++; } if(!"NULL".equalsIgnoreCase(sb.toString())) { System.err.print("JSON expected null value, was: " + sb.toString()); } return new JSONNull(); } JSONDecoder(final String json); JSONValue decode(); }
JSONDecoder { private JSONNull decodeNull() { StringBuffer sb = new StringBuffer(); sb.append(reader.current()); int i = 1; while(i < 4) { reader.next(); char temp = reader.current(); sb.append(temp); i++; } if(!"NULL".equalsIgnoreCase(sb.toString())) { System.err.print("JSON expected null value, was: " + sb.toString()); } return new JSONNull(); } JSONDecoder(final String json); JSONValue decode();  }