Skip to content

Field Validation

Randgalt edited this page Aug 16, 2012 · 5 revisions

Governator supports JSR 303 – Bean Validation by passing injected instances through the Hibernate Validator library.

All validation errors are thrown as the Governator exception: ValidationException

Example:

@Min(5)
private int   myInt;  // ValidationException is thrown if this is less than 5

Validation is performed when LifecycleManager.start() is called.