| java.lang.Object com.jidesoft.validation.ValidationResult
ValidationResult | public class ValidationResult (Code) | | ValidationResult is the object that returns from the
Validator.validating(ValidationObject) .
There are three things on the result.
- valid: whether the result is valid. It can be true or false.
- id: an int value of the result. It's better to reserve value 0 for valid result.
For invalid result, you can use whatever value as long as it's consistent across your application.
- message: a String value of result. You can use this string value to put a message to indicate why the validation
failed.
Users can extend this class to create their own ValidationResult to provide
additional information that needed to be returned from Validator.
|
Field Summary | |
final public static int | FAIL_BEHAVIOR_PERSIST When validation fails, do not stop cell editing until user enters a valid value or press ESCAPE to cancel the editing. | final public static int | FAIL_BEHAVIOR_RESET When validation fails, reset the value to null. | final public static int | FAIL_BEHAVIOR_REVERT When validation fails, reverts back to the previous valid value. | final public static ValidationResult | OK The shared ValidationResult when the validation result is valid. |
Constructor Summary | |
public | ValidationResult() Creates an empty ValidationResult. | public | ValidationResult(int id) Creates an invalid ValidationResult with an id and no message. | public | ValidationResult(boolean valid) Creates an empty ValidationResult. | public | ValidationResult(int id, String message) Creates an invalid ValidationResult with an id and a message. | public | ValidationResult(int id, boolean valid, String message) Creates an ValidationResult with an id and a message. | public | ValidationResult(int id, boolean valid, int failBehavoir) Creates an ValidationResult with an id and an error behavior. | public | ValidationResult(int id, boolean valid, int failBehavoir, String message) Creates an ValidationResult with an id, a message and an error behavior. |
Method Summary | |
public int | getFailBehavior() Gets the behavior if validation fails. | public int | getId() Gets the id of the ValidationResult. | public String | getMessage() Gets the message associated with the ValidationResult. | public boolean | isValid() Checks if the validation state is valid.
the validation state. | public void | setFailBehavior(int failBehavior) Sets the behavior if validation fails. | public void | setId(int id) Sets the id of the ValidationResult. | public void | setMessage(String message) Sets the message associated with the ValidationResult. | public void | setValid(boolean valid) Sets the validation state. | public String | toString() |
FAIL_BEHAVIOR_PERSIST | final public static int FAIL_BEHAVIOR_PERSIST(Code) | | When validation fails, do not stop cell editing until user enters a valid value or press ESCAPE to cancel the editing.
|
FAIL_BEHAVIOR_RESET | final public static int FAIL_BEHAVIOR_RESET(Code) | | When validation fails, reset the value to null.
|
FAIL_BEHAVIOR_REVERT | final public static int FAIL_BEHAVIOR_REVERT(Code) | | When validation fails, reverts back to the previous valid value.
|
OK | final public static ValidationResult OK(Code) | | The shared ValidationResult when the validation result is valid.
|
ValidationResult | public ValidationResult()(Code) | | Creates an empty ValidationResult. The valid is set to false.
|
ValidationResult | public ValidationResult(int id)(Code) | | Creates an invalid ValidationResult with an id and no message.
Parameters: id - |
ValidationResult | public ValidationResult(boolean valid)(Code) | | Creates an empty ValidationResult.
Parameters: valid - |
ValidationResult | public ValidationResult(int id, String message)(Code) | | Creates an invalid ValidationResult with an id and a message.
Parameters: id - Parameters: message - |
ValidationResult | public ValidationResult(int id, boolean valid, String message)(Code) | | Creates an ValidationResult with an id and a message.
Parameters: id - Parameters: valid - Parameters: message - |
ValidationResult | public ValidationResult(int id, boolean valid, int failBehavoir)(Code) | | Creates an ValidationResult with an id and an error behavior.
Parameters: id - Parameters: valid - Parameters: failBehavoir - |
ValidationResult | public ValidationResult(int id, boolean valid, int failBehavoir, String message)(Code) | | Creates an ValidationResult with an id, a message and an error behavior.
Parameters: id - Parameters: valid - Parameters: failBehavoir - Parameters: message - |
getFailBehavior | public int getFailBehavior()(Code) | | Gets the behavior if validation fails.
the behavior if validation fails. |
getId | public int getId()(Code) | | Gets the id of the ValidationResult.
the id. |
getMessage | public String getMessage()(Code) | | Gets the message associated with the ValidationResult.
the message. |
isValid | public boolean isValid()(Code) | | Checks if the validation state is valid.
the validation state. True means valid. Otherwise, false. |
setId | public void setId(int id)(Code) | | Sets the id of the ValidationResult.
Parameters: id - |
setMessage | public void setMessage(String message)(Code) | | Sets the message associated with the ValidationResult.
Parameters: message - the new message. |
setValid | public void setValid(boolean valid)(Code) | | Sets the validation state.
Parameters: valid - |
|
|