This page describes a list of the built-in validators, and also shows how to build custom ones.

AttributePresenceValidator

This class provides a way to detect presence of attributes on an Validatable. The Validatable can be a simple object, or an ActiveJDBC Model.

Example, say you have a class:

You can check validations on it this way:

DateValidator

Validates the date format. Class definition:

Example usage:

EmailValidator

Validates that the email format is valid:

Usage:

NumericValidator

Checks that a value is numeric (can be converted to a number).

Definition:

Usage:

RangeValidator

Definition:

Usage:

RegexpValidator

Usage:

TimestampValidator

Validates presence and correct format of a string.

This validator ensures that if an attribute dob is set with a String that is not following a format, it will fail. The usage is exacly the same as that of any other validator.

Converters

Converters are similar to validators, but they try to change the values they are responsible for during a validation process. For more, see: Converters.

Custom Validators

In case you missed those: Custom Validators


How to comment

The comment section below is to discuss documentation on this page.

If you have an issue, or discover bug, please follow instructions on the Support page