/** * Indicates whether the specified cron expression can be parsed into a * valid cron expression * * @param cronExpression the expression to evaluate * @return a boolean indicating whether the given expression is a valid cron * expression */ public static boolean isValidExpression(String cronExpression) { try { new CronExpression(cronExpression); } catch (ParseException pe) { return false; } return true; }
public static CronExpression determineCronExpression(String cronExpression) { try { return new CronExpression( cronExpression ); } catch ( Exception e ) { throw new RuntimeException( "Unable to parse cron expression '" + cronExpression + "'", e ); } }
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { this.startTime = (Date) in.readObject(); this.endTime = (Date) in.readObject(); this.repeatLimit = in.readInt(); String string = (String) in.readObject(); try { this.cronExpression = new CronExpression( string ); } catch ( ParseException e ) { throw new RuntimeException( "Unable to marshal CronExpression '" + string + "'", e ); } }
if ( "cron".equals( protocol ) ) { try { timer = new CronTimer( startDate, endDate, repeatLimit, new CronExpression( body ) ); } catch ( ParseException e ) { DroolsError err = new RuleBuildError( rule, context.getParentDescr(), null,
public Object clone() { CronExpression copy = null; try { copy = new CronExpression(getCronExpression()); if(getTimeZone() != null) copy.setTimeZone((TimeZone) getTimeZone().clone()); } catch (ParseException ex) { // never happens since the source is valid... throw new IncompatibleClassChangeError("Not Cloneable."); } return copy; } }