net.sourceforge.annovalidator.util
Annotation Type DateUtil.DateSource


@Retention(value=RUNTIME)
@Target(value=PARAMETER)
public static @interface DateUtil.DateSource

Specifies a date to be passed as an argument to a validator.

The date can be derived from four sources, defined by sourceType():

TARGET_FIELD_VALUE
The value of the Field being validated.
TARGET_OBJECT_FIELD_VALUE
The value of the fieldName() Field of the Object being validated.
TEXT_DATE
A plain text date specified by date().
COMPOSITE
A date composed of mulitple parts, specified by compositeDateParts().
dateFormats() specifies an array of formats that can be used to convert text dates for all SourceTypes except COMPOSITE.


Optional Element Summary
 DateUtil.CompositeDatePart[] compositeDateParts
          An array of CompositeDateParts defining the fields that make up the date when sourceType() is COMPOSITE.
 java.lang.String date
          The date, when sourceType() is TEXT_DATE.
 java.lang.String[] dateFormats
          An array of conversion formats that can be used to convert a text date.
 java.lang.String fieldName
          The name of the Field containing the date, when sourceType() is TARGET_OBJECT_FIELD_VALUE.
 DateUtil.DateSource.SourceType sourceType
          The type of date source used to retrieve the date.
 

sourceType

public abstract DateUtil.DateSource.SourceType sourceType
The type of date source used to retrieve the date.

Default:
TARGET_FIELD_VALUE

date

public abstract java.lang.String date
The date, when sourceType() is TEXT_DATE.

Default:
""

fieldName

public abstract java.lang.String fieldName
The name of the Field containing the date, when sourceType() is TARGET_OBJECT_FIELD_VALUE.

Default:
""

dateFormats

public abstract java.lang.String[] dateFormats
An array of conversion formats that can be used to convert a text date. Should contain a single value matching the format of date() when sourceType() is TEXT_DATE, or a selection of formats allowed by your application for TARGET_FIELD_VALUE and TARGET_OBJECT_FIELD_VALUE. COMPOSITE does not make use of dateFormats().

Default:
{}

compositeDateParts

public abstract DateUtil.CompositeDatePart[] compositeDateParts
An array of CompositeDateParts defining the fields that make up the date when sourceType() is COMPOSITE.

Default:
{}


Copyright © 2008. All Rights Reserved.