public final class YearlySchedule extends ConstrainedSchedule implements java.io.Serializable
The format for dates is MM-dd, i.e. 03-02 is The second of March.
The format for months is either the month number, 1 to 12 or one of JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER (case insensitive).
<schedules:list xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
<schedules>
<schedules:yearly fromMonth="4" toMonth="9">
<refinement>
<schedules:daily at="10:00"/>
</refinement>
</schedules:yearly>
<schedules:yearly fromMonth="10" toMonth="3">
<refinement>
<schedules:daily at="11:00"/>
</refinement>
</schedules:yearly>
</schedules>
</schedules:list>
Instead of month numbers, English month names can be used. This is
equivalent to the above.
<schedules:list xmlns:schedules="http://rgordon.co.uk/oddjob/schedules">
<schedules>
<schedules:yearly fromMonth="April" toMonth="September">
<refinement>
<schedules:daily at="10:00"/>
</refinement>
</schedules:yearly>
<schedules:yearly fromMonth="October" toMonth="March">
<refinement>
<schedules:daily at="11:00"/>
</refinement>
</schedules:yearly>
</schedules>
</schedules:list>
<schedules:yearly fromDate="12-25" toDate="12-26" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>
<schedules:yearly onDate="01-01" xmlns:schedules="http://rgordon.co.uk/oddjob/schedules"/>
| Modifier and Type | Field and Description |
|---|---|
static java.util.regex.Pattern |
DAY_FORMAT |
| Constructor and Description |
|---|
YearlySchedule() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Calendar |
fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the start of the constraint.
|
java.lang.String |
getFromDate() |
Month |
getFromMonth() |
java.lang.String |
getToDate() |
Month |
getToMonth() |
protected CalendarUnit |
intervalBetween()
Sub classes must provide a unit which is what must be
added to move the schedule on.
|
void |
setFromDate(java.lang.String from) |
void |
setFromMonth(Month from) |
void |
setInMonth(Month in) |
void |
setOnDate(java.lang.String on) |
void |
setToDate(java.lang.String to) |
void |
setToMonth(Month to) |
protected java.util.Calendar |
toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
Provide a Calendar for the end of the constraint.
|
java.lang.String |
toString()
Override toString.
|
lastInterval, nextDue, nextInterval, shiftFromCalendar, shiftToCalendargetRefinement, setRefinementpublic void setFromMonth(Month from)
public Month getFromMonth()
public void setToMonth(Month to)
public Month getToMonth()
public void setInMonth(Month in)
Property: inMonth
Description: The month in which this schedule is for. This has the same effect as setting fromMonth and toMonth to the same thing.
Required: No.
in - The in month.public void setFromDate(java.lang.String from)
public java.lang.String getFromDate()
public void setToDate(java.lang.String to)
public java.lang.String getToDate()
public void setOnDate(java.lang.String on)
Property: onDate
Description: The day on which this schedule is for. This has the same effect as setting fromDate and toDate to the same thing.
Required: No.
on - The day on which this schedule is for.protected CalendarUnit intervalBetween()
ConstrainedScheduleintervalBetween in class ConstrainedScheduleprotected java.util.Calendar fromCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
ConstrainedSchedulefromCalendar in class ConstrainedSchedulereferenceDate - The date/time now.timeZone - The time zone.protected java.util.Calendar toCalendar(java.util.Date referenceDate,
java.util.TimeZone timeZone)
ConstrainedScheduletoCalendar in class ConstrainedSchedulereferenceDate - The date/time now.timeZone - The time zone.public java.lang.String toString()
toString in class ConstrainedSchedule