本文整理匯總了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;
}