Allows performing validations and throw an Exception if the validation fails
Configurations
Config
An extension which provides validation capabilities by exposing a series of Validators as ExtensionModel OperationModels This class not only defines the extension but also acts as the only available ConfigurationModel for it. It allows parametrizing the Validators with i18n bundles (through a I18NConfig
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Name |
String |
The name of this configuration. With this name can be later referenced. |
x |
|
I18n |
|
Associated Operations
Operations
Custom Validator
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Class |
String |
|
||
Ref |
|
|||
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Email
Validates that the email address is valid
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
String |
an email address |
x |
||
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Empty
Validates that value is empty. The definition of empty depends on the type of value. If it's a String it will check that it is not blank. If it's a Collection, array or Map it will check that it's not empty. No other types are supported, an IllegalArgumentException will be thrown if any other type is supplied
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
Any |
the value to check |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is False
Validates that the given value is false
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Expression |
Boolean |
the boolean to test |
false |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is IP
Validates that an ip address represented as a String is valid
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Ip |
String |
the ip address to validate |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Not Empty
Validates that value is not empty. The definition of empty depends on the type of value. If it's a String it will check that it is not blank. If it's a Collection, array or Map it will check that it's not empty. No other types are supported, an IllegalArgumentException will be thrown if any other type is supplied
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
Any |
the value to check |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Not Null
Validates that the given value is not null.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
Any |
the value to test |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Null
Validates that the given value is null.
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
Any |
the value to test |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Number
Receives a numeric value as a String and validates that it can be parsed per the rules of a numberType
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
String |
the value to be tested |
x |
|
Locale |
String |
The locale to use for the format. If not provided it defaults to the system Locale |
|
|
Pattern |
String |
The pattern used to format the value |
|
|
Min Value |
String |
If provided, check that the parsed value is greater or equal than this value |
|
|
Max Value |
String |
If provided, check that the parsed value is less or equal than this value |
|
|
Number Type |
Enumeration, one of:
|
the type of number to test value against |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Time
Validates that a time in String format is valid for the given pattern and locale. If no pattern is provided, then the locale's default will be used
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Time |
String |
A date in String format |
x |
|
Locale |
String |
the locale of the String |
|
|
Pattern |
String |
the pattern for the date |
|
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is True
Validates that the given value is true
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Expression |
Boolean |
the boolean to test |
false |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is URL
Validates that url is a valid one
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
URL |
String |
the URL to validate as a String |
x |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Matches Regex
Validates that value matches the regex regular expression
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
String |
the value to check |
x |
|
Regex |
String |
the regular expression to check against |
x |
|
Case Sensitive |
Boolean |
when true matching is case sensitive, otherwise matching is case in-sensitive |
true |
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Validate Size
Validates that value has a size between certain inclusive boundaries. This validator is capable of handling instances of String, Collection, Map and arrays
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Value |
Any |
the value to validate |
x |
|
Min |
Number |
the minimum expected length (inclusive, defaults to zero) |
0 |
|
Max |
Number |
the maximum expected length (inclusive). Leave unspecified or null to allow any max length |
|
|
Message |
String |
Specifies the message that is to be notified to the user if the validation fails. It's marked as not dynamic to allow eager evaluation of the expression in case that the validation is successful and the message is not needed. Components consuming this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Types
I18n
Field | Type | Default Value |
---|---|---|
Bundle Path |
String |
|
Locale |
String |