I'm migrating my Java web application from servlet-based to JAX-RS. Since I'm using Jboss I'll also use (by default) RESTEasy.
In my servlets I use Jackson to serialize/deserialize JSON; Jackson allows me to filter programatically the inclusion/exclusion of fields, for example:
ObjectMapper mapper = new ObjectMapper().setVisibility(JsonMethod.FIELD,
Visibility.ANY);
String[] ignorableFieldNames = { "id", "name" };
FilterProvider filters = new SimpleFilterProvider().
addFilter("f123",SimpleBeanPropertyFilter.serializeAllExcept(ignorableFieldNames));
mapper.filteredWriter(filters).writeValueAsString(object);
RESTEasy provides Jackson support, but it seems that it is embedded transparently to the developer so I'm not able to get to the low-level to include/exclude fields. Is this feasible?