use of com.webcohesion.enunciate.api.datatype.Syntax in project enunciate by stoicflame.
the class StatusCodeImpl method getMediaTypes.
@Override
public List<? extends MediaTypeDescriptor> getMediaTypes() {
ArrayList<MediaTypeDescriptor> mts = new ArrayList<MediaTypeDescriptor>();
DecoratedTypeMirror type = this.responseCode.getType();
if (type != null) {
RequestMapping requestMapping = this.responseCode.getRequestMapping();
Set<String> produces = requestMapping.getProducesMediaTypes();
for (String mt : produces) {
for (Syntax syntax : requestMapping.getContext().getContext().getApiRegistry().getSyntaxes(this.registrationContext)) {
MediaTypeDescriptor descriptor = syntax.findMediaTypeDescriptor(mt, type);
if (descriptor != null) {
mts.add(descriptor);
}
}
}
}
return mts;
}
Aggregations