com.ibm.commons.iloader.node.validators
Interface IValidator

All Known Implementing Classes:
BooleanValidator, CharValidator, DateTimeValidator, DoubleValidator, FileNameValidator, IntegerValidator, LengthValidator, MultiValidator, RequiredValidator, StrictNumberValidator, StringValidator, UriValidator, UrlValidator, XmlNameValidator

public interface IValidator

IValidator interface that is used in conjunction with user input. The validator when associated with a widget can validate on keystroke and on focusLost events, allowing the implementor to reject certain keystrokes or combinations and to reject/accept cetain overall inputs.

See Also:
com.ibm.commons.iloader.node.validators.DoubleValidator}, com.ibm.commons.iloader.node.validators.IntegerValidator}, com.ibm.commons.iloader.node.validators.LengthValidator}, com.ibm.commons.iloader.node.validators.RequiredValidator}, com.ibm.commons.iloader.node.validators.CharValidator}, com.ibm.commons.iloader.node.validators.StringValidator}, com.ibm.commons.iloader.node.validators.XmlNameValidator}, com.ibm.commons.iloader.node.validators.MultiValidator}

Method Summary
 boolean isBeingValid(java.lang.String value)
          Determines if the current value is valid.
 boolean isValid(java.lang.String value, Messages messages)
          Determines if the overall input is valid.
 

Method Detail

isBeingValid

boolean isBeingValid(java.lang.String value)
Determines if the current value is valid. If it is not valid then it will not be accepted by the widget as being a valid input. (e.g. inputEvent.doit = false)

Parameters:
value - the string value which has been entered by the end user and requires validation.
Returns:
true if the input should be accepted.

isValid

boolean isValid(java.lang.String value,
                Messages messages)
Determines if the overall input is valid. If the input is valid then true is returned and no further action is required. If the input is invalid false is returned an a message can optionally be added to the messages bundle. Any messages added will be displayed to the end user in the form of a messagebox.

Parameters:
value - the string value which has been entered by the end user and requires validation.
messages - a bundle of messages to be displayed to the end user in the event that validation fails.
Returns:
true if the input should be accepted.