converter = converterClass.newInstance();
converter.setObjectMapper(objectMapper);
Object convertedValue = converter.convertQueryParameterToType(value);
method.invoke(this, convertedValue);
} catch (InstantiationException e) {
throw new RestException(Status.INTERNAL_SERVER_ERROR, e, "Server error.");
} catch (IllegalAccessException e) {
throw new RestException(Status.INTERNAL_SERVER_ERROR, e, "Server error.");
} catch (InvocationTargetException e) {
throw new InvalidRequestException(Status.BAD_REQUEST, e, "Cannot set query parameter '" + key + "' to value '" + value + "'");
} catch (RestException e) {
throw new InvalidRequestException(e.getStatus(), e,
"Cannot set query parameter '" + key + "' to value '" + value + "': " + e.getMessage());