|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||
@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface DateEqualThis annotation can be used to check if annotated field/method's date is equal to another date (property, which must be set using an expression). For instance
@DateEqual(otherDate="${parent.anotherDate}")
Where parent refers to the object that declares annotated field/method, thus anotherDate is a field or method of that object.
| Property | Supports normal value | Supports expression value | Note |
|---|---|---|---|
| applyToGroups | Yes | Yes | You can return a String[] array as expression or even a single String (which is then handled as a single group), the elements inside the array may be expressions too (or only the elements of the array can be an expression) |
| customCode | Yes | Yes | Normal is a property name (from a properties file), an expression must resolve to a String that is a property again |
| globalMessage | Yes | No | |
| otherDate | No | Yes | |
| convertType | Yes | No | |
| pattern | Yes | Yes | An expression must resolve to a date pattern (see pattern documentation) |
Note: If you need to compare dates through String values (as input), please
check DateCheck.
DateCheck,
DateBefore,
DateAfter,
DateNotEqual| Required Element Summary | |
|---|---|
java.lang.String |
otherDate
Expression which must point to another java.util.Date (or subclass) method/field. |
| Optional Element Summary | |
|---|---|
java.lang.String[] |
applyToGroups
Specify for which groups this annotation must be applied. |
int |
convertType
The dates are converted to this type, meaning that the actual comparison is done this way (e.g TYPE_CONVERT_DATE means that the dates are compared on their date's only, time is not included). |
java.lang.String |
customCode
Optional custom code (property from a properties file). |
boolean |
globalMessage
If this annotation's message must be added as global message instead of real validation path. |
java.lang.String |
pattern
The pattern used when converting dates to a representation in the validion error messages. |
| Element Detail |
|---|
public abstract java.lang.String otherDate
public abstract int convertType
public abstract java.lang.String pattern
This is used only for representational issues. Can be specified in normal text or as an expression (the latter can be used so you can assure the appropriate pattern for a locale is used).
public abstract java.lang.String[] applyToGroups
Defaults to JvGroup.GROUP_APPLY_ALL
public abstract java.lang.String customCode
This way you can override the default message if needed.
public abstract boolean globalMessage
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | ||||||||