public void writeTo(final Object o, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType,
final MultivaluedMap<String, Object> httpHeaders, final OutputStream os) throws IOException {
final PropertyFiltering annotation = findPropertyFiltering(annotations);
final PropertyFilter propertyFilter = new PropertyFilter(uriInfo.getQueryParameters().get(annotation.using()));
if (!propertyFilter.hasFilters()) {
super.writeTo(o, type, genericType, annotations, mediaType, httpHeaders, os);
return;
}
final Timer timer = getTimer();
final Timer.Context context = timer.time();
try {
final JsonNode tree = objectMapper.valueToTree(o);
propertyFilter.filter(tree);
super.writeTo(tree, tree.getClass(), tree.getClass(), annotations, mediaType, httpHeaders, os);
} finally {
context.stop();
}
}