title: Validate a javax.ejb.ScheduleExpression
body: <p>I have a text field where users can enter a cron expression (e.g., <code>0 */5 * * * *</code>). I then split it and build a <code>javax.ejb.ScheduleExpression</code>.</p>
  
  <p>Now <code>javax.ejb.ScheduleExpression</code> accepts any String for the different elements without validation. I can for example </p>
  
  <pre><code>scheduleExpression.minute("randomText");
  </code></pre>
  
  <p>and is accepted. If then try to use the ScheduleExpression I obviously get errors (e.g., when I try to create a timer with it).</p>
  
  <p>I was beginning to write code to validate the input but the rules are not so short and trivial: <a href="http://docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html">http://docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html</a></p>
  
  <p>Is there a simple way (in Java EE) or a library that does already does the job?</p>