View Javadoc

1   /*
2    * $Id: HourFilter.java,v 1.1 2008/06/06 14:39:21 oeuillot Exp $
3    */
4   package org.rcfaces.core.internal.validator.impl;
5   
6   import org.apache.commons.logging.Log;
7   import org.apache.commons.logging.LogFactory;
8   import org.rcfaces.core.internal.lang.StringAppender;
9   import org.rcfaces.core.validator.IClientValidatorContext;
10  
11  /**
12   * 
13   * @author Olivier Oeuillot (latest modification by $Author: oeuillot $)
14   * @version $Revision: 1.1 $ $Date: 2008/06/06 14:39:21 $
15   */
16  public class HourFilter extends AbstractDynamicPatternTask {
17      private static final String REVISION = "$Revision: 1.1 $";
18  
19      private static final Log LOG = LogFactory.getLog(HourFilter.class);
20  
21      protected String getRegularExpression(IClientValidatorContext context) {
22  
23          StringAppender exp = new StringAppender("[0-9", 16);
24  
25          String sup = getParameter(context, "hour.sepSign");
26          if (sup != null && sup.length() > 0) {
27              exp.append(buildEscaped(sup));
28          }
29  
30          exp.append(']');
31  
32          return exp.toString();
33      }
34  }