@Override
public MethodResultMessage doFilter(MethodCallMessage input, Map<String, Object> metadata) throws FilterException {
ObjectMapper objectMapper = JsonUtils.createObjectMapperWithIntroSpectors();
MethodResultMessage resultMessage;
try {
String jsonString = objectMapper.writeValueAsString(input);
String resultString = (String) next.filter(jsonString, metadata);
if (resultString == null) {
return null;
}
resultMessage = objectMapper.readValue(resultString, MethodResultMessage.class);
} catch (IOException e) {
throw new FilterException(e);
}
MethodResult result = resultMessage.getResult();
if (result.getType().equals(ReturnType.Void)) {
result.setArg(null);
} else {
Class<?> resultType;