public class FieldValidatorSourceImpl extends Object implements FieldValidatorSource
Constructor and Description |
---|
FieldValidatorSourceImpl(Messages globalMessages,
TypeCoercer typeCoercer,
FormSupport formSupport,
Map<String,Validator> validators,
ValidatorMacro validatorMacro) |
Modifier and Type | Method and Description |
---|---|
FieldValidator |
createValidator(Field field,
String validatorType,
String constraintValue)
Creates the validator.
|
FieldValidator |
createValidator(Field field,
String validatorType,
String constraintValue,
String overrideId,
Messages overrideMessages,
Locale locale)
Full featured version of
FieldValidatorSource.createValidator(Field, String, String) used in situations where the container
of the field is not necessarily the place to look for override messages, and the id of the field is not the key
to use when checking. |
FieldValidator |
createValidators(Field field,
String specification)
Creates a set of validators.
|
public FieldValidatorSourceImpl(Messages globalMessages, TypeCoercer typeCoercer, FormSupport formSupport, Map<String,Validator> validators, ValidatorMacro validatorMacro)
public FieldValidator createValidator(Field field, String validatorType, String constraintValue)
FieldValidatorSource
message key
). However,
if the container component of the field defines a message key id-validator
(where id is the simple
id of the field component, and validator is the validatorType), then that message is used instead. This allows
you to override the message for a particular validation of a particular field.createValidator
in interface FieldValidatorSource
field
- the field for which a validator is to be createdvalidatorType
- used to select the Validator
that forms the core of the
FieldValidator
constraintValue
- a value used to configure the validator, or null if the validator is not configurarablepublic FieldValidator createValidator(Field field, String validatorType, String constraintValue, String overrideId, Messages overrideMessages, Locale locale)
FieldValidatorSource
FieldValidatorSource.createValidator(Field, String, String)
used in situations where the container
of the field is not necessarily the place to look for override messages, and the id of the field is not the key
to use when checking. The BeanEditForm
is an example of this.createValidator
in interface FieldValidatorSource
field
- the field for which a validator is to be createdvalidatorType
- used to select the Validator
that forms the core of the
FieldValidator
constraintValue
- a value used to configure the validator, or null if the validator is not configurableoverrideId
- the base id used when searching for validator message overrides (this would normally be
the field component's simple id)overrideMessages
- the message catalog to search for override messages (this would normally be the catalog
for the container of the field component)locale
- ignored, starting in 5.3 (it is allowed to pass null). Locale was needed in release 5.2 and earlier.public FieldValidator createValidators(Field field, String specification)
FieldValidatorSource
createValidators
in interface FieldValidatorSource
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.