private List<ConsumesMethod> getConsumingMethods(Class<?> assetType, MediaType mediaType) {
// collect all the methods that are annotated with @Consumes
List<ConsumesMethod> locators = new LinkedList<ConsumesMethod>();
Method[] methods = assetType.getMethods();
for (Method method : methods) {
Consumes annotation = method.getAnnotation(Consumes.class);
if (annotation != null) {
String[] producesArray =
AnnotationUtils.parseConsumesProducesValues(annotation.value());
List<MediaType> produces = toSortedMediaTypes(producesArray);
for (MediaType mt : produces) {
if (mt.isCompatible(mediaType)) {
ConsumesMethod consumesMethod = new ConsumesMethod(method, mt);
if (consumesMethod.getType() != null) {