package com.gildata.qmp.dataverify.common.util;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.core.util.CronExpression;
import java.text.ParseException;
/**
* cron表达式工具类
*/
public class CronUtils {
private static final Integer SECOND = 0;
private static final Integer MINUTE = 1;
private static final Integer HOUR = 2;
private static final Integer DAY = 3;
private static final Integer MON = 4;
private static final Integer WEEK = 5;
private static final Integer YEAR = 6;
private static final String WILDCARD_1 = "*";
private static final String WILDCARD_2 = "-";
private static final String WILDCARD_3 = "/";
private static final String WILDCARD_4 = "?";
private static final String WILDCARD_5 = "W";
private static final String WILDCARD_6 = "L";
private static final String WILDCARD_7 = "、";
private static final Integer LENGTH = 6;
public static String translateToChinese(String cronExp) {
if (cronExp == null || cronExp.length() < 1) {
return "cron表达式为空";
}
CronExpression exp;
// 初始化cro
cron表达式中文翻译,支持复杂格式,6-7位
最新推荐文章于 2024-11-11 16:57:31 发布
本文详细解析了Java中cron表达式的用法,包括6-7位的复杂格式,帮助读者掌握调度任务的时间设定。
摘要由CSDN通过智能技术生成