|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValidatorFactory
Constructs Validator
instances from a specification. A
specification is a comma-seperated list of entries. Each entry is in one of the following forms:
Most validator classes are configurable: they have a property that matches their
name. For example, MinDate
(which is named "minDate"
has a minDate
property. A few validators are not configurable ("required" =>
Required
, for example).
Validators are expected to have a public no-args constructor. They are also expected to have a
message
property which is set from the value in brackets.
The message is either a literal string, or may be prefixed with a '%' character, to indicate
a localized key, resolved using the component's message catalog.
When the name is prefixed with a dollary sign, it indicates a reference to a bean with the given name.
A full validator specification might be:
required,email[%email-format],minLength=20[Email addresses must be at least 20 characters long.]
Method Summary | |
---|---|
List |
constructValidatorList(IComponent component,
String specification)
Constructs a new (immutable) List of Validator , or returns a previously constructed
List. |
Method Detail |
---|
List constructValidatorList(IComponent component, String specification)
Validator
, or returns a previously constructed
List.
component
- the component for which the list is being createdspecification
- a string identifying which validators and their configuration
Validator
(possibly empty)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |