if (entity != null) {
final MediaType respMediaType = determineMediaType(
jaxRsResponseMediaType, resourceMethod, entityClass,
genericReturnType);
final MessageBodyWriterSubSet mbws;
mbws = providers.writerSubSet(entityClass, genericReturnType);
if (mbws.isEmpty())
throw excHandler.noMessageBodyWriter(entityClass,
genericReturnType, methodAnnotations, null, null);
final MessageBodyWriter mbw = mbws.getBestWriter(respMediaType,
methodAnnotations, accMediaTypes);
if (mbw == null)
throw excHandler.noMessageBodyWriter(entityClass,
genericReturnType, methodAnnotations, respMediaType,
accMediaTypes);