本文整理汇总了Java中net.redhogs.cronparser.Options类的典型用法代码示例。如果您正苦于以下问题:Java Options类的具体用法?Java Options怎么用?Java Options使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Options类属于net.redhogs.cronparser包,在下文中一共展示了Options类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateCronExpression
import net.redhogs.cronparser.Options; //导入依赖的package包/类
@RequestMapping(value = "/validateCronExpression", method = RequestMethod.GET)
@ResponseStatus(value = HttpStatus.OK)
public Map<String,Object> validateCronExpression(@RequestParam String cronExpression) {
ImmutableMap.Builder<String,Object> mapBuilder = ImmutableMap.builder();
try {
TriggerUtils.validateCronExpression(cronExpression);
mapBuilder.put("response", "Cron expression is valid");
try {
Options options = new Options();
options.setZeroBasedDayOfWeek(false);
mapBuilder.put("description", CronExpressionDescriptor.getDescription(cronExpression, options));
} catch (ParseException IGNORED) {
mapBuilder.put("description", "No description available");
}
return mapBuilder.build();
} catch (IllegalArgumentException e) {
throw new InvalidCronExpressionException(
String.format("Cron expression '%s' is not valid: %s", cronExpression, e.getMessage())
);
}
}
示例2: YearDescriptionBuilder
import net.redhogs.cronparser.Options; //导入依赖的package包/类
public YearDescriptionBuilder(Options options) {
this.options = options;
}
示例3: DayOfWeekDescriptionBuilder
import net.redhogs.cronparser.Options; //导入依赖的package包/类
public DayOfWeekDescriptionBuilder(Options options) {
this.options = options;
}