| Namespace | http://www.mulesoft.org/schema/mule/validation |
| Schema Location | http://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd (View Schema) |
| Schema Version | 1.0 |
| Minimum Mule Version | 3.2 |
Module Overview
A common issue when receiving data either electronically or from user input is verifying the integrity of the data.
This work is repetitive and becomes even more complicated when different sets of validation rules need to be applied
to the same set of data based on locale. Error messages may also vary by locale. This module addresses some of
these issues to speed development and maintenance of validation rules.
Message Processors
<validation:validate-credit-card-number>
If if the specified creditCardNumber is not a valid credit card number throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| creditCardNumber |
|
Credit card number to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
Child Elements
| <validation:creditCardTypes>Credit card types to validate |
<validation:validate-date>
If the specified date is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| date |
|
Date to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-domain>
If the specified domain does not parses as a valid domain name with a recognized top-level domain then
throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| domain |
|
Domain name to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-double>
If the specified value is not a valid Double throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| minValue |
|
Optional. The minimum value |
| maxValue |
|
Optional. The maximum value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-email>
If the specified emailAddress is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| emailAddress |
|
Email address to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-float>
If the specified value is not a valid Float throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| minValue |
|
Optional. The minimum value |
| maxValue |
|
Optional. The maximum value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-isbn10>
If the specified isbnCode is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| isbnCode |
|
ISBN code to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-isbn13>
If the specified isbnCode is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| isbnCode |
|
ISBN code to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-integer>
If the specified value is not a valid Integer throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| minValue |
|
Optional. The minimum value |
| maxValue |
|
Optional. The maximum value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-ip-address>
If the specified ipAddress is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| ipAddress |
|
IP address to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-long>
If the specified value is not a valid Long throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| minValue |
|
Optional. The minimum value |
| maxValue |
|
Optional. The maximum value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-not-empty>
If the specified object is empty or null throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| object |
|
Optional. Object to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-percentage>
If the specified percentage is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| percentage |
|
Percentage to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-short>
If the specified value is not a valid Short throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| minValue |
|
Optional. The minimum value |
| maxValue |
|
Optional. The maximum value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-time>
If the specified time is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| time |
|
Time to validate |
| locale |
|
Optional. The locale to use for the format |
| pattern |
|
Optional. The pattern used to format the value |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-top-level-domain>
If if the specified topLevelDomain does not matches any IANA-defined top-level domain throw an exception.
Leading dots are ignored if present. The search is case-sensitive.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| topLevelDomain |
|
Domain name to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-top-level-domain-country>
If if the specified countryCode does not matches any IANA-defined top-level domain throw an exception.
Leading dots are ignored if present. The search is case-sensitive.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| countryCode |
|
Country code to validate |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-url>
If the specified url is not a valid one throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| url |
|
URL to validate |
| allowTwoSlashes |
|
Optional. Allow two slashes in the path component of the URL. |
| allowAllSchemes |
|
Optional. Allows all validly formatted schemes to pass validation instead of supplying a set of valid schemes. |
| allowLocalURLs |
|
Optional. Allow local URLs, such as http://localhost/ or http://machine/ . |
| noFragments |
|
Optional. Enabling this options disallows any URL fragments. |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
<validation:validate-using-regex>
If the specified value does not match any of the regexs then throw an exception.
Attributes
| Name | Default Value | Description |
| config-ref |
|
Optional. Specify which configuration to use. |
| value |
|
Value to match |
| caseSensitive |
|
Optional. When true matching is case sensitive, otherwise matching is case in-sensitive |
| exceptionClassName |
|
Optional. Class name of the exception to throw |
Child Elements
| <validation:regexs>Set of regular expressions to test against |