use of com.navercorp.pinpoint.web.filter.RpcType in project pinpoint by naver.
the class RpcHintJsonDeserializer method deserialize.
@Override
public RpcHint deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
final String applicationName = jp.getText();
if (jp.nextToken() != JsonToken.START_ARRAY) {
throw ctxt.mappingException(RpcHint.class, jp.getCurrentToken());
}
// skip start array
final JsonToken token = jp.nextToken();
// [] empty array
if (token == JsonToken.END_ARRAY) {
return new RpcHint(applicationName, Collections.<RpcType>emptyList());
}
final List<RpcType> rpcHintList = new ArrayList<>();
while (true) {
RpcType rpcType = jp.readValueAs(RpcType.class);
rpcHintList.add(rpcType);
if (jp.nextToken() == JsonToken.END_ARRAY) {
break;
}
}
return new RpcHint(applicationName, rpcHintList);
}