public final class InputValidator extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
EMAIL
Input validator for e-mail addresses.
|
static int |
ID |
static int |
STANDARD
Standard input validator.
|
| Constructor and Description |
|---|
InputValidator(java.lang.String form,
Context context)
Constructs a new input validator for a specific form and wiki session.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isBlank(java.lang.String input)
Returns
true if a supplied string is null or blank |
boolean |
validate(java.lang.String input,
java.lang.String label,
int type)
Validates a string against a particular pattern type: e-mail address, standard HTML input, etc.
|
boolean |
validateNotNull(java.lang.String input,
java.lang.String label)
Validates a string against the
STANDARD validator and additionally checks that the value is not null or blank. |
boolean |
validateNotNull(java.lang.String input,
java.lang.String label,
int type)
Validates a string against a particular pattern type and additionally checks that the value is not
null or blank. |
public static final int STANDARD
public static final int EMAIL
public static final int ID
public InputValidator(java.lang.String form, Context context)
form - the ID or name of the form this validator should be associated withcontext - the wiki contextpublic boolean validateNotNull(java.lang.String input, java.lang.String label)
STANDARD validator and additionally checks that the value is not null or blank.input - the string to validatelabel - the label for the string or field ("E-mail address")true if valid, false otherwisepublic boolean validateNotNull(java.lang.String input, java.lang.String label, int type)
null or blank.
Delegates to validate(String, String, int).public boolean validate(java.lang.String input, java.lang.String label, int type)
public static boolean isBlank(java.lang.String input)
true if a supplied string is null or blankinput - the string to checktrue if null or blank (zero-length); false otherwiseCopyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.