Examples of StringArrayPropertyEditor


Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
    this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

    // Only register config value editors if explicitly requested.
    if (this.configValueEditorsActive) {
      StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
      this.defaultEditors.put(String[].class, sae);
      this.defaultEditors.put(short[].class, sae);
      this.defaultEditors.put(int[].class, sae);
      this.defaultEditors.put(long[].class, sae);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    MockPortletRequest request = new MockPortletRequest();
    request.addParameter("stringArray", "test1,test2");

    PortletRequestDataBinder binder = new PortletRequestDataBinder(bean);
    binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor());
    binder.bind(request);

    assertNotNull(bean.getStringArray());
    assertEquals(2, bean.getStringArray().length);
    assertEquals("test1", bean.getStringArray()[0]);
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

  }

  public void testWithPropertyEditor() throws Exception {
    BindStatus bindStatus = new BindStatus(getRequestContext(), "testBean.stringArray", false) {
      public PropertyEditor getEditor() {
        return new StringArrayPropertyEditor();
      }
    };
    getPageContext().setAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE, bindStatus);

    this.tag.setValue(ARRAY_SOURCE);
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
    this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

    // Only register config value editors if explicitly requested.
    if (this.configValueEditorsActive) {
      StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
      this.defaultEditors.put(String[].class, sae);
      this.defaultEditors.put(short[].class, sae);
      this.defaultEditors.put(int[].class, sae);
      this.defaultEditors.put(long[].class, sae);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

  @Test
  public void testStringArrayPropertyWithCustomStringDelimiter() throws Exception {
    PropsTester pt = new PropsTester();
    BeanWrapper bw = new BeanWrapperImpl(pt);
    bw.registerCustomEditor(String[].class, "stringArray", new StringArrayPropertyEditor("-"));
    bw.setPropertyValue("stringArray", "a1-b2");
    assertTrue("stringArray length = 2", pt.stringArray.length == 2);
    assertTrue("correct values", pt.stringArray[0].equals("a1") && pt.stringArray[1].equals("b2"));
  }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    MockPortletRequest request = new MockPortletRequest();
    request.addParameter("stringArray", "test1,test2");

    PortletRequestDataBinder binder = new PortletRequestDataBinder(bean);
    binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor());
    binder.bind(request);

    assertNotNull(bean.getStringArray());
    assertEquals(2, bean.getStringArray().length);
    assertEquals("test1", bean.getStringArray()[0]);
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

  public void testWithPropertyEditor() throws Exception {
    String selectName = "testBean.stringArray";
    BindStatus bindStatus = new BindStatus(getRequestContext(), selectName, false) {
      @Override
      public PropertyEditor getEditor() {
        return new StringArrayPropertyEditor();
      }
    };
    getPageContext().setAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE, bindStatus);

    this.tag.setValue(ARRAY_SOURCE);
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
    this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

    // Only register config value editors if explicitly requested.
    if (this.configValueEditorsActive) {
      StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
      this.defaultEditors.put(String[].class, sae);
      this.defaultEditors.put(short[].class, sae);
      this.defaultEditors.put(int[].class, sae);
      this.defaultEditors.put(long[].class, sae);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
    this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

    // Only register config value editors if explicitly requested.
    if (this.configValueEditorsActive) {
      StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
      this.defaultEditors.put(String[].class, sae);
      this.defaultEditors.put(short[].class, sae);
      this.defaultEditors.put(int[].class, sae);
      this.defaultEditors.put(long[].class, sae);
    }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.StringArrayPropertyEditor

    registry.registerCustomEditor(Pattern.class, new PatternPropertyEditor());
    registry.registerCustomEditor(DateFormat.class, new DateFormatPropertyEditor());
    registry.registerCustomEditor(ColumnWidths.class, new ColumnWidthsPropertyEditor());
    registry.registerCustomEditor(LocalDate.class, new LocalDatePropertyEditor());
    registry.registerCustomEditor(LocalTime.class, new LocalTimePropertyEditor());
    registry.registerCustomEditor(String[].class, new StringArrayPropertyEditor(","));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.