Package org.javalite.validation.length
Class AttributeLengthValidator
- java.lang.Object
-
- org.javalite.validation.ValidatorAdapter
-
- org.javalite.validation.length.AttributeLengthValidator
-
- All Implemented Interfaces:
Validator
public class AttributeLengthValidator extends ValidatorAdapter
Attribute length validator.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeLengthValidatorallowBlank(boolean allowBlank)StringformatMessage(Locale locale, Object... params)Provides default implementation, will look for a property in resource bundle, using set message as key.static AttributeLengthValidatoron(String attribute)voidvalidate(Validatable m)Called by framework when validation is requiredAttributeLengthValidatorwith(LengthOption lengthOption)-
Methods inherited from class org.javalite.validation.ValidatorAdapter
getMessage, pinMessage, setMessage
-
-
-
-
Method Detail
-
on
public static AttributeLengthValidator on(String attribute)
-
validate
public void validate(Validatable m)
Description copied from interface:ValidatorCalled by framework when validation is required- Parameters:
m- map being validated.
-
with
public AttributeLengthValidator with(LengthOption lengthOption)
-
allowBlank
public AttributeLengthValidator allowBlank(boolean allowBlank)
-
formatMessage
public String formatMessage(Locale locale, Object... params)
Description copied from class:ValidatorAdapterProvides default implementation, will look for a property in resource bundle, using set message as key. If property in resource bundle not found, treats message verbatim.- Specified by:
formatMessagein interfaceValidator- Overrides:
formatMessagein classValidatorAdapter- Parameters:
locale- locale to use, or null for default locale.params- parameters in case a message is parametrized.- Returns:
- formatted message.
-
-