MCPcopy Index your code
hub / github.com/OpenFeign/feign / decodeBody

Method decodeBody

json/src/main/java/feign/json/JsonDecoder.java:88–99  ·  view source on GitHub ↗
(Response response, Type type, Reader reader)

Source from the content-addressed store, hash-verified

86 }
87
88 private Object decodeBody(Response response, Type type, Reader reader) throws IOException {
89 if (String.class.equals(type)) return Util.toString(reader);
90 JSONTokener tokenizer = new JSONTokener(reader);
91 if (Map.class.equals(type)) return new JSONObject(tokenizer).toMap();
92 else if (JSONObject.class.isAssignableFrom((Class<?>) type)) return new JSONObject(tokenizer);
93 else if (JSONArray.class.isAssignableFrom((Class<?>) type)) return new JSONArray(tokenizer);
94 else
95 throw new DecodeException(
96 response.status(),
97 format("%s is not a type supported by this decoder.", type),
98 response.request());
99 }
100
101 @Override
102 public Object convert(Object object, Type type) throws IOException {

Callers 1

decodeMethod · 0.95

Implementers 6

MoshiDecodermoshi/src/main/java/feign/moshi/MoshiD
JacksonJrDecoderjackson-jr/src/main/java/feign/jackson
Jackson3Decoderjackson3/src/main/java/feign/jackson3/
Fastjson2Decoderfastjson2/src/main/java/feign/fastjson
JacksonDecoderjackson/src/main/java/feign/jackson/Ja
GsonDecodergson/src/main/java/feign/gson/GsonDeco

Calls 6

toStringMethod · 0.95
formatMethod · 0.80
equalsMethod · 0.45
toMapMethod · 0.45
statusMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected