Class HTTPRequestValidationHandler
- java.lang.Object
-
- io.vertx.rxjava3.ext.web.api.validation.HTTPRequestValidationHandler
-
- All Implemented Interfaces:
io.vertx.core.Handler<RoutingContext>
,ValidationHandler
public class HTTPRequestValidationHandler extends Object implements ValidationHandler, io.vertx.core.Handler<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:- 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 theoriginal
non RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<HTTPRequestValidationHandler>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description HTTPRequestValidationHandler(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler delegate)
HTTPRequestValidationHandler(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HTTPRequestValidationHandler
addCustomValidatorFunction(CustomValidator customValidator)
Deprecated.HTTPRequestValidationHandler
addExpectedContentType(String contentType)
Deprecated.HTTPRequestValidationHandler
addFormParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required)
Deprecated.HTTPRequestValidationHandler
addFormParamsArray(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required)
Deprecated.HTTPRequestValidationHandler
addFormParamsArrayWithPattern(String parameterName, String pattern, boolean required)
Deprecated.HTTPRequestValidationHandler
addFormParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)
Deprecated.HTTPRequestValidationHandler
addFormParamWithPattern(String parameterName, String pattern, boolean required)
Deprecated.HTTPRequestValidationHandler
addHeaderParam(String headerName, io.vertx.ext.web.api.validation.ParameterType type, boolean required)
Deprecated.HTTPRequestValidationHandler
addHeaderParamWithCustomTypeValidator(String headerName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)
Deprecated.HTTPRequestValidationHandler
addHeaderParamWithPattern(String headerName, String pattern, boolean required)
Deprecated.HTTPRequestValidationHandler
addJsonBodySchema(String jsonSchema)
Deprecated.HTTPRequestValidationHandler
addMultipartRequiredFile(String filename, String contentType)
Deprecated.HTTPRequestValidationHandler
addPathParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type)
Deprecated.HTTPRequestValidationHandler
addPathParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean allowEmptyValue)
Deprecated.HTTPRequestValidationHandler
addPathParamWithPattern(String parameterName, String pattern)
Deprecated.HTTPRequestValidationHandler
addQueryParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type, boolean required)
Deprecated.HTTPRequestValidationHandler
addQueryParamsArray(String arrayName, io.vertx.ext.web.api.validation.ParameterType type, boolean required)
Deprecated.HTTPRequestValidationHandler
addQueryParamsArrayWithPattern(String arrayName, String pattern, boolean required)
Deprecated.HTTPRequestValidationHandler
addQueryParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)
Deprecated.HTTPRequestValidationHandler
addQueryParamWithPattern(String parameterName, String pattern, boolean required)
Deprecated.HTTPRequestValidationHandler
addXMLBodySchema(String xmlSchema)
Deprecated.static HTTPRequestValidationHandler
create()
Deprecated.boolean
equals(Object o)
io.vertx.ext.web.api.validation.HTTPRequestValidationHandler
getDelegate()
void
handle(RoutingContext event)
Deprecated.int
hashCode()
static HTTPRequestValidationHandler
newInstance(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler arg)
String
toString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<HTTPRequestValidationHandler> __TYPE_ARG
-
-
Constructor Detail
-
HTTPRequestValidationHandler
public HTTPRequestValidationHandler(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler delegate)
-
HTTPRequestValidationHandler
public HTTPRequestValidationHandler(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.api.validation.HTTPRequestValidationHandler getDelegate()
- Specified by:
getDelegate
in interfaceValidationHandler
-
handle
@Deprecated public void handle(RoutingContext event)
Deprecated.Something has happened, so handle it.- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
- Specified by:
handle
in interfaceValidationHandler
- Parameters:
event
- the event to handle
-
create
@Deprecated public static HTTPRequestValidationHandler create()
Deprecated.Factory method to create an HTTPRequestValidationHandler- Returns:
- new HTTPRequestValidationHandler
-
addPathParam
@Deprecated public HTTPRequestValidationHandler addPathParam(String parameterName, io.vertx.ext.web.api.validation.ParameterType type)
Deprecated.Add a path parameter with included parameter types. All path params are required- 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.Add a path parameter with a custom pattern. All path params are required- 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.Add a path parameter with a custom type validator. All path params are required. For more informations about how to construct built-in or custom type validator, check outParameterTypeValidator
- 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.Add a query parameter with included parameter types- 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.Add a query parameter with a custom pattern- 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.Add a query parameters array with included parameter types- 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.Add a query parameters array with a custom pattern- 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.Add a query parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check outParameterTypeValidator
- 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.Add a header parameter with included parameter types- 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.Add a header parameter with a custom pattern- 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.Add a header parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check outParameterTypeValidator
- 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.Add a single parameter inside a form with included parameter types- 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.Add a single parameter inside a form with a custom pattern- 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.Add a form parameters array with included parameter types- 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.Add a form parameters array with a custom pattern- 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.Add a form parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check outParameterTypeValidator
- 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.Add a custom validator. For more informations about custom validator, seeCustomValidator
- Parameters:
customValidator
-- Returns:
- this handler
-
addJsonBodySchema
@Deprecated public HTTPRequestValidationHandler addJsonBodySchema(String jsonSchema)
Deprecated.Add a json schema for body with Content-Type "application/json"- Parameters:
jsonSchema
-- Returns:
- this handler
-
addXMLBodySchema
@Deprecated public HTTPRequestValidationHandler addXMLBodySchema(String xmlSchema)
Deprecated.Add a xml schema for body with Content-Type "application/xml"- Parameters:
xmlSchema
-- Returns:
- this handler
-
addMultipartRequiredFile
@Deprecated public HTTPRequestValidationHandler addMultipartRequiredFile(String filename, String contentType)
Deprecated.Add an expected filename inside multipart request.- Parameters:
filename
- name of the file inside the formcontentType
- expected content type of file- Returns:
- this handler
-
addExpectedContentType
@Deprecated public HTTPRequestValidationHandler addExpectedContentType(String contentType)
Deprecated.Add an expected content type of request. It's not needed to add application/json, application/xml, multipart/form-data and application/x-www-form-urlencoded- Parameters:
contentType
- expected content type of file- Returns:
- this handler
-
newInstance
public static HTTPRequestValidationHandler newInstance(io.vertx.ext.web.api.validation.HTTPRequestValidationHandler arg)
-
-