test_class.declarator: INT_TYPE_REF = new TypeReference<Integer>() {}
test_class.modifier: private static final
test_class.original_string: private static final TypeReference<Integer> INT_TYPE_REF = new TypeReference<Integer>() {};
test_class.type: TypeReference<Integer>
test_class.var_name: INT_TYPE_REF
test_class.declarator: TEST_JSON = "{\"results\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], \"success\":true}"
test_class.modifier: public static final
test_class.original_string: public static final String TEST_JSON = "{\"results\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], \"success\":true}";
test_class.type: String
test_class.var_name: TEST_JSON
test_class.declarator: EMPTY_JSON = "{\"results\": [], \"success\":true}"
test_class.modifier: public static final
test_class.original_string: public static final String EMPTY_JSON = "{\"results\": [], \"success\":true}";
test_class.type: String
test_class.var_name: EMPTY_JSON
test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: private final
test_class.original_string: private final ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.file: client/src/test/java/com/nesscomputing/httpclient/response/TestStreamedJsonContentConverter.java
test_class.identifier: TestStreamedJsonContentConverter
test_case.body: @Test
      public void testEmpty() throws Exception
      {
          CallbackCollector<Integer> callback = new CallbackCollector<>();
          new StreamedJsonContentConverter<>(mapper, callback, INT_TYPE_REF).convert(response(200), inputStream(EMPTY_JSON));
      }
