public class CronScheduleParser extends Object
EnvironmentConfig.VERIFY_SCHEDULE which
is a cron-style expression.
The cron-style expression can be very complicate, for example containing *, ?, / and so on. But now we only handle the simplest situation. We will continually add the code to handle more complicated situations if needed in the future.
Constraint for current version:
| Modifier and Type | Field and Description |
|---|---|
static String |
cons1 |
static String |
cons2 |
static String |
cons3 |
static String |
cons4 |
static String |
cons5 |
static String |
cons6 |
static String |
cons7 |
static String |
nullCons |
static TestHook<Calendar> |
setCurCalHook
A test hook called to allow tests to supply a calendar.
|
| Constructor and Description |
|---|
CronScheduleParser(String cronSchedule)
Creates an instance that uses the default calendar.
|
CronScheduleParser(String cronSchedule,
Calendar calendar)
Creates an instance that uses the specified calendar.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkSame(String cronvSchedule1,
String cronSchedule2)
Check whether two cron-style strings are same, i.e.
|
long |
getDelayTime() |
long |
getInterval()
Returns the number of milliseconds between times that match the crontab
entry.
|
long |
getTime()
Returns the time used when computing the delay time.
|
public static final String nullCons
public static final String cons1
public static final String cons2
public static final String cons3
public static final String cons4
public static final String cons5
public static final String cons6
public static final String cons7
public CronScheduleParser(String cronSchedule)
cronSchedule - the cron-style stringIllegalArgumentException - if there is a problem with the format
of the parameterpublic CronScheduleParser(String cronSchedule, Calendar calendar)
cronSchedule - the cron-style stringcalendar - the calendarIllegalArgumentException - if there is a problem with the format
of the cronSchedule parameterpublic static boolean checkSame(String cronvSchedule1, String cronSchedule2)
cronvSchedule1 - The first cron-style string.cronSchedule2 - The second cron-style string.public long getTime()
public long getDelayTime()
public long getInterval()
Copyright © 2024. All rights reserved.