use of com.navercorp.pinpoint.web.filter.RpcHint 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);
}
use of com.navercorp.pinpoint.web.filter.RpcHint 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);
}
Aggregations