test_case.class_method_signature: TestStreamedJsonContentConverter.testEmpty()
test_case.full_signature: @Test public void testEmpty()
test_case.identifier: testEmpty
test_case.invocations: convert response inputStream
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmpty()
focal_class.declarator: LOG = Log.findLog()
focal_class.modifier: private static final
focal_class.original_string: private static final Log LOG = Log.findLog();
focal_class.type: Log
focal_class.var_name: LOG
focal_class.declarator: JSON_MAP_TYPE_REF = new TypeReference<Map<String, ? extends Object>>() {}
focal_class.modifier: private static final
focal_class.original_string: private static final TypeReference<Map<String, ? extends Object>> JSON_MAP_TYPE_REF = new TypeReference<Map<String, ? extends Object>>() {};
focal_class.type: TypeReference<Map<String, ? extends Object>>
focal_class.var_name: JSON_MAP_TYPE_REF
focal_class.declarator: mapper
focal_class.modifier: private final
focal_class.original_string: private final ObjectMapper mapper;
focal_class.type: ObjectMapper
focal_class.var_name: mapper
focal_class.declarator: typeRef
focal_class.modifier: private final
focal_class.original_string: private final TypeReference<T> typeRef;
focal_class.type: TypeReference<T>
focal_class.var_name: typeRef
focal_class.declarator: callback
focal_class.modifier: private final
focal_class.original_string: private final Callback<? super T> callback;
focal_class.type: Callback<? super T>
focal_class.var_name: callback
focal_class.file: client/src/main/java/com/nesscomputing/httpclient/response/StreamedJsonContentConverter.java
focal_class.identifier: StreamedJsonContentConverter
focal_class.class_method_signature: StreamedJsonContentConverter.of(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.full_signature: public static StreamedJsonContentConverter<Map<String, ? extends Object>> of(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.return: StreamedJsonContentConverter<Map<String, ? extends Object>>
focal_class.signature: StreamedJsonContentConverter<Map<String, ? extends Object>> of(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.class_method_signature: StreamedJsonContentConverter.handle(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.full_signature: public static HttpClientResponseHandler<Void> handle(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.identifier: handle
focal_class.modifiers: public static
focal_class.parameters: (final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.return: HttpClientResponseHandler<Void>
focal_class.signature: HttpClientResponseHandler<Void> handle(final ObjectMapper mapper, final Callback<Map<String, ? extends Object>> callback)
focal_class.class_method_signature: StreamedJsonContentConverter.handle(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeReference)
focal_class.full_signature: public static HttpClientResponseHandler<Void> handle(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeReference)
focal_class.identifier: handle
focal_class.modifiers: public static
focal_class.parameters: (final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeReference)
focal_class.return: HttpClientResponseHandler<Void>
focal_class.signature: HttpClientResponseHandler<Void> handle(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeReference)
focal_class.class_method_signature: StreamedJsonContentConverter.StreamedJsonContentConverter(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeRef)
focal_class.full_signature:   StreamedJsonContentConverter(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeRef)
focal_class.identifier: StreamedJsonContentConverter
focal_class.parameters: (final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeRef)
focal_class.signature:  StreamedJsonContentConverter(final ObjectMapper mapper, final Callback<? super T> callback, final TypeReference<T> typeRef)
focal_class.class_method_signature: StreamedJsonContentConverter.convert(final HttpClientResponse response, final InputStream inputStream)
focal_class.full_signature: @Override public Void convert(final HttpClientResponse response, final InputStream inputStream)
focal_class.identifier: convert
focal_class.modifiers: @Override public
focal_class.parameters: (final HttpClientResponse response, final InputStream inputStream)
focal_class.return: Void
focal_class.signature: Void convert(final HttpClientResponse response, final InputStream inputStream)
focal_class.class_method_signature: StreamedJsonContentConverter.expect(final JsonParser jp, final JsonToken token, final JsonToken expected)
focal_class.full_signature: private void expect(final JsonParser jp, final JsonToken token, final JsonToken expected)
focal_class.identifier: expect
focal_class.modifiers: private
focal_class.parameters: (final JsonParser jp, final JsonToken token, final JsonToken expected)
focal_class.return: void
focal_class.signature: void expect(final JsonParser jp, final JsonToken token, final JsonToken expected)
focal_class.superclass: extends AbstractErrorHandlingContentConverter<Void>
focal_method.body: @Override
      public Void convert(final HttpClientResponse response, final InputStream inputStream)
          throws IOException
      {
          switch(response.getStatusCode())
          {
          case 201:
          case 204:
              LOG.debug("Return code is %d, finishing.", response.getStatusCode());
              return null;
  
          case 200:
              try (final JsonParser jp = mapper.getFactory().createJsonParser(inputStream)) {
                  expect(jp, jp.nextToken(), JsonToken.START_OBJECT);
                  expect(jp, jp.nextToken(), JsonToken.FIELD_NAME);
                  if (!"results".equals(jp.getCurrentName())) {
                      throw new JsonParseException("expecting results field", jp.getCurrentLocation());
                  }
                  expect(jp, jp.nextToken(), JsonToken.START_ARRAY);
                  // As noted in a well-hidden comment in the MappingIterator constructor,
                  // readValuesAs requires the parser to be positioned after the START_ARRAY
                  // token with an empty current token
                  jp.clearCurrentToken();
  
                  Iterator<T> iter = jp.readValuesAs(typeRef);
  
                  while (iter.hasNext()) {
                      try {
                          callback.call(iter.next());
                      }
                      catch (CallbackRefusedException e) {
                          LOG.debug(e, "callback refused execution, finishing.");
                          return null;
                      }
                      catch (InterruptedException e) {
                          Thread.currentThread().interrupt();
                          throw new IOException("Callback interrupted", e);
                      }
                      catch (Exception e) {
                          Throwables.propagateIfPossible(e, IOException.class);
                          throw new IOException("Callback failure", e);
                      }
                  }
                  if (jp.nextValue() != JsonToken.VALUE_TRUE || !jp.getCurrentName().equals("success")) {
                      throw new IOException("Streamed receive did not terminate normally; inspect server logs for cause.");
                  }
                  return null;
              }
  
          default:
              throw throwHttpResponseException(response);
          }
      }
focal_method.class_method_signature: StreamedJsonContentConverter.convert(final HttpClientResponse response, final InputStream inputStream)
focal_method.full_signature: @Override public Void convert(final HttpClientResponse response, final InputStream inputStream)
focal_method.identifier: convert
focal_method.invocations: getStatusCode debug getStatusCode createJsonParser getFactory expect nextToken expect nextToken equals getCurrentName getCurrentLocation expect nextToken clearCurrentToken readValuesAs hasNext call next debug interrupt currentThread propagateIfPossible nextValue equals getCurrentName throwHttpResponseException
focal_method.modifiers: @Override public
focal_method.parameters: (final HttpClientResponse response, final InputStream inputStream)
focal_method.return: Void
focal_method.signature: Void convert(final HttpClientResponse response, final InputStream inputStream)