com.sas.util.validators
Class IntegerStringValidator

com.sas.util.validators.IntegerStringValidator
All Implemented Interfaces:
ValidationInterface, java.io.Serializable
Direct Known Subclasses:
MinMaxIntegerStringValidator

public class IntegerStringValidator

See Also:
Serialized Form

Field Summary
protected static int INVALID_FORMAT
           
static java.lang.String invalidFormat
           
protected static int NOT_STRING
           
static java.lang.String notString
           
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.util.validators.Validator
message, messages, msgObject
 
Constructor Summary
IntegerStringValidator()
           
 
Method Summary
 void createValidationMessages()
          createValidationMessages is called by the constructor to create the collection of message objects that are accessed by validateValue.
 java.lang.Object normalizeValue(java.lang.Object component, java.lang.Object value)
          Default implementation.
 boolean validateValue(java.lang.Object component, java.lang.Object value)
          Default implementation.
 
Methods inherited from class com.sas.util.validators.Validator
getExtendedBeanInfo, getValidationMessage, getValidationMessageCode, newValidationMessage, setValidationMessage, setValidationMessageCode
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values

invalidFormat

public static final java.lang.String invalidFormat
See Also:
Constant Field Values

notString

public static final java.lang.String notString
See Also:
Constant Field Values

INVALID_FORMAT

protected static final int INVALID_FORMAT
See Also:
Constant Field Values

NOT_STRING

protected static final int NOT_STRING
See Also:
Constant Field Values
Constructor Detail

IntegerStringValidator

public IntegerStringValidator()
Method Detail

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 value
value - 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)

normalizeValue

public java.lang.Object normalizeValue(java.lang.Object component,
                                       java.lang.Object value)
Description copied from class: Validator
Default implementation. Returns the value passed in. Subclasses may override to modify the value and return it, or return a different Object.

Specified by:
normalizeValue in interface ValidationInterface
Overrides:
normalizeValue in class Validator
Parameters:
component - an object containing the value
value - the value to be normalized
Returns:
the normalized value. This can be the input value or a value drived from it.
See Also:
ValidationInterface.normalizeValue(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.