@Override
protected void _modifyHeaders(Object value, Class<?> type, Type genericType, Annotation[] annotations,
MultivaluedMap<String, Object> httpHeaders, JsonEndpointConfig endpoint)
throws IOException {
super._modifyHeaders(value, type, genericType, annotations, httpHeaders, endpoint);
Map<String, String> queryParams = Util.getQueryParams(request);
if (queryParams.containsKey("accept")) {
String acc = queryParams.get("accept");
if (acc.equalsIgnoreCase("json")) {
httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
}
if (acc.equalsIgnoreCase("xml")) {
httpHeaders.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML);
}
}
}