org.mule.modules

mule-module-validation


Namespacehttp://www.mulesoft.org/schema/mule/validation
Schema Locationhttp://www.mulesoft.org/schema/mule/validation/current/mule-validation.xsd  (View Schema)
Schema Version1.0
Minimum Mule Version3.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.

Summary

Message Processors
<validation:validate-credit-card-number>
If if the specified creditCardNumber is not a valid credit card number throw an exception.
<validation:validate-date>
If the specified date is not a valid one throw an exception.
<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.
<validation:validate-double>
If the specified value is not a valid Double throw an exception.
<validation:validate-email>
If the specified emailAddress is not a valid one throw an exception.
<validation:validate-float>
If the specified value is not a valid Float throw an exception.
<validation:validate-isbn10>
If the specified isbnCode is not a valid one throw an exception.
<validation:validate-isbn13>
If the specified isbnCode is not a valid one throw an exception.
<validation:validate-integer>
If the specified value is not a valid Integer throw an exception.
<validation:validate-ip-address>
If the specified ipAddress is not a valid one throw an exception.
<validation:validate-long>
If the specified value is not a valid Long throw an exception.
<validation:validate-not-empty>
If the specified object is empty or null throw an exception.
<validation:validate-percentage>
If the specified percentage is not a valid one throw an exception.
<validation:validate-short>
If the specified value is not a valid Short throw an exception.
<validation:validate-time>
If the specified time is not a valid one throw an exception.
<validation:validate-top-level-domain>
If if the specified topLevelDomain does not matches any IANA-defined top-level domain throw an exception.
<validation:validate-top-level-domain-country>
If if the specified countryCode does not matches any IANA-defined top-level domain throw an exception.
<validation:validate-url>
If the specified url is not a valid one throw an exception.
<validation:validate-using-regex>
If the specified value does not match any of the regexs then throw an exception.

Message Processors

<validation:validate-credit-card-number>

If if the specified creditCardNumber is not a valid credit card number throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Exception Payload
InvalidException if not valid
Exception

<validation:validate-date>

If the specified date is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<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.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
domain Domain name to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-double>

If the specified value is not a valid Double throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-email>

If the specified emailAddress is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
emailAddress Email address to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-float>

If the specified value is not a valid Float throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-isbn10>

If the specified isbnCode is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
isbnCode ISBN code to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-isbn13>

If the specified isbnCode is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
isbnCode ISBN code to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-integer>

If the specified value is not a valid Integer throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-ip-address>

If the specified ipAddress is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
ipAddress IP address to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-long>

If the specified value is not a valid Long throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-not-empty>

If the specified object is empty or null throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
object Optional. Object to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-percentage>

If the specified percentage is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
percentage Percentage to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-short>

If the specified value is not a valid Short throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-time>

If the specified time is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<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.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
topLevelDomain Domain name to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<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.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
config-ref Optional. Specify which configuration to use.
countryCode Country code to validate
exceptionClassName Optional. Class name of the exception to throw
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-url>

If the specified url is not a valid one throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Child Elements
Exception Payload
InvalidException if not valid
Exception

<validation:validate-using-regex>

If the specified value does not match any of the regexs then throw an exception.

XML Sample
INCLUDE_ERROR

Attributes
NameDefault ValueDescription
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
Exception Payload
InvalidException if not valid
Exception