Following to my previous question, I subclssed CronExpression and changed getSet to be public. this method gets int type, and i have a String containing the cron expression. How do I get the info about this expression (hour\days\etc) ? what do I need to pass to getSet method? or maybe I should use another method? this is very unclear for me.
Following to my previous question , I subclssed CronExpression and changed getSet to be
Share
The problem with
CronExpressionis that even though it states it:The API is obscure and hidden under
protectedmethods. By far it is not a general-purpose CRON expression parser. However with a few tweaks you can easily take advantage of the parsing logic:Usage:
You might be tempted to parse CRON expression manually using regular expressions… Here is a regex from
job_scheduling_data_2_0.xsdQuartz schema:Or maybe someone knows a better general-purpose CRON expression parser for Java?