public static Object createHttpContextValue(Message m, Class<?> clazz) {
if (UriInfo.class.isAssignableFrom(clazz)) {
MultivaluedMap<String, String> templateParams =
(MultivaluedMap<String, String>)m.get(URITemplate.TEMPLATE_PARAMETERS);
return new UriInfoImpl(m, templateParams);
}
if (HttpHeaders.class.isAssignableFrom(clazz)) {
return new HttpHeadersImpl(m);
}
if (Request.class.isAssignableFrom(clazz)) {