com.planetalia.dynject.validation
Annotation Type IsDate


@Target(value={FIELD,METHOD})
@Retention(value=RUNTIME)
public @interface IsDate

Requires that the value be a date value. If it is not, it will attempt to perform a conversion according either using a provided pattern, or using the locale-dependant default pattern. Usually date conversions are performed automatically. You should use this annotation only if you want to specify a custom date pattern, and wish to avoid the number-to-date conversions

Author:
Alexander Hristov

Optional Element Summary
 java.lang.String defaultValue
          If set to something different than the default (the empty string), specifies a default value that is used whenever a null value is received.
 java.lang.String errorCode
          Error code to use if validation fails.
 java.lang.String message
          Literal message to use if validation fails.
 java.lang.String messageKey
          Message key to use if validation fails.
 java.lang.String value
          Pattern to use when parsing the data, if it is not natively date
 

value

public abstract java.lang.String value
Pattern to use when parsing the data, if it is not natively date

Returns:
Pattern to use when parsing the data, if it is not natively date
Default:
""

defaultValue

public abstract java.lang.String defaultValue
If set to something different than the default (the empty string), specifies a default value that is used whenever a null value is received. The default value is parsed to a Date

Returns:
Default value
Default:
""

message

public abstract java.lang.String message
Literal message to use if validation fails.

Returns:
Literal message to use if validation fails.
Default:
""

errorCode

public abstract java.lang.String errorCode
Error code to use if validation fails.

Returns:
Error code to use if validation fails.
Default:
""

messageKey

public abstract java.lang.String messageKey
Message key to use if validation fails. Default is Messages.DATE

Returns:
Message key to use if validation fails.
Default:
"dynject.validation.date"