Package org.springframework.beans.propertyeditors

Examples of org.springframework.beans.propertyeditors.CustomDateEditor


    @InitBinder
  public void initBinder(WebDataBinder binder) {
      binder.registerCustomEditor(EncounterType.class, new EncounterTypeEditor());
        binder.registerCustomEditor(java.util.Date.class,
                new CustomDateEditor(SimpleDateFormat.getDateInstance(SimpleDateFormat.SHORT, Context.getLocale()), true));
  }
View Full Code Here


   */
  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(Date.class, "lastCacheUpdate",
        new CustomDateEditor(new SimpleDateFormat("MMM dd, yyyy hh:mm:ss"), true));
  }
View Full Code Here

        binder.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, true));
        binder.registerCustomEditor(Double.class, new CustomNumberEditor(Double.class, true));
        binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
        binder.registerCustomEditor(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));
       
        binder.registerCustomEditor(java.util.Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true));
       
    }
View Full Code Here

  }
 
  /** binder用于bean属性的设置 */
  @InitBinder 
  public void initBinder(WebDataBinder binder) { 
          binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"), true))
  }
View Full Code Here

    this.interfaceTemplate = interfaceTemplate;
  }

  @InitBinder
  public void initBinder(WebDataBinder binder) {
    CustomDateEditor cde = new CustomDateEditor(new SimpleDateFormat("dd/MM/yyyy"), true);
    binder.registerCustomEditor(Date.class, cde);
  }
View Full Code Here

  @InitBinder
  public void initBinder(WebDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
  }
View Full Code Here

    final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMAN);
    cec.setPropertyEditorRegistrars(new PropertyEditorRegistrar[] {
        new PropertyEditorRegistrar() {
          @Override
          public void registerCustomEditors(PropertyEditorRegistry registry) {
            registry.registerCustomEditor(Date.class, new CustomDateEditor(df, true));
          }
        }});
    cec.postProcessBeanFactory(bf);

    MutablePropertyValues pvs = new MutablePropertyValues();
View Full Code Here

    MockPortletRequest request = new MockPortletRequest();
    request.addParameter("date", "06-03-2006");

    PortletRequestDataBinder binder = new PortletRequestDataBinder(bean);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    binder.bind(request);

    assertEquals(expected, bean.getDate());
  }
View Full Code Here

    DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
    new XmlBeanDefinitionReader(factory).loadBeanDefinitions(CONTEXT);
    factory.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
      @Override
      public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Date.class, new CustomDateEditor((DateFormat) DATE_FORMAT.clone(), false));
      }
    });
    this.factory = factory;
  }
View Full Code Here

*/
public class CustomDateEditorRegistrar implements PropertyEditorRegistrar {

  @Override
  public void registerCustomEditors(PropertyEditorRegistry registry) {
    registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy/MM/dd"), true));
  }
View Full Code Here

TOP

Related Classes of org.springframework.beans.propertyeditors.CustomDateEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.