use of com.navercorp.pinpoint.web.filter.FilterHint in project pinpoint by naver.
the class FilterHintListJsonDeserializer method deserialize.
@Override
public FilterHint deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
if (!jp.getCurrentToken().isStructStart()) {
throw ctxt.mappingException(RpcHint.class, jp.getCurrentToken());
}
// skip json start
final JsonToken jsonToken = jp.nextToken();
if (jsonToken == JsonToken.END_OBJECT) {
return new FilterHint(Collections.<RpcHint>emptyList());
}
List<RpcHint> rpcHintList = new ArrayList<>();
while (true) {
final RpcHint rpcHint = jp.readValueAs(RpcHint.class);
rpcHintList.add(rpcHint);
if (jp.nextToken() == JsonToken.END_OBJECT) {
break;
}
}
return new FilterHint(rpcHintList);
}
Aggregations