org.apache.tapestry5.internal.services
Class FieldValidatorSourceImpl
java.lang.Object
org.apache.tapestry5.internal.services.FieldValidatorSourceImpl
- All Implemented Interfaces:
- FieldValidatorSource
public class FieldValidatorSourceImpl
- extends Object
- implements FieldValidatorSource
|
Method Summary |
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 necesarrilly 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FieldValidatorSourceImpl
public FieldValidatorSourceImpl(ValidationMessagesSource messagesSource,
TypeCoercer typeCoercer,
FormSupport formSupport,
Map<String,Validator> validators)
createValidator
public FieldValidator createValidator(Field field,
String validatorType,
String constraintValue)
- Description copied from interface:
FieldValidatorSource
- Creates the validator. The error message associated with the field validator usually comes from the
ValidationMessagesSource (using the validator's 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.
- Specified by:
createValidator in interface FieldValidatorSource
- Parameters:
field - the field for which a validator is to be createdvalidatorType - used to select the Validator that forms the core of the
FieldValidatorconstraintValue - a value used to configure the validator, or null if the validator is not configurarable
- Returns:
- the field validator for the field
createValidator
public FieldValidator createValidator(Field field,
String validatorType,
String constraintValue,
String overrideId,
Messages overrideMessages,
Locale locale)
- Description copied from interface:
FieldValidatorSource
- Full featured version of
FieldValidatorSource.createValidator(Field, String, String) used in situations where the container
of the field is not necesarrilly 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.
- Specified by:
createValidator in interface FieldValidatorSource
- Parameters:
field - the field for which a validator is to be createdvalidatorType - used to select the Validator that forms the core of the
FieldValidatorconstraintValue - 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 - locale used when retrieving default validation messages from the ValidationMessagesSource
- Returns:
- the field validator for the field
createValidators
public FieldValidator createValidators(Field field,
String specification)
- Description copied from interface:
FieldValidatorSource
- Creates a set of validators. The specification is a string used to identify and configure the individual
validators. The specification is a comma-separated list of terms. Each term is a validator type name and an
optional constraint value (seperated by an equals sign).
- Specified by:
createValidators in interface FieldValidatorSource
- Returns:
- a composite field validator
Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.