public class CronExpressionValidator extends Object
Modifier and Type | Method and Description |
---|---|
static List<Date> |
getFutureSchedules(String cronExpressionValue,
int limit)
Finds the next execution occurences of a cron expression from now.
|
static List<Date> |
getFutureSchedules(String cronExpressionValue,
int limit,
Date fromDate)
Finds the next execution occurences of a cron expression from now.
|
static boolean |
isValid(String cronExpressionValue)
Determines if the cron expression is valid according to Quartz.
|
public static List<Date> getFutureSchedules(String cronExpressionValue, int limit) throws ParseException
cronExpressionValue
- the expression to evaluationlimit
- the maximum number of dates to returnParseException
- if the cron expression is invalidpublic static List<Date> getFutureSchedules(String cronExpressionValue, int limit, Date fromDate) throws ParseException
cronExpressionValue
- the expression to evaluationlimit
- the maximum number of dates to returnfromDate
- the date to start from, or now if nullParseException
- if the cron expression is invalidpublic static boolean isValid(String cronExpressionValue)
The Quartz CronExpression seems a bit buggy - it seems to ignore last character in string when validating.
However, since ultimate the expression is consumed by Quartz, it will accept it anyway.
cronExpressionValue
- the expression to validateCopyright © 2003–2021 Atlassian. All rights reserved.