/**日期和表达式的转化
* @param hour 小时
* @param minute 分钟
* @return
*/
private String makeDailyTrigger(String hour, String minute) {
validateHour(Integer.parseInt(hour));
validateMinute(Integer.parseInt(minute));
return "0 " + minute + " " + hour + " ? * *";
}
/**验证分钟
* @param minute
*/
private void validateMinute(int minute) {
if (minute < 0 || minute > 59)
throw new IllegalArgumentException(
"Invalid minute (must be >= 0 and <= 59).");
}
/**验证小时
* @param hour
*/
private void validateHour(int hour) {
if (hour < 0 || hour > 23)
throw new IllegalArgumentException(
"Invalid hour (must be >= 0 and <= 23).");
}
从源码中提出来的。。。。。。。。。