com.sas.util.validators
Class RequiredStringValidator
com.sas.util.validators.RequiredStringValidator
All Implemented Interfaces: ValidationInterface , java.io.Serializable
public class RequiredStringValidator
A Validator that validates that the value entered is not null, a zero-length string, or consists only of
whitespace.
See Also: Serialized Form
RB_KEY
public static final java.lang.String RB_KEY
See Also: Constant Field Values
invalidLength
public static final java.lang.String invalidLength
See Also: Constant Field Values
notString
public static final java.lang.String notString
See Also: Constant Field Values
INVALID_LENGTH
protected static final int INVALID_LENGTH
See Also: Constant Field Values
NOT_STRING
protected static final int NOT_STRING
See Also: Constant Field Values
RequiredStringValidator
public RequiredStringValidator ()
Default constructor
RequiredStringValidator
public RequiredStringValidator (java.lang.String customValidationMessage)
Constructor that displays a custom validation message. The validation
message is displayed when the value entered in the field is invalid.
Parameters: customValidationMessage
- message to be displayed when value is invalid
validateValue
public boolean validateValue (java.lang.Object component,
java.lang.Object value)
Description copied from class: Validator
Default implementation. Returns true. Subclasses should override
and perform the actual validation.
Specified by: validateValue
in interface ValidationInterface
Overrides: validateValue
in class Validator
Parameters: component
- an object containing the valuevalue
- the value to be validated
Returns: true if the value us valid, false if not.
If false is returned, the
validator should call setValidationMessage with a String for a reason. See Also: ValidationInterface.validateValue(java.lang.Object, java.lang.Object)
createValidationMessages
public void createValidationMessages ()
Description copied from class: Validator
createValidationMessages is called by the constructor to create the collection
of message objects that are accessed by validateValue. This can be overridden
by subclasses to allow for different messages to be displayed. For each message,
newValidationMessage is called to create the actual Message object. Other data can
then be set on the Message object if desired.
Overrides: createValidationMessages
in class Validator
See Also: Validator.newValidationMessage(java.lang.String)
Copyright © 2009 SAS Institute Inc. All Rights Reserved.