Java 类org.springframework.beans.propertyeditors.StringTrimmerEditor 实例源码

项目:spring4-understanding    文件:CheckboxTagTests.java   
@Test
public void withSingleValueAndEditor() throws Exception {
    this.bean.setName("Rob Harrop");
    this.tag.setPath("name");
    this.tag.setValue("   Rob Harrop");
    BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
    bindingResult.getPropertyEditorRegistry().registerCustomEditor(String.class, new StringTrimmerEditor(false));
    getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + COMMAND_NAME, bindingResult);

    int result = this.tag.doStartTag();
    assertEquals(Tag.SKIP_BODY, result);

    String output = getOutput();

    // wrap the output so it is valid XML
    output = "<doc>" + output + "</doc>";

    SAXReader reader = new SAXReader();
    Document document = reader.read(new StringReader(output));
    Element checkboxElement = (Element) document.getRootElement().elements().get(0);
    assertEquals("input", checkboxElement.getName());
    assertEquals("checkbox", checkboxElement.attribute("type").getValue());
    assertEquals("name", checkboxElement.attribute("name").getValue());
    assertEquals("checked", checkboxElement.attribute("checked").getValue());
    assertEquals("   Rob Harrop", checkboxElement.attribute("value").getValue());
}
项目:spring4-understanding    文件:AbstractPropertyAccessorTests.java   
@Test
public void setCollectionPropertyWithStringValueAndCustomEditor() {
    IndexedTestBean target = new IndexedTestBean();
    AbstractPropertyAccessor accessor = createAccessor(target);
    accessor.registerCustomEditor(String.class, "set", new StringTrimmerEditor(false));
    accessor.registerCustomEditor(String.class, "list", new StringTrimmerEditor(false));

    accessor.setPropertyValue("set", "set1 ");
    accessor.setPropertyValue("sortedSet", "sortedSet1");
    accessor.setPropertyValue("list", "list1 ");
    assertEquals(1, target.getSet().size());
    assertTrue(target.getSet().contains("set1"));
    assertEquals(1, target.getSortedSet().size());
    assertTrue(target.getSortedSet().contains("sortedSet1"));
    assertEquals(1, target.getList().size());
    assertTrue(target.getList().contains("list1"));

    accessor.setPropertyValue("list", Collections.singletonList("list1 "));
    assertTrue(target.getList().contains("list1"));
}
项目:class-guard    文件:CheckboxTagTests.java   
public void testWithSingleValueAndEditor() throws Exception {
    this.bean.setName("Rob Harrop");
    this.tag.setPath("name");
    this.tag.setValue("   Rob Harrop");
    BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
    bindingResult.getPropertyEditorRegistry().registerCustomEditor(String.class, new StringTrimmerEditor(false));
    getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + COMMAND_NAME, bindingResult);

    int result = this.tag.doStartTag();
    assertEquals(Tag.SKIP_BODY, result);

    String output = getOutput();

    // wrap the output so it is valid XML
    output = "<doc>" + output + "</doc>";

    SAXReader reader = new SAXReader();
    Document document = reader.read(new StringReader(output));
    Element checkboxElement = (Element) document.getRootElement().elements().get(0);
    assertEquals("input", checkboxElement.getName());
    assertEquals("checkbox", checkboxElement.attribute("type").getValue());
    assertEquals("name", checkboxElement.attribute("name").getValue());
    assertEquals("checked", checkboxElement.attribute("checked").getValue());
    assertEquals("   Rob Harrop", checkboxElement.attribute("value").getValue());
}
项目:class-guard    文件:BeanWrapperTests.java   
@Test
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());
    assertTrue(tb.getSet().contains("set1"));
    assertEquals(1, tb.getSortedSet().size());
    assertTrue(tb.getSortedSet().contains("sortedSet1"));
    assertEquals(1, tb.getList().size());
    assertTrue(tb.getList().contains("list1"));

    bw.setPropertyValue("list", Arrays.asList(new String[] {"list1 "}));
    assertTrue(tb.getList().contains("list1"));
}
项目:cas4.0.x-server-wechat    文件:RegisteredServiceSimpleFormController.java   
/**
 * {@inheritDoc}
 * Sets the require fields and the disallowed fields from the
 * HttpServletRequest.
 *
 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest,
 * org.springframework.web.bind.ServletRequestDataBinder)
 */
