|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.util.validators.DateStringValidator
public class DateStringValidator
A Validator that validates a String value according to a DateFormat
Field Summary | |
---|---|
protected java.text.DateFormat |
format
The format used to parse strings as date values. |
protected static int |
INVALID_FORMAT
Index in messages collection where the invlalidFormat message is. |
static java.lang.String |
invalidFormat
message key indicating validateValue failed because the string value could not be parsed according to the DateFormat. |
protected static int |
ONLY_STRING
Index in messages collection where the onlyString message is. |
static java.lang.String |
onlyString
message key indicating validateValue failed because the value passsed was not a String. |
static java.lang.String |
RB_KEY
|
Fields inherited from class com.sas.util.validators.Validator |
---|
message, messages, msgObject |
Constructor Summary | |
---|---|
DateStringValidator()
Deprecated. this constructor is deprecated; you should construct the DateStringValidator with a DateFormat, or call setFormat(DateFormat) |
|
DateStringValidator(java.text.DateFormat format)
Construct a DateStringValidator which validates String values by prsing them with a DateFormat. |
|
DateStringValidator(java.lang.String formatString)
Construct a DateStringValidator which validates String values by parsing them with a java.text.SimpleDateFormat constructed from the formatString. |
Method Summary | |
---|---|
void |
createValidationMessages()
Stores in the messages collection the set of possible messages generated by validateValue |
java.text.DateFormat |
getFormat()
Return the DateFormat used to parse string values as Dates. |
void |
setFormat(java.text.DateFormat newFormat)
Set the DateFormat format used to parse strings values as dates. |
boolean |
validateValue(java.lang.Object component,
java.lang.Object value)
Validate a value |
Methods inherited from class com.sas.util.validators.Validator |
---|
getExtendedBeanInfo, getValidationMessage, getValidationMessageCode, newValidationMessage, normalizeValue, setValidationMessage, setValidationMessageCode |
Field Detail |
---|
public static final java.lang.String RB_KEY
protected static int INVALID_FORMAT
protected static int ONLY_STRING
public static final java.lang.String invalidFormat
public static final java.lang.String onlyString
protected java.text.DateFormat format
Constructor Detail |
---|
public DateStringValidator()
DateStringValidator(java.text.DateFormat)
,
DateStringValidator(java.lang.String)
public DateStringValidator(java.lang.String formatString)
formatString
- a String used to construct a java.text.SimpleDateFormat
which is used to parse a date strings.public DateStringValidator(java.text.DateFormat format)
format
- a DateFormat object to use to parse a date strings.Method Detail |
---|
public void setFormat(java.text.DateFormat newFormat)
newFormat
- the new value for the format property.
If null, use the Date(String) constructor.public java.text.DateFormat getFormat()
public boolean validateValue(java.lang.Object component, java.lang.Object value)
validateValue
in interface ValidationInterface
validateValue
in class Validator
component
- the component containing the valuevalue
- the value to be validated
ValidationInterface.validateValue(java.lang.Object, java.lang.Object)
public void createValidationMessages()
createValidationMessages
in class Validator
Validator.newValidationMessage(java.lang.String)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |