|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.wicket.validation.validator.AbstractValidator<String>
org.apache.wicket.validation.validator.StringValidator
public abstract class StringValidator
Validator for checking String
lengths. Usually this validator is used through the
static factory methods, but it and its inner classes can also be subclassed directly.
Nested Class Summary | |
---|---|
static class |
StringValidator.ExactLengthValidator
Validator for checking if the length of a String is exactly the specified
length. |
static class |
StringValidator.LengthBetweenValidator
Validator for checking if the length of a String is within the specified range. |
static class |
StringValidator.MaximumLengthValidator
Validator for checking if the length of a String meets the maximum length
requirement. |
static class |
StringValidator.MinimumLengthValidator
Validator for checking if the length of a String meets the minimum length
requirement. |
Constructor Summary | |
---|---|
StringValidator()
|
Method Summary | |
---|---|
static StringValidator |
exactLength(int length)
Gets a String exact length validator for checking if a string length is exactly
the same as the given length value. |
static StringValidator |
lengthBetween(int minimum,
int maximum)
Gets a String range validator for checking if a string length falls between the
minimum and and maximum lengths. |
static StringValidator |
maximumLength(int maximum)
Gets a String maximum validator for checking if a string length is smaller than
the given maximum value. |
static StringValidator |
minimumLength(int minimum)
Gets a String minimum validator for checking if a string length is greater than
the given minimum value. |
Methods inherited from class org.apache.wicket.validation.validator.AbstractValidator |
---|
error, error, error, error, messageModel, onValidate, resourceKey, resourceKey, validate, validate, validateOnNullValue, variablesMap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringValidator()
Method Detail |
---|
public static StringValidator exactLength(int length)
String
exact length validator for checking if a string length is exactly
the same as the given length value. If that is not the case, then an error message will be
generated with the key "StringValidator.exact". The message keys that can be used are:
Component
that failedComponent
- either comes from
FormComponent.labelModel
or resource key [form-id].[form-component-id] in that
order
length
- the required length of the string
StringValidator
public static StringValidator lengthBetween(int minimum, int maximum)
String
range validator for checking if a string length falls between the
minimum and and maximum lengths. If that is not the case, then an error message will be
generated with the key "StringValidator.range". The message keys that can be used are:
Component
that failedComponent
- either comes from
FormComponent.labelModel
or resource key [form-id].[form-component-id] in that
order
minimum
- the minimum length of the stringmaximum
- the maximum length of the string
StringValidator
public static StringValidator maximumLength(int maximum)
String
maximum validator for checking if a string length is smaller than
the given maximum value. If that is not the case, then an error message will be generated
with the key "StringValidator.maximum". The message keys that can be used are:
Component
that failedComponent
- either comes from
FormComponent.labelModel
or resource key [form-id].[form-component-id] in that
order
maximum
- the maximum length of the string
StringValidator
public static StringValidator minimumLength(int minimum)
String
minimum validator for checking if a string length is greater than
the given minimum value. If that is not the case, then an error message will be generated
with the key "StringValidator.minimum". The message keys that can be used are:
Component
that failedComponent
- either comes from
FormComponent.labelModel
or resource key [form-id].[form-component-id] in that
order
minimum
- the minimum length of the string
StringValidator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |