Class HttpRequestHandler

java.lang.Object
dev.voidframework.web.server.http.HttpRequestHandler

public final class HttpRequestHandler extends Object
Http request handler.
Since:
1.0.0
  • Field Details

  • Constructor Details

    • HttpRequestHandler

      public HttpRequestHandler(com.google.inject.Injector injector, ErrorHandler errorHandler, List<Class<? extends Filter>> globalFilterClassTypes)
      Build a new instance.
      Parameters:
      injector - The injector instance
      errorHandler - The error handler to use
      globalFilterClassTypes - The global filter class types
      Since:
      1.0.0
  • Method Details

    • onBadRequest

      public Result onBadRequest(Context context, HttpException.BadRequest cause)
      This method is called each time a bad request occur.
      Parameters:
      context - The current context
      cause - The cause (OPTIONAL)
      Returns:
      A result
      Since:
      1.0.0
    • onRouteRequest

      public Result onRouteRequest(Context context)
      This method is called each time the framework need to route a request.
      Parameters:
      context - The current context
      Returns:
      A result
      Since:
      1.0.0
    • convertValueToParameterType

      protected Object convertValueToParameterType(String value, Class<?> parameterTypeClass)
      Try to convert value from a String into the needed parameter type.
      Parameters:
      value - The string containing the value to convert
      parameterTypeClass - The needed output parameter type class
      Returns:
      The converter value, otherwise, null
      Since:
      1.3.0
    • convertValuesToParameterTypeArray

      protected Object convertValuesToParameterTypeArray(List<String> valueList, Class<?> parameterTypeClass)
      Try to convert multiple values from a String into an array of needed parameter type.
      Parameters:
      valueList - The list of string containing the value to convert
      parameterTypeClass - The needed output parameter type class
      Returns:
      The converter values as array, otherwise, null
      Since:
      1.3.0