tags:

views:

50

answers:

1

I need to build a cron expression based on user input from a form. So I have a datepicker and a select box to choose the frequency. I can build a cron expression from this easily enough, but it feels like I am reinventing the wheel. Is there a suitable class to do this for me? Something with a method like

public String cron(String frequency, Calendar nextRunTime);
A: 

I think the Cron-functionality in quartz could provide this for you, but you do have to do some programming to make it work. (http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html)

This is if I understand your question correctly.

Kurt Du Bois
Yes, I am trying to create a cron expression, but I just wondered if there was a java class which did this for me based on a date. So CronExpression has this method:void buildExpression(String expression);What I would like is a wrapper or helper with something likevoid buildExpression(String frequency, Calendar nextRunTime);It would appear this doesn't exist unfortunately, so I'll have to write my own. Just seemed like a fairly common task to me.
Mark Chorley
So why did you accept the answer?
Adriaan Koster
Just tidying up - the answer basically says "There isn't a class which does this out of the box".
Mark Chorley