private void addMediaTypes ( final MethodResult methodResult , final ClassResult classResult , final ResourceMethod resourceMethod ) { // accept media types -> inherit resourceMethod . getRequestMediaTypes ( ) . addAll ( methodResult . getRequestMediaTypes ( ) ) ; if ( resourceMethod . getRequestMediaTypes ( ) . isEmpty ( ) ) { resourceMethod . getRequestMediaTypes ( ) . addAll ( classResult . getRequestMediaTypes ( ) ) ; } // response media types -> use annotations if not yet present if ( resourceMethod . getResponseMediaTypes ( ) . isEmpty ( ) ) resourceMethod . getResponseMediaTypes ( ) . addAll ( methodResult . getResponseMediaTypes ( ) ) ; // -> inherit if ( resourceMethod . getResponseMediaTypes ( ) . isEmpty ( ) ) { resourceMethod . getResponseMediaTypes ( ) . addAll ( classResult . getResponseMediaTypes ( ) ) ; } }
Adds the request and response media type information to the resource method .