public ValueReader get ( MethodParameter parameter , Class < ? extends ValueReader > byMethodDefinition , InjectionProvider provider , RoutingContext context , MediaType ... mediaTypes ) { // by type Class < ? > readerType = null ; try { // reader parameter as given Assert . notNull ( parameter , "Missing parameter!" ) ; Class < ? extends ValueReader > reader = parameter . getReader ( ) ; if ( reader != null ) { return getClassInstance ( reader , provider , context ) ; } // by value type, if body also by method/class definition or consumes media type readerType = parameter . getDataType ( ) ; ValueReader valueReader = get ( readerType , byMethodDefinition , provider , context , mediaTypes ) ; return valueReader != null ? valueReader : new GenericValueReader ( ) ; } catch ( ClassFactoryException e ) { log . error ( "Failed to provide value reader: " + readerType + ", for: " + parameter + ", falling back to GenericBodyReader() instead!" ) ; return new GenericValueReader ( ) ; } catch ( ContextException e ) { log . error ( "Failed inject context into value reader: " + readerType + ", for: " + parameter + ", falling back to GenericBodyReader() instead!" ) ; return new GenericValueReader ( ) ; } }
Step over all possibilities to provide desired reader