public interface ParameterSupplier
  • Method Details

    • provide

      Object provide(Method method, Parameter parameter, Matcher matcher, org.microhttp.Request request) throws Exception
      Supplies a value for a Parameter in a Method.

      If it is impossible to supply a value for the given parameter, a Exception should be thrown.

      If that Exception is an instance of IntoResponse then that can be used to give a specific error to the user.

      Parameters:
      method - The method being called.
      parameter - The parameter on that method.
      matcher - The regex matcher for the url. Can be used to pull out route params.
      request - The request being handled.
      Returns:
      A value for the parameter.
      Throws:
      Exception - If a value cannot be supplied.