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
<validation:custom-validator>
Parameters
Name | Type | Description | Default Value | Required |
---|---|---|---|---|
Configuration |
String |
The name of the configuration to use. |
x |
|
Message |
String |
this value are to manually check if this is an expression and evaluate it in case that the validation failed |
|
|
Class |
String |
|
||
Ref |
|
For Configurations.
Throws
-
VALIDATION:VALIDATION
Is Email
<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 |
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
<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 |
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
<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 |
x |
|
Message |
String |
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
<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 |
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
<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 |
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
<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 |
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
<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 |
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
<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 |
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
<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 |
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
<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 |
x |
|
Message |
String |
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
<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 |
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
<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 |
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
<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 |
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 |
---|---|
Bundle Path |
String |
Locale |
String |