public class NopValidator extends Object implements FieldValidator
<bean id="trueValidator"
class="no.g9.client.core.validator.NopValidator">
<property name="result" value="false" />
</bean>
This bean supports the following properties:
<li> result: A boolean that tells if validations should succeed or not.
<li> messageNumber: Specifies message number to return on all validations.
<li> messageArgs: An array that specifies message arguments to return.
By default, this validator will return true for all validations.| Constructor and Description |
|---|
NopValidator()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
setMessageArgs(Object[] messageArgs)
Sets message text to return on failed validations.
|
void |
setMessageID(String messageID)
Sets message number to return on failed validations.
|
void |
setResult(boolean result)
Sets the result to return for validation queries.
|
ValidationResult |
validate(Object value,
ValidateContext context)
Validates a candidate value.
|
public void setResult(boolean result)
result - the result to setpublic void setMessageID(String messageID)
messageID - The message id to return on failed validationspublic void setMessageArgs(Object[] messageArgs)
messageArgs - The message text to return on failed validationspublic ValidationResult validate(Object value, ValidateContext context)
FieldValidatorvalidate in interface FieldValidatorvalue - The candidate value to validatecontext - Validation contextCopyright © 2006–2020 Esito AS. All rights reserved.