public class AttributeLengthValidator extends ValidatorAdapter
Modifier and Type | Method and Description |
---|---|
AttributeLengthValidator |
allowBlank(boolean allowBlank) |
String |
formatMessage(Locale locale,
Object... params)
Provides default implementation, will look for a property in resource bundle, using set message as key.
|
static AttributeLengthValidator |
on(String attribute) |
void |
validate(Model m)
Called by framework when a
Model.validate() method called. |
AttributeLengthValidator |
with(LengthOption lengthOption) |
getMessage, setMessage
public static AttributeLengthValidator on(String attribute)
public void validate(Model m)
Validator
Model.validate()
method called.m
- model being validated.public AttributeLengthValidator with(LengthOption lengthOption)
public AttributeLengthValidator allowBlank(boolean allowBlank)
public String formatMessage(Locale locale, Object... params)
ValidatorAdapter
formatMessage
in interface Validator
formatMessage
in class ValidatorAdapter
locale
- locale to use, or null for default locale.params
- parameters in case a message is parametrized.Copyright © 2019 JavaLite. All rights reserved.