@Override
protected void initBinder(final HttpServletRequest request,
        final ServletRequestDataBinder binder) throws Exception {
    binder.setRequiredFields(new String[] {"description", "serviceId",
            "name", "allowedToProxy", "enabled", "ssoEnabled",
            "anonymousAccess", "evaluationOrder"});
    binder.setDisallowedFields(new String[] {"id"});
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:helium    文件:ExpedientTipusController.java   
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
项目:helium    文件:TascaLlistatV3Controller.java   
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
    binder.registerCustomEditor(
            Object.class,
            new ObjectTypeEditorHelper());
}
项目:helium    文件:ExpedientLlistatController.java   
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    dateFormat.setLenient(false);
    binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
}
项目:oma-riista-web    文件:CommonControllerAdvice.java   
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));

    Object target = binder.getTarget();
    if (target != null) {
        binder.replaceValidators(supportedValidatorsFor(target.getClass()));
    }
}
项目:spring4-understanding    文件:DataBinderTests.java   
@Test
public void testConversionWithInappropriateStringEditor() {
    DataBinder dataBinder = new DataBinder(null);
    DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
    dataBinder.setConversionService(conversionService);
    dataBinder.registerCustomEditor(String.class, new StringTrimmerEditor(true));

    NameBean bean = new NameBean("Fred");
    assertEquals("ConversionService should have invoked toString()", "Fred", dataBinder.convertIfNecessary(bean, String.class));
    conversionService.addConverter(new NameBeanConverter());
    assertEquals("Type converter should have been used", "[Fred]", dataBinder.convertIfNecessary(bean, String.class));
}
项目:spring4-understanding    文件:BeanWrapperGenericsTests.java   
@Test
public void testGenericListOfArraysWithElementConversion() throws MalformedURLException {
    GenericBean<String> gb = new GenericBean<String>();
    ArrayList<String[]> list = new ArrayList<String[]>();
    list.add(new String[] {"str1", "str2"});
    gb.setListOfArrays(list);
    BeanWrapper bw = new BeanWrapperImpl(gb);
    bw.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    bw.setPropertyValue("listOfArrays[0][1]", "str3 ");
    assertEquals("str3", bw.getPropertyValue("listOfArrays[0][1]"));
    assertEquals("str3", gb.getListOfArrays().get(0)[1]);
}
项目:spring4-understanding    文件:AbstractPropertyAccessorTests.java   
@Test
public void propertyTypeIndexedProperty() {
    IndexedTestBean target = new IndexedTestBean();
    AbstractPropertyAccessor accessor = createAccessor(target);
    assertEquals(null, accessor.getPropertyType("map[key0]"));

    accessor = createAccessor(target);
    accessor.setPropertyValue("map[key0]", "my String");
    assertEquals(String.class, accessor.getPropertyType("map[key0]"));

    accessor = createAccessor(target);
    accessor.registerCustomEditor(String.class, "map[key0]", new StringTrimmerEditor(false));
    assertEquals(String.class, accessor.getPropertyType("map[key0]"));
}
项目:aramcomp    文件:BindingInitializer.java   
public void initBinder(WebDataBinder binder, WebRequest request) {

        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));
    }
项目:springlets    文件:StringTrimmerAdvice.java   
/**
 * Registers the {@link StringTrimmerEditor}
 *
 * @param webDataBinder
 */
@InitBinder
public void initBinder(WebDataBinder webDataBinder) {
  StringTrimmerEditor trimmer =
      new StringTrimmerEditor(this.getCharsToDelete(), this.isEmptyAsNull());
  webDataBinder.registerCustomEditor(String.class, trimmer);
}
项目:cacheonix-core    文件:ClinicBindingInitializer.java   
public void initBinder(WebDataBinder binder, WebRequest request) {
    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));
    binder.registerCustomEditor(PetType.class, new PetTypeEditor(this.clinic));
}
项目:cas-4.0.1    文件:RegisteredServiceSimpleFormController.java   
/**
 * {@inheritDoc}
 * Sets the require fields and the disallowed fields from the
 * HttpServletRequest.
 *
 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest,
 * org.springframework.web.bind.ServletRequestDataBinder)
 */
