View Javadoc

1   /*
2    * $Id: TrimChecker.java,v 1.1 2007/11/29 12:58:13 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.validator.ICheckerTask;
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: 2007/11/29 12:58:13 $
15   */
16  public class TrimChecker extends AbstractClientValidatorTask implements
17          ICheckerTask {
18      private static final String REVISION = "$Revision: 1.1 $";
19  
20      private static final Log LOG = LogFactory.getLog(TrimChecker.class);
21  
22      public String applyChecker(IClientValidatorContext context, String value) {
23          if (value == null || value.length() == 0) {
24              return value;
25          }
26  
27          return value.trim();
28      }
29  }