public class

CronEditorBean

extends Object
java.lang.Object
   ↳ com.atlassian.jira.web.component.cron.CronEditorBean

Class Overview

Represents the form state for the CronEditorWebComponent.

Summary

Constants
String ADVANCED_MODE
String DAILY_SPEC_MODE
String DAYS_OF_MONTH_SPEC_MODE
String DAYS_OF_WEEK_SPEC_MODE
String DOT
Public Constructors
CronEditorBean()
CronEditorBean(String paramPrefix, Map params)
Initialises to the state defined by the given params, which are identified by the presence of paramPrefix on the key.
Public Methods
String getCronString()
Returns the cron string that the object was constructed with.
String getDayInMonthOrdinal()
Returns a number that represents the first, second third etc.
String getDayOfMonth()
Gets the day of month field specified in the cron string.
String getHoursFrom()
Returns the lower bound of the hour range if this entry has a range.
String getHoursFromMeridian()
Returns the meridian indicator @{link #AM} or @{link #PM} for the lower bound of a range entry.
String getHoursRunOnce()
Returns the single hour value for this entry if it is a run once entry.
String getHoursRunOnceMeridian()
Returns the meridian indicator @{link #AM} or @{link #PM} for the entry if it is a run once entry.
String getHoursTo()
Returns the upper bound of the hour range if this entry has a range.
String getHoursToMeridian()
Returns the meridian indicator @{link #AM} or @{link #PM} for the upper bound of a range entry.
String getIncrementInMinutes()
Used to determine the total increment in minutes derived by the hour and minutes fields' increment parts.
String getMinutes()
Gets the minutes specified.
String getSeconds()
String getSpecifiedDaysPerWeek()
Returns all the days that have been specified in a comma separated list.
boolean is24HourRange()
Indicates that the range of time specified spans across the full 24 hours in a day (which is indicated by the computed hoursFrom in 24 hour time being equal to the computed hoursTo in 24 hour time).
boolean isAdvancedMode()
Will return true if the passed in cron string is not valid for the editor.
boolean isDailyMode()
Will return true if the editors daily mode can handle the provided cron string.
boolean isDayOfWeekOfMonth()
Returns true if isDaysPerMonthMode() is true and the sub-mode of day of week per month has been selected.
boolean isDayPerWeekMode()
Will return true if the editors day per week mode can handle the provided cron string.
boolean isDaySpecified(String dayStr)
Returns true if the passed in day has been specified, false otherwise.
boolean isDaysPerMonthMode()
Will return true if the editors days per month mode can handle the provided cron string.
boolean isRange()
Indicates that a range of time is being specified.
boolean isRangeHoursValid()
Used to validate the hours to see that the from hour is before the to hour, if specified.
void setCronString(String cronString)
The full cron string that may have been specified.
void setDayInMonthOrdinal(String dayInMonthOrdinal)
void setDayOfMonth(String dayOfMonth)
void setDayOfWeekOfMonth(boolean dayOfWeekOfMonth)
void setHoursFrom(String hoursFrom)
void setHoursFromMeridian(String hoursFromMeridian)
void setHoursRunOnce(String hoursRunOnce)
void setHoursRunOnceMeridian(String hoursRunOnceMeridian)
void setHoursTo(String hoursTo)
void setHoursToMeridian(String hoursToMeridian)
void setIncrementInMinutes(String incrementInMinutes)
Set the interval of repetition.
void setMinutes(String minutes)
void setMode(String mode)
void setSeconds(String seconds)
void setSpecifiedDaysOfWeek(String specifiedDaysOfWeek)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ADVANCED_MODE

Constant Value: "advanced"

public static final String DAILY_SPEC_MODE

Constant Value: "daily"

public static final String DAYS_OF_MONTH_SPEC_MODE

Constant Value: "daysOfMonth"

public static final String DAYS_OF_WEEK_SPEC_MODE

Constant Value: "daysOfWeek"

public static final String DOT

Constant Value: "."

Public Constructors

public CronEditorBean ()

public CronEditorBean (String paramPrefix, Map params)

Initialises to the state defined by the given params, which are identified by the presence of paramPrefix on the key.

Parameters
paramPrefix the prefix used on each of the params.
params state parameters to use.

Public Methods

public String getCronString ()

Returns the cron string that the object was constructed with. This method does not guarantee that the returned cron string is valid.

Returns
  • unmodified cronString

public String getDayInMonthOrdinal ()

Returns a number that represents the first, second third etc. day of the week in a month.

Returns
  • the ordinal or null if this entry doesn't specify it.

public String getDayOfMonth ()

Gets the day of month field specified in the cron string. Should be between 1-31 or L.

public String getHoursFrom ()

Returns the lower bound of the hour range if this entry has a range.

This end of the range is inclusive - e.g. if HoursFrom is 3PM and HoursTo is 5PM, the duration of the range is 2 hours.

Returns
  • the lower bound or null if this is not a range hour entry.

public String getHoursFromMeridian ()

Returns the meridian indicator @{link #AM} or @{link #PM} for the lower bound of a range entry.

Returns
  • the meridian belonging to the lower bound hour or null if this is not a range entry.

public String getHoursRunOnce ()

Returns the single hour value for this entry if it is a run once entry.

Returns
  • the hour value or null if this is not a run once hour entry.

public String getHoursRunOnceMeridian ()

Returns the meridian indicator @{link #AM} or @{link #PM} for the entry if it is a run once entry.

Returns
  • the meridian belonging single hour value or null if this is not a run once entry.

public String getHoursTo ()

Returns the upper bound of the hour range if this entry has a range.

This end of the range is exclusive - e.g. if HoursFrom is 3PM and HoursTo is 5PM, the duration of the range is 2 hours.

Returns
  • the upper bound or null if this is not a range hour entry.

public String getHoursToMeridian ()

Returns the meridian indicator @{link #AM} or @{link #PM} for the upper bound of a range entry.

Returns
  • the meridian belonging to the upper bound hour or null if this is not a range entry.

public String getIncrementInMinutes ()

Used to determine the total increment in minutes derived by the hour and minutes fields' increment parts. An increment of 0 indicates no repetition based on the hours or minutes fields and will happen if the repetition is once a day.

Returns
  • a minute increment or "0"

public String getMinutes ()

Gets the minutes specified. Should be between 0-59.

public String getSeconds ()

public String getSpecifiedDaysPerWeek ()

Returns all the days that have been specified in a comma separated list.

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

public boolean is24HourRange ()

Indicates that the range of time specified spans across the full 24 hours in a day (which is indicated by the computed hoursFrom in 24 hour time being equal to the computed hoursTo in 24 hour time).

Returns
  • true only if we have specified a range, and that range spans across the 24 hours.

public boolean isAdvancedMode ()

Will return true if the passed in cron string is not valid for the editor.

Returns
  • true if the cron string can not be handled, false otherwise.

public boolean isDailyMode ()

Will return true if the editors daily mode can handle the provided cron string.

Returns
  • if we're in daily mode.

public boolean isDayOfWeekOfMonth ()

Returns true if isDaysPerMonthMode() is true and the sub-mode of day of week per month has been selected.

public boolean isDayPerWeekMode ()

Will return true if the editors day per week mode can handle the provided cron string.

Returns

public boolean isDaySpecified (String dayStr)

Returns true if the passed in day has been specified, false otherwise.

Parameters
dayStr a string representing a day (e.g. 1-7).
Returns
  • true if the day has been specified, false otherwise.

public boolean isDaysPerMonthMode ()

Will return true if the editors days per month mode can handle the provided cron string.

Returns

public boolean isRange ()

Indicates that a range of time is being specified.

Returns
  • true only if the form state indicates a from and to time.

public boolean isRangeHoursValid ()

Used to validate the hours to see that the from hour is before the to hour, if specified. Note: to allow the range to run "all-day" (eg. from 12AM to 12AM), we need to also allow the from and to times to be equal.

Returns
  • true if from is before to or if they have not been specified.

public void setCronString (String cronString)

The full cron string that may have been specified. This can come from the advanced tab where the user has specified their own cron string. This does not validate the cron string.

Parameters
cronString a valid cron string.

public void setDayInMonthOrdinal (String dayInMonthOrdinal)

public void setDayOfMonth (String dayOfMonth)

public void setDayOfWeekOfMonth (boolean dayOfWeekOfMonth)

public void setHoursFrom (String hoursFrom)

public void setHoursFromMeridian (String hoursFromMeridian)

public void setHoursRunOnce (String hoursRunOnce)

public void setHoursRunOnceMeridian (String hoursRunOnceMeridian)

public void setHoursTo (String hoursTo)

public void setHoursToMeridian (String hoursToMeridian)

public void setIncrementInMinutes (String incrementInMinutes)

Set the interval of repetition. "0" indicates there is no repetition.

Parameters
incrementInMinutes the interval or "0"

public void setMinutes (String minutes)

public void setMode (String mode)

public void setSeconds (String seconds)

public void setSpecifiedDaysOfWeek (String specifiedDaysOfWeek)