@Override
protected void initBinder(final HttpServletRequest request,
        final ServletRequestDataBinder binder) throws Exception {
    binder.setRequiredFields(new String[] {"description", "serviceId",
            "name", "allowedToProxy", "enabled", "ssoEnabled",
            "anonymousAccess", "evaluationOrder"});
    binder.setDisallowedFields(new String[] {"id"});
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:p00    文件:RegisteredServiceSimpleFormController.java   
/**
 * {@inheritDoc}
 * Sets the require fields and the disallowed fields from the
 * HttpServletRequest.
 *
 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest,
 * org.springframework.web.bind.ServletRequestDataBinder)
 */
@Override
protected void initBinder(final HttpServletRequest request,
        final ServletRequestDataBinder binder) throws Exception {
    binder.setRequiredFields(new String[] {"description", "serviceId",
            "name", "allowedToProxy", "enabled", "ssoEnabled",
            "anonymousAccess", "evaluationOrder"});
    binder.setDisallowedFields(new String[] {"id"});
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:cas-server-4.0.1    文件:RegisteredServiceSimpleFormController.java   
/**
 * {@inheritDoc}
 * Sets the require fields and the disallowed fields from the
 * HttpServletRequest.
 *
 * @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder(javax.servlet.http.HttpServletRequest,
 * org.springframework.web.bind.ServletRequestDataBinder)
 */
@Override
protected void initBinder(final HttpServletRequest request,
        final ServletRequestDataBinder binder) throws Exception {
    binder.setRequiredFields(new String[] {"description", "serviceId",
            "name", "allowedToProxy", "enabled", "ssoEnabled",
            "anonymousAccess", "evaluationOrder"});
    binder.setDisallowedFields(new String[] {"id"});
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:podcastpedia-web    文件:StartPageController.java   
@InitBinder
public void initBinder(WebDataBinder binder) {

    binder.registerCustomEditor(MediaType.class, new MediaTypeEditor(
            MediaType.class));
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));/* Converts empty strings into null when a form is submitted */
}
项目:podcastpedia-web    文件:SearchController.java   
@InitBinder
public void initBinder(WebDataBinder binder) {

    binder.registerCustomEditor(MediaType.class, new MediaTypeEditor(
            MediaType.class));
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));/* Converts empty strings into null when a form is submitted */        
}
项目:class-guard    文件:BeanWrapperGenericsTests.java   
@Test
public void testGenericListOfArraysWithElementConversion() throws MalformedURLException {
    GenericBean<String> gb = new GenericBean<String>();
    ArrayList<String[]> list = new ArrayList<String[]>();
    list.add(new String[] {"str1", "str2"});
    gb.setListOfArrays(list);
    BeanWrapper bw = new BeanWrapperImpl(gb);
    bw.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    bw.setPropertyValue("listOfArrays[0][1]", "str3 ");
    assertEquals("str3", bw.getPropertyValue("listOfArrays[0][1]"));
    assertEquals("str3", gb.getListOfArrays().get(0)[1]);
}
项目:class-guard    文件:BeanWrapperTests.java   
@Test
public void testTypeDeterminationForIndexedProperty() {
    BeanWrapper bw = new BeanWrapperImpl(IndexedTestBean.class);
    assertEquals(null, bw.getPropertyType("map[key0]"));

    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]"));
}
项目:ABRAID-MP    文件:AbstractControllerTest.java   
@Test
public void initBinderShouldRegisterStringTrimmer() {
    // Arrange
    AbstractController target = new AbstractController() { };
    WebDataBinder binder = mock(WebDataBinder.class);

    // Act
    target.initBinder(binder);

    // Assert
    verify(binder).registerCustomEditor(eq(String.class), any(StringTrimmerEditor.class));
}
项目:kuali_rice    文件:UifConfigurableWebBindingInitializer.java   
@Override
public void initBinder(WebDataBinder binder, WebRequest request) {
    super.initBinder(binder, request);

    binder.registerCustomEditor(KualiDecimal.class, new UifCurrencyEditor());
    binder.registerCustomEditor(KualiInteger.class, new UifKualiIntegerCurrencyEditor());

    binder.registerCustomEditor(KualiPercent.class, new UifPercentageEditor());

    binder.registerCustomEditor(java.sql.Date.class, new UifDateEditor());
    binder.registerCustomEditor(java.util.Date.class, new UifDateEditor());
    binder.registerCustomEditor(Timestamp.class, new UifTimestampEditor());

    // TODO do we need this since we are switching to spring tags
    binder.registerCustomEditor(boolean.class, new UifBooleanEditor());
    binder.registerCustomEditor(Boolean.class, new UifBooleanEditor());
    binder.registerCustomEditor(Boolean.TYPE, new UifBooleanEditor());

    // Use the spring custom number editor for Big decimals
    DecimalFormat bigIntFormatter = new DecimalFormat();
    bigIntFormatter.setMaximumFractionDigits(340);
    binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, bigIntFormatter, true));
    binder.registerCustomEditor(AbstractKualiDecimal.class, new CustomNumberEditor(AbstractKualiDecimal.class,
            bigIntFormatter, true));

    // Use the spring StringTrimmerEditor editor for Strings
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));

    // Use the StringArrayPropertyEditor for string arrays with "," as the
    // separator
    binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor(",", false));

    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
}
项目:cpagenie    文件:CampaignController.java   
@InitBinder
public void initBinder(WebDataBinder dataBinder) {
    dataBinder.setDisallowedFields(ID_KEY);
    dataBinder.setRequiredFields(NAME_KEY, START_DATE_KEY, END_DATE_KEY, EMAIL_KEY, COST_PER_LEAD_KEY, TOTAL_BUDGET_KEY, STATUS_KEY, RESPONSE_TYPE_KEY, SUCCESS_RESPONSE_KEY, FAILURE_RESPONSE_KEY, ADVERTISER_KEY);
    dataBinder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    dataBinder.registerCustomEditor(Date.class, new CustomDateEditor(DATE_FORMAT, false));
    dataBinder.registerCustomEditor(CampaignStatus.class, statusEditor);
    dataBinder.registerCustomEditor(CampaignResponseType.class, responseTypeEditor);
    dataBinder.registerCustomEditor(CampaignSupportedField.class, supportedFieldEditor);
    dataBinder.registerCustomEditor(CampaignFieldType.class, fieldTypeEditor);
    dataBinder.registerCustomEditor(CampaignFieldValidationType.class, validationTypeEditor);
    dataBinder.registerCustomEditor(Advertiser.class, advertiserEditor);
}
项目:setra    文件:GlobalControllerAdvice.java   
@InitBinder
public void initBinder(final WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:setra    文件:SendController.java   
private DataBinder initBinder() {
    final DataBinder binder = new DataBinder(new EncryptMessageCommand(), "command");
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    binder.setValidator(validator);
    return binder;
}
项目:AntiSocial-Platform    文件:UserController.java   
@InitBinder
public void initBinder(WebDataBinder dataBinder){
    StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
    dataBinder.registerCustomEditor(String.class, stringTrimmerEditor);
}
项目:AntiSocial-Platform    文件:LoginController.java   
@InitBinder
public void initBinder(WebDataBinder dataBinder){
    StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
    dataBinder.registerCustomEditor(String.class, stringTrimmerEditor);
}
项目:AntiSocial-Platform    文件:UserController.java   
@InitBinder
public void initBinder(WebDataBinder dataBinder){
    StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
    dataBinder.registerCustomEditor(String.class, stringTrimmerEditor);
}
项目:AntiSocial-Platform    文件:LoginController.java   
@InitBinder
public void initBinder(WebDataBinder dataBinder){
    StringTrimmerEditor stringTrimmerEditor = new StringTrimmerEditor(true);
    dataBinder.registerCustomEditor(String.class, stringTrimmerEditor);
}
项目:springboot-training    文件:BaseController.java   
@InitBinder
protected void initBinder(WebDataBinder webDataBinder) {
    webDataBinder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
    webDataBinder.registerCustomEditor(Date.class, new DateEditor(true));
}
项目:spring4-understanding    文件:MethodInvokingFactoryBeanTests.java   
@Test
public void testGetObjectType() throws Exception {
    TestClass1 tc1 = new TestClass1();
    MethodInvokingFactoryBean mcfb = new MethodInvokingFactoryBean();
    mcfb = new MethodInvokingFactoryBean();
    mcfb.setTargetObject(tc1);
    mcfb.setTargetMethod("method1");
    mcfb.afterPropertiesSet();
    assertTrue(int.class.equals(mcfb.getObjectType()));

    mcfb = new MethodInvokingFactoryBean();
    mcfb.setTargetClass(TestClass1.class);
    mcfb.setTargetMethod("voidRetvalMethod");
    mcfb.afterPropertiesSet();
    Class<?> objType = mcfb.getObjectType();
    assertTrue(objType.equals(void.class));

    // verify that we can call a method with args that are subtypes of the
    // target method arg types
    TestClass1._staticField1 = 0;
    mcfb = new MethodInvokingFactoryBean();
    mcfb.setTargetClass(TestClass1.class);
    mcfb.setTargetMethod("supertypes");
    mcfb.setArguments(new Object[] {new ArrayList<Object>(), new ArrayList<Object>(), "hello"});
    mcfb.afterPropertiesSet();
    mcfb.getObjectType();

    // fail on improper argument types at afterPropertiesSet
    mcfb = new MethodInvokingFactoryBean();
    mcfb.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    mcfb.setTargetClass(TestClass1.class);
    mcfb.setTargetMethod("supertypes");
    mcfb.setArguments(new Object[] {"1", new Object()});
    try {
        mcfb.afterPropertiesSet();
        fail("Should have thrown NoSuchMethodException");
    }
    catch (NoSuchMethodException ex) {
        // expected
    }
}
项目:spring4-understanding    文件:AbstractPropertyAccessorTests.java   
@Test
public void setPrimitiveArrayPropertyLargeMatching() {
    Assume.group(TestGroup.PERFORMANCE);
    Assume.notLogging(LogFactory.getLog(AbstractPropertyAccessorTests.class));

    PrimitiveArrayBean target = new PrimitiveArrayBean();
    AbstractPropertyAccessor accessor = createAccessor(target);
    int[] input = new int[1024];
    StopWatch sw = new StopWatch();
    sw.start("array1");
    for (int i = 0; i < 1000; i++) {
        accessor.setPropertyValue("array", input);
    }
    sw.stop();
    assertEquals(1024, target.getArray().length);
    assertEquals(0, target.getArray()[0]);
    long time1 = sw.getLastTaskTimeMillis();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    accessor.registerCustomEditor(String.class, new StringTrimmerEditor(false));
    sw.start("array2");
    for (int i = 0; i < 1000; i++) {
        accessor.setPropertyValue("array", input);
    }
    sw.stop();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 125);

    accessor.registerCustomEditor(int.class, "array.somePath", new CustomNumberEditor(Integer.class, false));
    sw.start("array3");
    for (int i = 0; i < 1000; i++) {
        accessor.setPropertyValue("array", input);
    }
    sw.stop();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    accessor.registerCustomEditor(int.class, "array[0].somePath", new CustomNumberEditor(Integer.class, false));
    sw.start("array3");
    for (int i = 0; i < 1000; i++) {
        accessor.setPropertyValue("array", input);
    }
    sw.stop();
    assertTrue("Took too long", sw.getLastTaskTimeMillis() < 100);

    accessor.registerCustomEditor(int.class, new CustomNumberEditor(Integer.class, false));
    sw.start("array4");
    for (int i = 0; i < 100; i++) {
        accessor.setPropertyValue("array", input);
    }
    sw.stop();
    assertEquals(1024, target.getArray().length);
    assertEquals(0, target.getArray()[0]);
    assertTrue("Took too long", sw.getLastTaskTimeMillis() > time1);
}
项目:simbest-cores    文件:SysOperateInfoController.java   
@InitBinder
private void initBinder(ServletRequestDataBinder binder){
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:simbest-cores    文件:SysLoginInfoController.java   
@InitBinder
private void initBinder(ServletRequestDataBinder binder) {
    // bind empty strings as null
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:easier_rank_platform    文件:CustomerController.java   
@InitBinder
public void initBinder(WebDataBinder binder) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
}
项目:ResBill    文件:InvoiceListController.java   
@InitBinder
public void initBinder(WebDataBinder binder, Locale locale) {
  binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
  binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("MM/yyyy"), true));
}
项目:ResBill    文件:ContractEditController.java   
@InitBinder
public void initBinder(WebDataBinder binder, Locale locale) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
项目:ResBill    文件:ContractInvoiceTypeEditController.java   
@InitBinder
public void initBinder(WebDataBinder binder, Locale locale) {
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}