|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.web.component.cron.parser.CronExpressionParser
public class CronExpressionParser
Represents a cron string with accessor methods to get at the individual fields. This is only used to back our
Cron editor. This will tell you via the isValidForEditor()
method whether the cron string this is constructed
with will be parseable via the editor. To populate the editor use the getCronEditorBean()
method.
There are four modes that the editor supports:
If a cron string is not valid for the editor then the only available mode will be the advanced mode and the editor
state methods (e.g. getDayOfMonth()
, getHoursEntry()
) will return details of the default state
represented by DEFAULT_CRONSTRING
as they are not able to represent the advanced cron string.
The validation that this object performs is in the context of valid cron strings that will fit into the editor. This
object does not validate that the over all string is a valid cron string. This should be accomplished by validating
the string against a CronTrigger
.
Field Summary | |
---|---|
static String |
DEFAULT_CRONSTRING
Cron string that puts the editor into the default state. |
Constructor Summary | |
---|---|
CronExpressionParser()
Creates a parser in default state using DEFAULT_CRONSTRING . |
|
CronExpressionParser(String cronString)
Parses the given cronString to establish the state of this CronExpressionParser. |
Method Summary | |
---|---|
CronEditorBean |
getCronEditorBean()
Will provide the CronEditorBean which represents the state of the
form for the configured cron string. |
String |
getCronString()
Returns the cron string that the object was constructed with. |
String |
getDayOfMonth()
Gets the day of month field specified in the cron string. |
CronDayOfWeekEntry |
getDaysOfWeekEntry()
Gets the CronDayOfWeekEntry that represents the day of week cron field. |
CronHoursEntry |
getHoursEntry()
Gets the CronHoursEntry that represents the hours cron field. |
int |
getIncrementInMinutes()
Used to determine the total increment in minutes that are implied by the crons hour and minutes field. |
CronMinutesEntry |
getMinutesEntry()
Gets the CronMinutesEntry that represents the minutes cron field. |
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 string in the days of week field can be handled
by the editor. |
boolean |
isDayPerWeekMode()
Will return true if the editors day per week mode can handle the provided cron string. |
boolean |
isDaysPerMonthMode()
Will return true if the editors days per month mode can handle the provided cron string. |
boolean |
isValidForEditor()
Returns true only if the cron string can be handled by the cron editor UI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_CRONSTRING
Constructor Detail |
---|
public CronExpressionParser()
DEFAULT_CRONSTRING
.
public CronExpressionParser(String cronString)
cronString
- the cron string to parse.Method Detail |
---|
public CronEditorBean getCronEditorBean()
CronEditorBean
which represents the state of the
form for the configured cron string.
public String getCronString()
CronTrigger
.
public boolean isValidForEditor()
getCronString()
will throw an IllegalStateException
work properly.
public boolean isAdvancedMode()
public boolean isDailyMode()
public boolean isDayPerWeekMode()
public boolean isDaysPerMonthMode()
public boolean isDayOfWeekOfMonth()
isDaysPerMonthMode()
is true and the string in the days of week field can be handled
by the editor.
public String getDayOfMonth()
public CronMinutesEntry getMinutesEntry()
CronMinutesEntry
that represents the minutes cron field.
public CronHoursEntry getHoursEntry()
CronHoursEntry
that represents the hours cron field.
public CronDayOfWeekEntry getDaysOfWeekEntry()
CronDayOfWeekEntry
that represents the day of week cron field.
public int getIncrementInMinutes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |