Package org.springframework.beans.propertyeditors

Examples of org.springframework.beans.propertyeditors.StringTrimmerEditor


   */
  protected void initBinder(HttpServletRequest request, ServletRequestDataBinder binder) {
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
  }
View Full Code Here


  private EventManager eventManager;

  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    binder.registerCustomEditor(Date.class, null, new CustomDateEditor(
        new SimpleDateFormat("MM/dd/yyyy"), false));
    binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class,
        true));
    binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(true));
View Full Code Here

  private CountryManager countryManager;

  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
  }
View Full Code Here

  private SimpleLocationManager locationManager;

  @Override
  protected void initBinder(HttpServletRequest request,
     ServletRequestDataBinder binder) throws Exception {
   binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
  }
View Full Code Here

  private EventManager eventManager;

  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class,
        true));
  }
View Full Code Here

  private CountryManager countryManager;

  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
  }
View Full Code Here

    bw = new BeanWrapperImpl(IndexedTestBean.class);
    bw.setPropertyValue("map[key0]", "my String");
    assertEquals(String.class, bw.getPropertyType("map[key0]"));

    bw = new BeanWrapperImpl(IndexedTestBean.class);
    bw.registerCustomEditor(String.class, "map[key0]", new StringTrimmerEditor(false));
    assertEquals(String.class, bw.getPropertyType("map[key0]"));
  }
View Full Code Here

    assertEquals(1024, tb.getArray().length);
    assertEquals(0, tb.getArray()[0]);
    long time1 = sw.getLastTaskTimeMillis();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    bw.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    sw.start("array2");
    for (int i = 0; i < 1000; i++) {
      bw.setPropertyValue("array", input);
    }
    sw.stop();
View Full Code Here

  }

  public void testCollectionsWithStringValuesAndCustomEditor() {
    IndexedTestBean tb = new IndexedTestBean();
    BeanWrapper bw = new BeanWrapperImpl(tb);
    bw.registerCustomEditor(String.class, "set", new StringTrimmerEditor(false));
    bw.registerCustomEditor(String.class, "list", new StringTrimmerEditor(false));

    bw.setPropertyValue("set", "set1 ");
    bw.setPropertyValue("sortedSet", "sortedSet1");
    bw.setPropertyValue("list", "list1 ");
    assertEquals(1, tb.getSet().size());
View Full Code Here

  private EventManager eventManager;

  @Override
  protected void initBinder(HttpServletRequest request,
      ServletRequestDataBinder binder) throws Exception {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    binder.registerCustomEditor(Date.class, null, new CustomDateEditor(
        new SimpleDateFormat("MM/dd/yyyy"), false));
    binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class,
        true));
    binder.registerCustomEditor(Integer.class,
View Full Code Here

TOP

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

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.