public void testIncrementalPojoReading() throws IOException {
  JsonFactory jf=new MappingJsonFactory();
  final String JSON="[ 1, true, null, \"abc\" ]";
  JsonParser jp=jf.createJsonParser(new StringReader(JSON));
  assertToken(JsonToken.START_ARRAY,jp.nextToken());
  assertToken(JsonToken.VALUE_NUMBER_INT,jp.nextToken());
  assertEquals(Integer.valueOf(1),jp.readValueAs(Integer.class));
  assertEquals(Boolean.TRUE,jp.readValueAs(Boolean.class));
  assertNull(jp.readValueAs(Object.class));
  assertEquals(JsonToken.VALUE_NULL,jp.getLastClearedToken());
  assertEquals("abc",jp.readValueAs(String.class));
  assertNull(jp.readValueAs(Object.class));
  assertEquals(JsonToken.END_ARRAY,jp.getLastClearedToken());
  assertNull(jp.nextToken());
  jp.close();
}

public void testIncrementalPojoReading ( ) throws IOException { JsonFactory jf = new MappingJsonFactory ( ) ; final String JSON = "[ 1, true, null, \"abc\" ]" ; JsonParser jp = jf . createJsonParser ( new StringReader ( JSON ) ) ; assertToken ( JsonToken . START_ARRAY , jp . nextToken ( ) ) ; assertToken ( JsonToken . VALUE_NUMBER_INT , jp . nextToken ( ) ) ; assertEquals ( Integer . valueOf ( 1 ) , jp . readValueAs ( Integer . class ) ) ; assertEquals ( Boolean . TRUE , jp . readValueAs ( Boolean . class ) ) ; assertNull ( jp . readValueAs ( Object . class ) ) ; assertEquals ( JsonToken . VALUE_NULL , jp . getLastClearedToken ( ) ) ; assertEquals ( "abc" , jp . readValueAs ( String . class ) ) ; assertNull ( jp . readValueAs ( Object . class ) ) ; assertEquals ( JsonToken . END_ARRAY , jp . getLastClearedToken ( ) ) ; assertNull ( jp . nextToken ( ) ) ; jp . close ( ) ; }
test similar to above , but instead reads a sequence of values
