ParameterTypeValidator

Interface for declaration of method for validate a specific parameter type.<br/> If you want to implement your own type validator, you need only to implement

see
  • If parameter is valid, call to put value (maybe modified) inside RequestParameters. The validation flow will care about set parameter name
  • If parameter is invalid, throw a new ValidationException with message ({@link io.vertx.ext.web.api.validation.ValidationException}) and/or with {@link io.vertx.ext.web.api.validation.ValidationException.ErrorType} (). As for value, the validation flow will care about setting all other ValidationException fields
package

Default

Methods

__construct

__construct() 

Create an array type validator

createArrayTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $arrayMembersValidator [ParameterTypeValidator] Type validator that describe array items. It can't be null createArrayTypeValidator($arrayMembersValidator)

Create an array type validator

param $arrayMembersValidator [ParameterTypeValidator] Type validator that describe array items. It can't be null param $collectionFormat [string] String that represent a ContainerSerializationStyle. Check out \ContainerSerializationStyle for more informations. The default value is "csv". It can be null param $maxItems [integer] Maximum items in array. It can be null param $minItems [integer] Minimum items in array. It can be null createArrayTypeValidator($arrayMembersValidator, $collectionFormat, $maxItems, $minItems)

Arguments

$arg0

ParameterTypeValidator

$arg1

string

$arg2

integer

$arg3

integer

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create a boolean type validator

createBooleanTypeValidator( $arg0) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

Create a new type validator for double values

createDoubleTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $defaultValue [float] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createDoubleTypeValidator($defaultValue)

Create a new type validator for double values

param $maximum [float] Maximum value. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [float] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createDoubleTypeValidator($maximum, $minimum, $multipleOf, $defaultValue)

Create a new type validator for double values

param $exclusiveMaximum [boolean] If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be null param $maximum [float] Maximum value. It can be null param $exclusiveMinimum [boolean] If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createDoubleTypeValidator($exclusiveMaximum, $maximum, $exclusiveMinimum, $minimum, $multipleOf, $defaultValue)

Arguments

$arg0

boolean | float

$arg1

float

$arg2

boolean | float

$arg3

float

$arg4

float

$arg5

mixed

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create an enum type validator

createEnumTypeValidatorWithInnerValidator( $arg0,  $arg1) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

Arguments

$arg0

array

$arg1

ParameterTypeValidator

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create a new type validator for float values

createFloatTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $defaultValue [float] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createFloatTypeValidator($defaultValue)

Create a new type validator for float values

param $maximum [float] Maximum value. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [float] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createFloatTypeValidator($maximum, $minimum, $multipleOf, $defaultValue)

Create a new type validator for float values

param $exclusiveMaximum [boolean] If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be null param $maximum [float] Maximum value. It can be null param $exclusiveMinimum [boolean] If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createFloatTypeValidator($exclusiveMaximum, $maximum, $exclusiveMinimum, $minimum, $multipleOf, $defaultValue)

Arguments

$arg0

boolean | float

$arg1

float

$arg2

boolean | float

$arg3

float

$arg4

float

$arg5

mixed

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create a new type validator for integer values

createIntegerTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $defaultValue [integer] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createIntegerTypeValidator($defaultValue)

Create a new type validator for integer values

param $maximum [float] Maximum value. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [integer] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createIntegerTypeValidator($maximum, $minimum, $multipleOf, $defaultValue)

Create a new type validator for integer values

param $exclusiveMaximum [boolean] If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be null param $maximum [float] Maximum value. It can be null param $exclusiveMinimum [boolean] If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createIntegerTypeValidator($exclusiveMaximum, $maximum, $exclusiveMinimum, $minimum, $multipleOf, $defaultValue)

Arguments

$arg0

boolean | integer | float

$arg1

float

$arg2

boolean | float

$arg3

integer | float

$arg4

float

$arg5

mixed

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create a new type validator for long integer values

createLongTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null,  $arg4 = null,  $arg5 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $defaultValue [integer] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createLongTypeValidator($defaultValue)

Create a new type validator for long integer values

param $maximum [float] Maximum value. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [integer] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createLongTypeValidator($maximum, $minimum, $multipleOf, $defaultValue)

Create a new type validator for long integer values

param $exclusiveMaximum [boolean] If true, value will be mark as valid if value < maximum. If false, value will be mark as valid if value <= maximum. The default value is false. It can be null param $maximum [float] Maximum value. It can be null param $exclusiveMinimum [boolean] If true, value will be mark as valid if value > minimum. If false, value will be mark as valid if value >= minimum. The default value is false. It can be null param $minimum [float] Minimum value. It can be null param $multipleOf [float] Multiple of value. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createLongTypeValidator($exclusiveMaximum, $maximum, $exclusiveMinimum, $minimum, $multipleOf, $defaultValue)

Arguments

$arg0

boolean | integer | float

$arg1

float

$arg2

boolean | float

$arg3

integer | float

$arg4

float

$arg5

mixed

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Create an enum type validator

createStringEnumTypeValidator( $arg0) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

Create a new string type validator

createStringTypeValidator( $arg0,  $arg1 = null,  $arg2 = null,  $arg3 = null) : \io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator
static

param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createStringTypeValidator($defaultValue)

Create a new string type validator

param $pattern [string] pattern that string have to match. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createStringTypeValidator($pattern, $defaultValue)

Create a new string type validator

param $pattern [string] pattern that string have to match. It can be null param $minLength [integer] Minimum length of string. It can be null param $maxLength [integer] Maximum length of string. It can be null param $defaultValue [mixed] Default value that will be set if parameter is empty or not found. To apply default value you have to set \ParameterValidationRule#allowEmptyValue() true. It can be null createStringTypeValidator($pattern, $minLength, $maxLength, $defaultValue)

Arguments

$arg0

string | mixed

$arg1

mixed | integer

$arg2

integer

$arg3

mixed

Response

\io\vertx\jphp\ext\web\api\validation\ParameterTypeValidator

Returns default value of parameter

getDefault() : mixed

Response

mixed

Returns true if this type validator has default value

hasDefault() : boolean

Response

boolean

Function that checks if parameter is valid. It returns a RequestParameter object that will be linked inside

isValid( $arg0) : \io\vertx\jphp\ext\web\api\RequestParameter

. For more info, check .

Arguments

$arg0

string

Response

\io\vertx\jphp\ext\web\api\RequestParameter

request parameter value

Function that checks if array of values of a specific parameter. It returns a RequestParameter object that will be linked inside . For more info, check .

isValidCollection( $arg0) : \io\vertx\jphp\ext\web\api\RequestParameter

Arguments

$arg0

array

Response

\io\vertx\jphp\ext\web\api\RequestParameter

request parameter value