@Override public MediaType getMediaType() { return jaxrsResponse.getMediaType(); }
public static MediaType getResponseMediaType(BuiltResponse jaxrsResponse, HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory, ResourceMethodInvoker method) { MediaType mt = null; if (!jaxrsResponse.isClosed() && jaxrsResponse.getEntity() != null) { if ((mt = jaxrsResponse.getMediaType()) == null) { mt = getDefaultContentType(request, jaxrsResponse, providerFactory, method); } boolean addCharset = true; ResteasyDeployment deployment = ResteasyContext.getContextData(ResteasyDeployment.class); if (deployment != null) { addCharset = deployment.isAddCharset(); } if (addCharset) { if (!mt.getParameters().containsKey(MediaType.CHARSET_PARAMETER)) { if (MediaTypeHelper.isTextLike(mt)) { mt = mt.withCharset(StandardCharsets.UTF_8.toString()); } } } } return mt; }
@Override public MediaType getMediaType() { return jaxrsResponse.getMediaType(); }
@Override public MediaType getMediaType() { return jaxrsResponse.getMediaType(); }
Annotation[] annotations = jaxrsResponse.getAnnotations(); @SuppressWarnings(value = "unchecked") final MediaType mt = jaxrsResponse.getMediaType(); MessageBodyWriter writer = providerFactory.getMessageBodyWriter( type, generic, annotations, mt);
if (jaxrsResponse.getMediaType() == null)
public static MediaType getResponseMediaType(BuiltResponse jaxrsResponse, HttpRequest request, HttpResponse response, ResteasyProviderFactory providerFactory, ResourceMethodInvoker method) { MediaType mt = null; if (!jaxrsResponse.isClosed() && jaxrsResponse.getEntity() != null) { if ((mt = jaxrsResponse.getMediaType()) == null) { mt = getDefaultContentType(request, jaxrsResponse, providerFactory, method); } boolean addCharset = true; ResteasyDeployment deployment = ResteasyContext.getContextData(ResteasyDeployment.class); if (deployment != null) { addCharset = deployment.isAddCharset(); } if (addCharset) { if (!mt.getParameters().containsKey(MediaType.CHARSET_PARAMETER)) { if (MediaTypeHelper.isTextLike(mt)) { mt = mt.withCharset(StandardCharsets.UTF_8.toString()); } } } } return mt; }
.mediaType(builtResponse.getMediaType()) .data(builtResponse.getEntityClass(), builtResponse.getEntity()) .build();
Annotation[] annotations = jaxrsResponse.getAnnotations(); @SuppressWarnings(value = "unchecked") final MediaType mt = jaxrsResponse.getMediaType(); MessageBodyWriter writer = providerFactory.getMessageBodyWriter( type, generic, annotations, mt);
Annotation[] annotations = jaxrsResponse.getAnnotations(); @SuppressWarnings(value = "unchecked") final MediaType mt = jaxrsResponse.getMediaType(); MessageBodyWriter writer = providerFactory.getMessageBodyWriter( type, generic, annotations, mt);