Class HttpRequestHandler
java.lang.Object
dev.voidframework.web.server.http.HttpRequestHandler
Http request handler.
- Since:
- 1.0.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpRequestHandler(com.google.inject.Injector injector, ErrorHandler errorHandler, List<Class<? extends Filter>> globalFilterClassTypes) Build a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertValuesToParameterTypeArray(List<String> valueList, Class<?> parameterTypeClass) Try to convert multiple values from a String into an array of needed parameter type.protected ObjectconvertValueToParameterType(String value, Class<?> parameterTypeClass) Try to convert value from a String into the needed parameter type.onBadRequest(Context context, HttpException.BadRequest cause) This method is called each time a bad request occur.onRouteRequest(Context context) This method is called each time the framework need to route a request.
-
Field Details
-
EMPTY_FALLBACK_VALUE
- See Also:
-
-
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 instanceerrorHandler- The error handler to useglobalFilterClassTypes- The global filter class types- Since:
- 1.0.0
-
-
Method Details
-
onBadRequest
This method is called each time a bad request occur.- Parameters:
context- The current contextcause- The cause (OPTIONAL)- Returns:
- A result
- Since:
- 1.0.0
-
onRouteRequest
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
Try to convert value from a String into the needed parameter type.- Parameters:
value- The string containing the value to convertparameterTypeClass- 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 convertparameterTypeClass- The needed output parameter type class- Returns:
- The converter values as array, otherwise, null
- Since:
- 1.3.0
-