use of org.apache.cxf.jaxrs.model.ProviderInfo in project cxf by apache.
the class ProviderFactory method createMessageBodyWriterInterceptor.
public <T> List<WriterInterceptor> createMessageBodyWriterInterceptor(Class<T> bodyType, Type parameterType, Annotation[] parameterAnnotations, MediaType mediaType, Message m, Set<String> names) {
MessageBodyWriter<T> mw = createMessageBodyWriter(bodyType, parameterType, parameterAnnotations, mediaType, m);
int size = writerInterceptors.size();
if (mw != null || size > 0) {
@SuppressWarnings({ "unchecked", "rawtypes" }) WriterInterceptor mbwWriter = new WriterInterceptorMBW((MessageBodyWriter) mw, m);
final List<WriterInterceptor> interceptors;
if (size > 0) {
interceptors = new ArrayList<>(size + 1);
List<ProviderInfo<WriterInterceptor>> writers = getBoundFilters(writerInterceptors, names);
for (ProviderInfo<WriterInterceptor> p : writers) {
injectContextValues(p, m);
interceptors.add(p.getProvider());
}
interceptors.add(mbwWriter);
} else {
interceptors = Collections.singletonList(mbwWriter);
}
return interceptors;
}
return null;
}
Aggregations