|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.markup.html.form.validation.AbstractValidator
wicket.markup.html.form.validation.LengthValidator
StringValidator
public class LengthValidator
Validates that a form component's string value is of a certain min/max length. Validators are constructed by calling the min, max and range static factory methods. For example, LengthValidator.min(6) would return a validator valid only when the input of the component it is attached to is at least 6 characters long. Likewise, LengthValidator.range(3, 5) would only validate a component containing between 3 and 5 characters (inclusive). Depending on which factory is used to create the validator, one or more of the following parameters are added to the error message interpolation:
| Constructor Summary | |
|---|---|
protected |
LengthValidator(boolean checkMin,
int min,
boolean checkMax,
int max)
Deprecated. Private constructor forces use of static factory method and static instances. |
| Method Summary | |
|---|---|
int |
getMax()
Deprecated. Gets the upper bound on valid length. |
int |
getMin()
Deprecated. Gets the lower bound on valid length. |
boolean |
isCheckMax()
Deprecated. Gets whether the maximum bound should be checked. |
boolean |
isCheckMin()
Deprecated. Gets whether the minimum bound should be checked. |
static LengthValidator |
max(int max)
Deprecated. Gets a length validator object that requires a maximum number of characters. |
protected java.util.Map |
messageModel(FormComponent formComponent)
Deprecated. Gets the default variables for interpolation. |
static LengthValidator |
min(int min)
Deprecated. Gets a length validator object that requires a minimum number of characters. |
static LengthValidator |
range(int min,
int max)
Deprecated. Gets a length validator object that requires a minimum and maximum number of characters. |
java.lang.String |
toString()
Deprecated. |
void |
validate(FormComponent formComponent)
Deprecated. Validates that a form component's value is of a certain minimum and/or maximum length. |
| Methods inherited from class wicket.markup.html.form.validation.AbstractValidator |
|---|
error, error, error, error, resourceKey |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected LengthValidator(boolean checkMin,
int min,
boolean checkMax,
int max)
checkMin - True if minimum bound should be checkedmin - Lower bound on valid lengthcheckMax - True if maximum bound should be checkedmax - Upper bound on valid length| Method Detail |
|---|
public static final LengthValidator min(int min)
min - Minimum number of characters
public static final LengthValidator max(int max)
max - Maximum number of characters
public static final LengthValidator range(int min,
int max)
min - Minimum number of charactersmax - Maximum number of characters
public final void validate(FormComponent formComponent)
formComponent - Component to validateIValidator.validate(wicket.markup.html.form.FormComponent)public final boolean isCheckMax()
public final boolean isCheckMin()
public final int getMax()
public final int getMin()
protected java.util.Map messageModel(FormComponent formComponent)
messageModel in class AbstractValidatorformComponent - form component
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||