CronSequenceGenerator

来源:互联网 发布:json对象合并成一个 编辑:程序博客网 时间:2024/05/21 01:51

**Spring的CronSequenceGenerator

package org.springframework.scheduling.support;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.TimeZone;
import org.springframework.util.StringUtils;
/**
* 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/30 8-10 * * *” = 8:00, 8:30, 9:00, 9:30 and 10 o’clock 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
  • *

*
* @author Dave Syer
* @author Juergen Hoeller
* @since 3.0
* @see CronTrigger
*/
public class CronSequenceGenerator {**

0 0
原创粉丝点击