public class CharValidator
extends org.apache.wicket.validation.validator.AbstractValidator<java.lang.String>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
allowed |
protected boolean |
strict |
static CharValidator |
STRICT
The STRICT validator only allows numbers, letters and "_".
|
Constructor and Description |
---|
CharValidator() |
CharValidator(boolean strict) |
CharValidator(boolean strict,
java.lang.String allowed)
Creates a new char filter with optional strictness, and a string of characters that are explicitly allowed
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isStrictValidChars(java.lang.String x)
Returns true if
x is null or:Starts with a letter and consists of: Letters digits _ (underscore) |
static boolean |
isValidChars(java.lang.String x)
Returns true if
x is null or consists of:
Letters
digits
. |
protected void |
onValidate(org.apache.wicket.validation.IValidatable<java.lang.String> validatable) |
error, error, error, error, resourceKey, validate, validateOnNullValue, variablesMap
public static final CharValidator STRICT
protected boolean strict
protected java.lang.String allowed
public CharValidator()
public CharValidator(boolean strict)
public CharValidator(boolean strict, java.lang.String allowed)
strict
- allowed
- public static boolean isStrictValidChars(java.lang.String x)
x
is null or:x
- public static boolean isValidChars(java.lang.String x)
x
is null or consists of:
x
- protected void onValidate(org.apache.wicket.validation.IValidatable<java.lang.String> validatable)
onValidate
in class org.apache.wicket.validation.validator.AbstractValidator<java.lang.String>