private List < ContentType > getAcceptedContentTypes ( ) { Annotation consumesAnnotation = referencedMethod . getAnnotation ( Consumes . class ) ; if ( null == consumesAnnotation ) consumesAnnotation = referencedClass . getAnnotation ( Consumes . class ) ; final List < ContentType > acceptedContentTypes = Lists . newArrayList ( ) ; if ( null != consumesAnnotation ) { for ( final String cts : ( ( Consumes ) consumesAnnotation ) . value ( ) ) { try { acceptedContentTypes . add ( ContentType . valueOf ( cts ) ) ; } catch ( IllegalArgumentException e ) { } } } return acceptedContentTypes ; }
Ensure most optimal match works