Class HTTPRequestValidationHandler
java.lang.Object
io.vertx.mutiny.ext.web.api.validation.HTTPRequestValidationHandler
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<RoutingContext>,ValidationHandler,Consumer<RoutingContext>
public class HTTPRequestValidationHandler
extends Object
implements MutinyDelegate, ValidationHandler, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
An interface for add HTTP Request validation. This class can validate parameters inside query, path, headers an
body (watch below)
You can assign multiple body type at the same time(for example a JSON schema together with a XML schema). This interface support:
This interface allow extra parameters in the request, so it doesn't care if in a request there's a parameter without a specified validation rule
If a parameter is flagged as an array, it will be validated also if the size of array is 1 element NOTE: This class has been automatically generated from the
You can assign multiple body type at the same time(for example a JSON schema together with a XML schema). This interface support:
- application/x-www-form-urlencoded
- multipart/form-data
- application/xml
- application/json
This interface allow extra parameters in the request, so it doesn't care if in a request there's a parameter without a specified validation rule
If a parameter is flagged as an array, it will be validated also if the size of array is 1 element NOTE: This class has been automatically generated from the
original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHTTPRequestValidationHandler(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler delegate) HTTPRequestValidationHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) addCustomValidatorFunction(CustomValidator customValidator) Deprecated.addExpectedContentType(String contentType) Deprecated.addFormParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.addFormParamsArray(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.addFormParamsArrayWithPattern(String parameterName, String pattern, boolean required) Deprecated.addFormParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.addFormParamWithPattern(String parameterName, String pattern, boolean required) Deprecated.addHeaderParam(String headerName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.addHeaderParamWithCustomTypeValidator(String headerName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.addHeaderParamWithPattern(String headerName, String pattern, boolean required) Deprecated.addJsonBodySchema(String jsonSchema) Deprecated.addMultipartRequiredFile(String filename, String contentType) Deprecated.addPathParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type) Deprecated.addPathParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean allowEmptyValue) Deprecated.addPathParamWithPattern(String parameterName, String pattern) Deprecated.addQueryParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.addQueryParamsArray(String arrayName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.addQueryParamsArrayWithPattern(String arrayName, String pattern, boolean required) Deprecated.addQueryParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.addQueryParamWithPattern(String parameterName, String pattern, boolean required) Deprecated.addXMLBodySchema(String xmlSchema) Deprecated.static HTTPRequestValidationHandlercreate()Deprecated.booleanio.vertx.ext.web.api.validation.HTTPRequestValidationHandlervoidhandle(RoutingContext arg0) Deprecated.inthashCode()static HTTPRequestValidationHandlernewInstance(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler arg) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HTTPRequestValidationHandler
public HTTPRequestValidationHandler(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler delegate) -
HTTPRequestValidationHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.api.validation.HTTPRequestValidationHandler getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Specified by:
getDelegatein interfaceValidationHandler- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
Deprecated.- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>- Specified by:
handlein interfaceValidationHandler
-
create
Deprecated.- Returns:
- new HTTPRequestValidationHandler
-
addPathParam
@Deprecated public HTTPRequestValidationHandler addPathParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type) Deprecated.- Parameters:
parameterName- expected name of parameter inside the pathtype- expected type of parameter- Returns:
- this handler
-
addPathParamWithPattern
@Deprecated public HTTPRequestValidationHandler addPathParamWithPattern(String parameterName, String pattern) Deprecated.- Parameters:
parameterName- expected name of parameter inside the pathpattern- regular expression for validation- Returns:
- this handler
-
addPathParamWithCustomTypeValidator
@Deprecated public HTTPRequestValidationHandler addPathParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean allowEmptyValue) Deprecated.- Parameters:
parameterName- expected name of parameter inside the pathvalidator- type validatorallowEmptyValue- true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour:ParameterValidationRule.allowEmptyValue()- Returns:
- this handler
-
addQueryParam
@Deprecated public HTTPRequestValidationHandler addQueryParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.- Parameters:
parameterName- expected name of parameter inside the querytype- expected type of parameterrequired- true if parameter is required- Returns:
- this handler
-
addQueryParamWithPattern
@Deprecated public HTTPRequestValidationHandler addQueryParamWithPattern(String parameterName, String pattern, boolean required) Deprecated.- Parameters:
parameterName- expected name of parameter inside the querypattern- regular expression for validationrequired- true if parameter is required- Returns:
- this handler
-
addQueryParamsArray
@Deprecated public HTTPRequestValidationHandler addQueryParamsArray(String arrayName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.- Parameters:
arrayName- expected name of array inside the querytype- expected type of parameterrequired- true if parameter is required- Returns:
- this handler
-
addQueryParamsArrayWithPattern
@Deprecated public HTTPRequestValidationHandler addQueryParamsArrayWithPattern(String arrayName, String pattern, boolean required) Deprecated.- Parameters:
arrayName- expected name of array inside the querypattern- regular expression for validationrequired- true if parameter is required- Returns:
- this handler
-
addQueryParamWithCustomTypeValidator
@Deprecated public HTTPRequestValidationHandler addQueryParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.- Parameters:
parameterName- expected name of parameter inside the queryvalidator- type validatorrequired- true if parameter is requiredallowEmptyValue- true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour:ParameterValidationRule.allowEmptyValue()- Returns:
- this handler
-
addHeaderParam
@Deprecated public HTTPRequestValidationHandler addHeaderParam(String headerName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.- Parameters:
headerName- expected header nametype- expected type of parameterrequired- true if parameter is required- Returns:
- this handler
-
addHeaderParamWithPattern
@Deprecated public HTTPRequestValidationHandler addHeaderParamWithPattern(String headerName, String pattern, boolean required) Deprecated.- Parameters:
headerName- expected header namepattern- regular expression for validationrequired- true if parameter is required- Returns:
- this handler
-
addHeaderParamWithCustomTypeValidator
@Deprecated public HTTPRequestValidationHandler addHeaderParamWithCustomTypeValidator(String headerName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.- Parameters:
headerName- expected header nameryvalidator- type validatorrequired- true if parameter is requiredallowEmptyValue- true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour:ParameterValidationRule.allowEmptyValue()- Returns:
- this handler
-
addFormParam
@Deprecated public HTTPRequestValidationHandler addFormParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.- Parameters:
parameterName- expected name of parameter inside the formtype- expected type of parameterrequired- true if parameter is required- Returns:
- this handler
-
addFormParamWithPattern
@Deprecated public HTTPRequestValidationHandler addFormParamWithPattern(String parameterName, String pattern, boolean required) Deprecated.- Parameters:
parameterName- expected name of parameter inside the formpattern- regular expression for validationrequired- true if parameter is required- Returns:
- this handler
-
addFormParamsArray
@Deprecated public HTTPRequestValidationHandler addFormParamsArray(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required) Deprecated.- Parameters:
parameterName- expected name of array of parameters inside the formtype- expected type of array of parametersrequired- true if parameter is required- Returns:
- this handler
-
addFormParamsArrayWithPattern
@Deprecated public HTTPRequestValidationHandler addFormParamsArrayWithPattern(String parameterName, String pattern, boolean required) Deprecated.- Parameters:
parameterName- expected name of array of parameters inside the formpattern- regular expression for validationrequired- true if parameter is required- Returns:
- this handler
-
addFormParamWithCustomTypeValidator
@Deprecated public HTTPRequestValidationHandler addFormParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue) Deprecated.- Parameters:
parameterName- expected name of parameter inside the formvalidator- type validatorrequired- true if parameter is requiredallowEmptyValue- true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour:ParameterValidationRule.allowEmptyValue()- Returns:
- this handler
-
addCustomValidatorFunction
@Deprecated public HTTPRequestValidationHandler addCustomValidatorFunction(CustomValidator customValidator) Deprecated.- Parameters:
customValidator-- Returns:
- this handler
-
addJsonBodySchema
Deprecated.- Parameters:
jsonSchema-- Returns:
- this handler
-
addXMLBodySchema
Deprecated.- Parameters:
xmlSchema-- Returns:
- this handler
-
addMultipartRequiredFile
@Deprecated public HTTPRequestValidationHandler addMultipartRequiredFile(String filename, String contentType) Deprecated.- Parameters:
filename- name of the file inside the formcontentType- expected content type of file- Returns:
- this handler
-
addExpectedContentType
Deprecated.- Parameters:
contentType- expected content type of file- Returns:
- this handler
-
accept
- Specified by:
acceptin interfaceConsumer<RoutingContext>- Specified by:
acceptin interfaceValidationHandler
-
newInstance
public static HTTPRequestValidationHandler newInstance(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler arg)
-