com.atlassian.jira.web.component.cron.parser
Class CronDayOfWeekEntry

java.lang.Object
  extended by com.atlassian.jira.web.component.cron.parser.CronDayOfWeekEntry

public class CronDayOfWeekEntry
extends Object

Parser for the day of week part of a cron string. This class is responsible for parsing and validating the day of week entry. The isValid() method refers only to what is supported by the cron editor for the day of week entry.

Valid day of week means a numerical day of week (1-7) or string representation (MON-SUN) which can be separated by a ',' to indicate a list of days. You can also specify a single day (2) followed by '#' and a number (either 1, 2, 3, or 4). This represents the first, second, third, or fourth week in the month for that day (e.g. 2#2 means the second Monday of the month). This can also be a single day (2) followed by the character 'L' which indicates the last of that day in the month (e.g. 2L means the last monday in the month).


Constructor Summary
CronDayOfWeekEntry(String dayOfWeekEntry)
          Parses the given cron entry.
 
Method Summary
 String getDayInMonthOrdinal()
          Returns a number that represents the first, second third etc.
 String getDaysAsNumbers()
          Will create a comma separated list of the days' numeric values that are specifed by the cron string.
 boolean isDaySpecified(String dayStr)
          Will tell you if a day has been specified in the cron string.
 boolean isValid()
          Returns true if the editor can handle the day of week field entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CronDayOfWeekEntry

public CronDayOfWeekEntry(String dayOfWeekEntry)
Parses the given cron entry.

Parameters:
dayOfWeekEntry - e.g. MON#2, 2#2 or MON,WED or 1,2,3 or 2L.
Method Detail

isDaySpecified

public boolean isDaySpecified(String dayStr)
Will tell you if a day has been specified in the cron string.

Parameters:
dayStr - can be any of 1-7, MON-SUN, mon-sun.
Returns:
true if the cron spec specified the passed in day, false otherwise.

getDayInMonthOrdinal

public String getDayInMonthOrdinal()
Returns a number that represents the first, second third etc. day of the week in a month.

Returns:
the ordinal or -1 if this entry doesn't specify it.

getDaysAsNumbers

public String getDaysAsNumbers()
Will create a comma separated list of the days' numeric values that are specifed by the cron string.

Returns:
string representing days (e.g. "1,2,3").

isValid

public boolean isValid()
Returns true if the editor can handle the day of week field entry.



Copyright © 2002-2008 Atlassian. All Rights Reserved.