public class CronExpressionParser extends Object
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.
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CRONSTRING
Cron string that puts the editor into the default state.
|
Constructor and Description |
---|
CronExpressionParser()
Creates a parser in default state using
DEFAULT_CRONSTRING . |
CronExpressionParser(String cronString)
Parses the given cronString to establish the state of this CronExpressionParser.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final String DEFAULT_CRONSTRING
public CronExpressionParser()
DEFAULT_CRONSTRING
.public CronExpressionParser(String cronString)
cronString
- the cron string to parse.public CronEditorBean getCronEditorBean()
CronEditorBean
which represents the state of the
form for the configured cron string.public String getCronString()
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()
Copyright © 2002-2015 Atlassian. All Rights Reserved.