public class MinLength extends BaseValidator
Constructor and Description |
---|
MinLength() |
MinLength(java.lang.String initializer) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
buildMessage(ValidationMessages messages,
IFormComponent field) |
int |
getMinLength() |
void |
renderContribution(IMarkupWriter writer,
IRequestCycle cycle,
FormComponentContributorContext context,
IFormComponent field)
Does nothing.
|
void |
setMinLength(int minLength) |
void |
validate(IFormComponent field,
ValidationMessages messages,
java.lang.Object object)
Invoked to validate input for the field.
|
getAcceptsNull, getMessage, isRequired, setMessage
public MinLength()
public MinLength(java.lang.String initializer)
public void setMinLength(int minLength)
public int getMinLength()
public void validate(IFormComponent field, ValidationMessages messages, java.lang.Object object) throws ValidatorException
Validator
Translator
will have already converted the
submitted user input string into an object.field
- the form element component being validated, often used to determine the
user presentable name
for the field, used
in error messages.messages
- access to the pre-defined validation messages, in the appropriate localeobject
- the client-side representation of the field's data. May be null if the client did
not provide a value for the field (most Validators should check for null and
perform no check if null).ValidatorException
- if the object violates the constraint represented by this Validator.protected java.lang.String buildMessage(ValidationMessages messages, IFormComponent field)
public void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
BaseValidator
renderContribution
in interface FormComponentContributor
renderContribution
in class BaseValidator
writer
- allows contributor to write additional attributes into the component's tagcycle
- for accessing request informationcontext
- utilities for genering messages and client-side validationfield
- the field for which contributions are being rendered