Class CronSequenceGenerator
java.lang.Object
org.springframework.scheduling.support.CronSequenceGenerator
Deprecated, for removal: This API element is subject to removal in a future version.
Date sequence generator for a
Crontab pattern,
allowing clients to specify a pattern that the sequence matches.
The pattern is a list of six single space-separated fields: representing second, minute, hour, day, month, weekday. Month and weekday names can be given as the first three letters of the English names.
Example patterns:
- "0 0 * * * *" = the top of every hour of every day.
- "*/10 * * * * *" = every ten seconds.
- "0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.
- "0 0 6,19 * * *" = 6:00 AM and 7:00 PM every day.
- "0 0/30 8-10 * * *" = 8:00, 8:30, 9:00, 9:30, 10:00 and 10:30 every day.
- "0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays
- "0 0 0 25 12 ?" = every Christmas Day at midnight
- Since:
- 3.0
- Author:
- Dave Syer, Juergen Hoeller, Ruslan Sibgatullin
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCronSequenceGenerator(String expression) Deprecated, for removal: This API element is subject to removal in a future version.as of 5.3, in favor ofCronExpression.parse(String)CronSequenceGenerator(String expression, TimeZone timeZone) Deprecated.as of 5.3, in favor ofCronExpression.parse(String) -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated, for removal: This API element is subject to removal in a future version.inthashCode()Deprecated, for removal: This API element is subject to removal in a future version.static booleanisValidExpression(String expression) Deprecated, for removal: This API element is subject to removal in a future version.Determine whether the specified expression represents a valid cron pattern.Deprecated, for removal: This API element is subject to removal in a future version.Get the nextDatein the sequence matching the Cron pattern and after the value provided.toString()Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
CronSequenceGenerator
Deprecated, for removal: This API element is subject to removal in a future version.as of 5.3, in favor ofCronExpression.parse(String)Construct aCronSequenceGeneratorfrom the pattern provided, using the defaultTimeZone.- Parameters:
expression- a space-separated list of time fields- Throws:
IllegalArgumentException- if the pattern cannot be parsed- See Also:
-
CronSequenceGenerator
Deprecated.as of 5.3, in favor ofCronExpression.parse(String)Construct aCronSequenceGeneratorfrom the pattern provided, using the specifiedTimeZone.- Parameters:
expression- a space-separated list of time fieldstimeZone- the TimeZone to use for generated trigger times- Throws:
IllegalArgumentException- if the pattern cannot be parsed
-
-
Method Details
-
next
Deprecated, for removal: This API element is subject to removal in a future version.Get the nextDatein the sequence matching the Cron pattern and after the value provided. The return value will have a whole number of seconds, and will be after the input value.- Parameters:
date- a seed value- Returns:
- the next value matching the pattern
-
isValidExpression
Deprecated, for removal: This API element is subject to removal in a future version.Determine whether the specified expression represents a valid cron pattern.- Parameters:
expression- the expression to evaluate- Returns:
trueif the given expression is a valid cron expression- Since:
- 4.3
-
equals
Deprecated, for removal: This API element is subject to removal in a future version. -
hashCode
public int hashCode()Deprecated, for removal: This API element is subject to removal in a future version. -
toString
Deprecated, for removal: This API element is subject to removal in a future version.
-
CronExpression