io.vertx.reactivex.ext.web.api.validation

## Class HTTPRequestValidationHandler

- java.lang.Object
- - io.vertx.reactivex.ext.web.api.validation.HTTPRequestValidationHandler

- All Implemented Interfaces:
    Handler<RoutingContext>, ValidationHandler

      public class HTTPRequestValidationHandler
      extends Object
      implements ValidationHandler, 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
  Also you can add a form parameter for validation without care about content type of your request. For form parameters this interface support both "multipart/form-data" and "application/x-www-form-urlencoded"
  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 RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<HTTPRequestValidationHandler>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HTTPRequestValidationHandler(HTTPRequestValidationHandler delegate)`
    `HTTPRequestValidationHandler(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `HTTPRequestValidationHandler` | `addCustomValidatorFunction(CustomValidator customValidator)` Add a custom validator.
    `HTTPRequestValidationHandler` | `addExpectedContentType(String contentType)` Add an expected content type of request.
    `HTTPRequestValidationHandler` | `addFormParam(String parameterName, ParameterType type, boolean required)` Add a single parameter inside a form with included parameter types
    `HTTPRequestValidationHandler` | `addFormParamsArray(String parameterName, ParameterType type, boolean required)` Add a form parameters array with included parameter types
    `HTTPRequestValidationHandler` | `addFormParamsArrayWithPattern(String parameterName, String pattern, boolean required)` Add a form parameters array with a custom pattern
    `HTTPRequestValidationHandler` | `addFormParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)` Add a form parameter with a custom type validator.
    `HTTPRequestValidationHandler` | `addFormParamWithPattern(String parameterName, String pattern, boolean required)` Add a single parameter inside a form with a custom pattern
    `HTTPRequestValidationHandler` | `addHeaderParam(String headerName, ParameterType type, boolean required)` Add a header parameter with included parameter types
    `HTTPRequestValidationHandler` | `addHeaderParamWithCustomTypeValidator(String headerName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)` Add a header parameter with a custom type validator.
    `HTTPRequestValidationHandler` | `addHeaderParamWithPattern(String headerName, String pattern, boolean required)` Add a header parameter with a custom pattern
    `HTTPRequestValidationHandler` | `addJsonBodySchema(String jsonSchema)` Add a json schema for body with Content-Type "application/json"
    `HTTPRequestValidationHandler` | `addMultipartRequiredFile(String filename, String contentType)` Add an expected filename inside multipart request.
    `HTTPRequestValidationHandler` | `addPathParam(String parameterName, ParameterType type)` Add a path parameter with included parameter types.
    `HTTPRequestValidationHandler` | `addPathParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean allowEmptyValue)` Add a path parameter with a custom type validator.
    `HTTPRequestValidationHandler` | `addPathParamWithPattern(String parameterName, String pattern)` Add a path parameter with a custom pattern.
    `HTTPRequestValidationHandler` | `addQueryParam(String parameterName, ParameterType type, boolean required)` Add a query parameter with included parameter types
    `HTTPRequestValidationHandler` | `addQueryParamsArray(String arrayName, ParameterType type, boolean required)` Add a query parameters array with included parameter types
    `HTTPRequestValidationHandler` | `addQueryParamsArrayWithPattern(String arrayName, String pattern, boolean required)` Add a query parameters array with a custom pattern
    `HTTPRequestValidationHandler` | `addQueryParamWithCustomTypeValidator(String parameterName, ParameterTypeValidator validator, boolean required, boolean allowEmptyValue)` Add a query parameter with a custom type validator.
    `HTTPRequestValidationHandler` | `addQueryParamWithPattern(String parameterName, String pattern, boolean required)` Add a query parameter with a custom pattern
    `HTTPRequestValidationHandler` | `addXMLBodySchema(String xmlSchema)` Add a xml schema for body with Content-Type "application/xml"
    `static HTTPRequestValidationHandler` | `create()` Factory method to create an HTTPRequestValidationHandler
    `boolean` | `equals(Object o)`
    `HTTPRequestValidationHandler` | `getDelegate()`
    `void` | `handle(RoutingContext event)` Something has happened, so handle it.
    `int` | `hashCode()`
    `static HTTPRequestValidationHandler` | `newInstance(HTTPRequestValidationHandler arg)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface io.vertx.reactivex.ext.web.api.validation.ValidationHandler

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<HTTPRequestValidationHandler> __TYPE_ARG

  - ### Constructor Detail

    - #### HTTPRequestValidationHandler

          public HTTPRequestValidationHandler(HTTPRequestValidationHandler delegate)

    - #### HTTPRequestValidationHandler

          public HTTPRequestValidationHandler(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public HTTPRequestValidationHandler getDelegate()

      Specified by:
        `getDelegate` in interface `ValidationHandler`

    - #### handle

          public void handle(RoutingContext event)

      Something has happened, so handle it.
      Specified by:
        `handle` in interface `Handler<RoutingContext>`
      Specified by:
        `handle` in interface `ValidationHandler`
      Parameters:
        `event` - the event to handle

    - #### create

          public static HTTPRequestValidationHandler create()

      Factory method to create an HTTPRequestValidationHandler
      Returns:
        new HTTPRequestValidationHandler

    - #### addPathParam

          public HTTPRequestValidationHandler addPathParam(String parameterName,
                                                           ParameterType type)

      Add a path parameter with included parameter types. All path params are required
      Parameters:
        `parameterName` - expected name of parameter inside the path
        `type` - expected type of parameter
      Returns:
        this handler

    - #### addPathParamWithPattern

          public HTTPRequestValidationHandler addPathParamWithPattern(String parameterName,
                                                                      String pattern)

      Add a path parameter with a custom pattern. All path params are required
      Parameters:
        `parameterName` - expected name of parameter inside the path
        `pattern` - regular expression for validation
      Returns:
        this handler

    - #### addPathParamWithCustomTypeValidator

          public HTTPRequestValidationHandler addPathParamWithCustomTypeValidator(String parameterName,
                                                                                  ParameterTypeValidator validator,
                                                                                  boolean allowEmptyValue)

      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 out `ParameterTypeValidator`
      Parameters:
        `parameterName` - expected name of parameter inside the path
        `validator` - type validator
        `allowEmptyValue` - true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour: `ParameterValidationRule.allowEmptyValue()`
      Returns:
        this handler

    - #### addQueryParam

          public HTTPRequestValidationHandler addQueryParam(String parameterName,
                                                            ParameterType type,
                                                            boolean required)

      Add a query parameter with included parameter types
      Parameters:
        `parameterName` - expected name of parameter inside the query
        `type` - expected type of parameter
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addQueryParamWithPattern

          public HTTPRequestValidationHandler addQueryParamWithPattern(String parameterName,
                                                                       String pattern,
                                                                       boolean required)

      Add a query parameter with a custom pattern
      Parameters:
        `parameterName` - expected name of parameter inside the query
        `pattern` - regular expression for validation
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addQueryParamsArray

          public HTTPRequestValidationHandler addQueryParamsArray(String arrayName,
                                                                  ParameterType type,
                                                                  boolean required)

      Add a query parameters array with included parameter types
      Parameters:
        `arrayName` - expected name of array inside the query
        `type` - expected type of parameter
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addQueryParamsArrayWithPattern

          public HTTPRequestValidationHandler addQueryParamsArrayWithPattern(String arrayName,
                                                                             String pattern,
                                                                             boolean required)

      Add a query parameters array with a custom pattern
      Parameters:
        `arrayName` - expected name of array inside the query
        `pattern` - regular expression for validation
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addQueryParamWithCustomTypeValidator

          public HTTPRequestValidationHandler addQueryParamWithCustomTypeValidator(String parameterName,
                                                                                   ParameterTypeValidator validator,
                                                                                   boolean required,
                                                                                   boolean allowEmptyValue)

      Add a query parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out `ParameterTypeValidator`
      Parameters:
        `parameterName` - expected name of parameter inside the query
        `validator` - type validator
        `required` - true if parameter is required
        `allowEmptyValue` - true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour: `ParameterValidationRule.allowEmptyValue()`
      Returns:
        this handler

    - #### addHeaderParam

          public HTTPRequestValidationHandler addHeaderParam(String headerName,
                                                             ParameterType type,
                                                             boolean required)

      Add a header parameter with included parameter types
      Parameters:
        `headerName` - expected header name
        `type` - expected type of parameter
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addHeaderParamWithPattern

          public HTTPRequestValidationHandler addHeaderParamWithPattern(String headerName,
                                                                        String pattern,
                                                                        boolean required)

      Add a header parameter with a custom pattern
      Parameters:
        `headerName` - expected header name
        `pattern` - regular expression for validation
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addHeaderParamWithCustomTypeValidator

          public HTTPRequestValidationHandler addHeaderParamWithCustomTypeValidator(String headerName,
                                                                                    ParameterTypeValidator validator,
                                                                                    boolean required,
                                                                                    boolean allowEmptyValue)

      Add a header parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out `ParameterTypeValidator`
      Parameters:
        `headerName` - expected header namery
        `validator` - type validator
        `required` - true if parameter is required
        `allowEmptyValue` - true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour: `ParameterValidationRule.allowEmptyValue()`
      Returns:
        this handler

    - #### addFormParam

          public HTTPRequestValidationHandler addFormParam(String parameterName,
                                                           ParameterType type,
                                                           boolean required)

      Add a single parameter inside a form with included parameter types
      Parameters:
        `parameterName` - expected name of parameter inside the form
        `type` - expected type of parameter
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addFormParamWithPattern

          public HTTPRequestValidationHandler addFormParamWithPattern(String parameterName,
                                                                      String pattern,
                                                                      boolean required)

      Add a single parameter inside a form with a custom pattern
      Parameters:
        `parameterName` - expected name of parameter inside the form
        `pattern` - regular expression for validation
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addFormParamsArray

          public HTTPRequestValidationHandler addFormParamsArray(String parameterName,
                                                                 ParameterType type,
                                                                 boolean required)

      Add a form parameters array with included parameter types
      Parameters:
        `parameterName` - expected name of array of parameters inside the form
        `type` - expected type of array of parameters
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addFormParamsArrayWithPattern

          public HTTPRequestValidationHandler addFormParamsArrayWithPattern(String parameterName,
                                                                            String pattern,
                                                                            boolean required)

      Add a form parameters array with a custom pattern
      Parameters:
        `parameterName` - expected name of array of parameters inside the form
        `pattern` - regular expression for validation
        `required` - true if parameter is required
      Returns:
        this handler

    - #### addFormParamWithCustomTypeValidator

          public HTTPRequestValidationHandler addFormParamWithCustomTypeValidator(String parameterName,
                                                                                  ParameterTypeValidator validator,
                                                                                  boolean required,
                                                                                  boolean allowEmptyValue)

      Add a form parameter with a custom type validator. For more informations about how to construct built-in or custom type validator, check out `ParameterTypeValidator`
      Parameters:
        `parameterName` - expected name of parameter inside the form
        `validator` - type validator
        `required` - true if parameter is required
        `allowEmptyValue` - true if parameter allowEmptyValue. For more informations about allowEmptyValue behaviour: `ParameterValidationRule.allowEmptyValue()`
      Returns:
        this handler

    - #### addCustomValidatorFunction

          public HTTPRequestValidationHandler addCustomValidatorFunction(CustomValidator customValidator)

      Add a custom validator. For more informations about custom validator, see `CustomValidator`
      Parameters:
        `customValidator` -
      Returns:
        this handler

    - #### addJsonBodySchema

          public HTTPRequestValidationHandler addJsonBodySchema(String jsonSchema)

      Add a json schema for body with Content-Type "application/json"
      Parameters:
        `jsonSchema` -
      Returns:
        this handler

    - #### addXMLBodySchema

          public HTTPRequestValidationHandler addXMLBodySchema(String xmlSchema)

      Add a xml schema for body with Content-Type "application/xml"
      Parameters:
        `xmlSchema` -
      Returns:
        this handler

    - #### addMultipartRequiredFile

          public HTTPRequestValidationHandler addMultipartRequiredFile(String filename,
                                                                       String contentType)

      Add an expected filename inside multipart request.
      Parameters:
        `filename` - name of the file inside the form
        `contentType` - expected content type of file
      Returns:
        this handler

    - #### addExpectedContentType

          public HTTPRequestValidationHandler addExpectedContentType(String contentType)

      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(HTTPRequestValidationHandler arg)

Copyright © 2022 Eclipse. All rights reserved.