// so it can be written.
return selectedMethod.produces.getCombinedMediaType();
}
private boolean isWriteable(final RequestSpecificConsumesProducesAcceptor candidate) {
final Invocable invocable = candidate.methodAcceptorPair.model.getInvocable();
final Class<?> responseType = Primitives.wrap(invocable.getRawRoutingResponseType());
if (Response.class.isAssignableFrom(responseType)
|| Void.class.isAssignableFrom(responseType)) {
return true;
}
final Type genericType = invocable.getRoutingResponseType();
final Type genericReturnType = genericType instanceof GenericType ?
((GenericType) genericType).getType() : genericType;
for (final MessageBodyWriter<?> writer : workers.getMessageBodyWritersForType(responseType)) {
if (writer.isWriteable(responseType, genericReturnType,
invocable.getHandlingMethod().getDeclaredAnnotations(),
candidate.produces.getCombinedMediaType())) {
return true;
}
}