public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final Csv.Context ctx = (Csv.Context) config.actualContext(fromServer.getContentType(), Csv.Context.ID); return ctx.makeReader(fromServer.getReader()).readAll(); } catch(IOException e) { throw new RuntimeException(e); } }
/** * Used to parse the server response content using the Jackson JSON parser. * * @param config the configuration * @param fromServer the server content accessor * @return the parsed object */ @SuppressWarnings("WeakerAccess") public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final ObjectMapper mapper = (ObjectMapper) config.actualContext(fromServer.getContentType(), OBJECT_MAPPER_ID); return mapper.readValue(fromServer.getReader(), config.getChainedResponse().getType()); } catch (IOException e) { throw new RuntimeException(e); } }
/** * Used to parse the server response content using the Jackson JSON parser. * * @param config the configuration * @param fromServer the server content accessor * @return the parsed object */ @SuppressWarnings("WeakerAccess") public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final ObjectMapper mapper = (ObjectMapper) config.actualContext(fromServer.getContentType(), OBJECT_MAPPER_ID); return mapper.readValue(fromServer.getReader(), config.getChainedResponse().getType()); } catch (IOException e) { throw new TransportingException(e); } }
/** * Used to parse the server response content using the OpenCsv parser. * * @param config the configuration * @param fromServer the server content accessor * @return the parsed object */ public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final Csv.Context ctx = (Csv.Context) config.actualContext(fromServer.getContentType(), Csv.Context.ID); return ctx.makeReader(fromServer.getReader()).readAll(); } catch (IOException e) { throw new TransportingException(e); } }
/** * Used to parse the server response content using the Jackson JSON parser. * * @param config the configuration * @param fromServer the server content accessor * @return the parsed object */ @SuppressWarnings("WeakerAccess") public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final ObjectMapper mapper = (ObjectMapper) config.actualContext(fromServer.getContentType(), OBJECT_MAPPER_ID); return mapper.readValue(fromServer.getReader(), config.getChainedResponse().getType()); } catch (IOException e) { throw new TransportingException(e); } }
/** * Used to parse the server response content using the OpenCsv parser. * * @param config the configuration * @param fromServer the server content accessor * @return the parsed object */ public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final Csv.Context ctx = (Csv.Context) config.actualContext(fromServer.getContentType(), Csv.Context.ID); return ctx.makeReader(fromServer.getReader()).readAll(); } catch (IOException e) { throw new TransportingException(e); } }