|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.validators.Validator
public class Validator
This is the base validator class which provides a default implementation of the ValidationInterface. Validator also provides a base framework for creating, storing, and overriding Message objects used during the validation.
Field Summary | |
---|---|
protected java.lang.String |
message
The validation message code. |
protected java.util.ArrayList |
messages
The list of com.sas.text.Message objects which can be used by the validation code. |
protected com.sas.text.Message |
msgObject
The validation message which was set the last time validateValue returned false. |
static java.lang.String |
RB_KEY
|
Constructor Summary | |
---|---|
Validator()
Constructor. |
Method Summary | |
---|---|
void |
createValidationMessages()
createValidationMessages is called by the constructor to create the collection of message objects that are accessed by validateValue. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
|
com.sas.text.Message |
getValidationMessage()
Returns the Message object set with setValidationMessage. |
java.lang.String |
getValidationMessageCode()
Returns the message code String set in setValidationMessage. |
com.sas.text.Message |
newValidationMessage(java.lang.String template)
Creates a new Message object to store a message and it's arguments. |
java.lang.Object |
normalizeValue(java.lang.Object component,
java.lang.Object value)
Default implementation. |
void |
setValidationMessage(com.sas.text.Message message)
Sets the message to be displayed in the error handler when the validation returns false. |
void |
setValidationMessageCode(java.lang.String message)
Sets the String used to indicate why the validation failed. |
boolean |
validateValue(java.lang.Object component,
java.lang.Object value)
Default implementation. |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected java.lang.String message
protected com.sas.text.Message msgObject
protected java.util.ArrayList messages
Constructor Detail |
---|
public Validator()
createValidationMessages()
Method Detail |
---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public boolean validateValue(java.lang.Object component, java.lang.Object value)
validateValue
in interface ValidationInterface
component
- an object containing the valuevalue
- the value to be validated
ValidationInterface.validateValue(java.lang.Object, java.lang.Object)
public java.lang.Object normalizeValue(java.lang.Object component, java.lang.Object value)
normalizeValue
in interface ValidationInterface
component
- an object containing the valuevalue
- the value to be normalized
ValidationInterface.normalizeValue(java.lang.Object, java.lang.Object)
public java.lang.String getValidationMessageCode()
getValidationMessageCode
in interface ValidationInterface
ValidationInterface.getValidationMessageCode()
public com.sas.text.Message getValidationMessage()
getValidationMessage
in interface ValidationInterface
ValidationInterface.getValidationMessage()
public void setValidationMessage(com.sas.text.Message message)
setValidationMessage
in interface ValidationInterface
message
- a Message object that contains a format string and substitution values,
which describe why the value passed to validateValue() is invalid.ValidationInterface.setValidationMessage(com.sas.text.Message)
public void setValidationMessageCode(java.lang.String message)
setValidationMessage(com.sas.text.Message)
public void createValidationMessages()
newValidationMessage(java.lang.String)
public com.sas.text.Message newValidationMessage(java.lang.String template)
createValidationMessages()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |