Examples of CustomCollectionEditor


Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm");
        sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
        binder.registerCustomEditor(Date.class, new CustomDateEditor(sdf, true));
        binder.registerCustomEditor(SystemNotificationType.class, new EnumEditor(SystemNotificationType.class));
        binder.registerCustomEditor(SystemNotificationSeverity.class, new EnumEditor(SystemNotificationSeverity.class));
        binder.registerCustomEditor(List.class, "types", new CustomCollectionEditor(List.class) {
            @Override
            protected Object convertElement(Object element) {
                SystemNotificationType type = null;
                if (element != null) {
                    try {
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

      this.defaultEditors.put(zoneIdClass, new ZoneIdEditor());
    }

    // Default instances of collection editors.
    // Can be overridden by registering custom instances of those as custom editors.
    this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
    this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
    this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
    this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
    this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

    // Default editors for primitive arrays.
    this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
    this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

  }

  public void testBindingStringArrayToIntegerSet() {
    IndexedTestBean tb = new IndexedTestBean();
    DataBinder binder = new DataBinder(tb, "tb");
    binder.registerCustomEditor(Set.class, new CustomCollectionEditor(TreeSet.class) {
      @Override
      protected Object convertElement(Object element) {
        return new Integer(element.toString());
      }
    });
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

  }

  public void testBindingNullToEmptyCollection() {
    IndexedTestBean tb = new IndexedTestBean();
    DataBinder binder = new DataBinder(tb, "tb");
    binder.registerCustomEditor(Set.class, new CustomCollectionEditor(TreeSet.class, true));
    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.add("set", null);
    binder.bind(pvs);

    assertTrue(tb.getSet() instanceof TreeSet);
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

    list.add(Country.COUNTRY_UK);
    list.add(Country.COUNTRY_AT);
    this.bean.setSomeList(list);

    BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
    errors.getPropertyAccessor().registerCustomEditor(List.class, new CustomCollectionEditor(LinkedList.class) {
      @Override
      public String getAsText() {
        return getValue().toString();
      }
    });
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

    this.defaultEditors.put(URL.class, new URLEditor());
    this.defaultEditors.put(UUID.class, new UUIDEditor());

    // Default instances of collection editors.
    // Can be overridden by registering custom instances of those as custom editors.
    this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
    this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
    this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
    this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
    this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

    // Default editors for primitive arrays.
    this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
    this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

    this.defaultEditors.put(URL.class, new URLEditor());
    this.defaultEditors.put(UUID.class, new UUIDEditor());

    // Default instances of collection editors.
    // Can be overridden by registering custom instances of those as custom editors.
    this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
    this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
    this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
    this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
    this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

    // Default editors for primitive arrays.
    this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
    this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

    editors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, false));
    editors.put(Float.class, new CustomNumberEditor(Float.class, false));
    editors.put(Double.class, new CustomNumberEditor(Double.class, false));
    editors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, false));

    editors.put(Collection.class, new CustomCollectionEditor(Collection.class));
    editors.put(Set.class, new CustomCollectionEditor(Set.class));
    editors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
    editors.put(List.class, new CustomCollectionEditor(List.class));

    this.registerCustomEditors(editors);

  }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

    editors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, false));
    editors.put(Float.class, new CustomNumberEditor(Float.class, false));
    editors.put(Double.class, new CustomNumberEditor(Double.class, false));
    editors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, false));

    editors.put(Collection.class, new CustomCollectionEditor(Collection.class));
    editors.put(Set.class, new CustomCollectionEditor(Set.class));
    editors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
    editors.put(List.class, new CustomCollectionEditor(List.class));

    this.registerCustomEditors(editors);

  }
View Full Code Here

Examples of org.springframework.beans.propertyeditors.CustomCollectionEditor

   * @param aRegistry a property editor registry
   */
  public static void registerUimaFITEditors(PropertyEditorRegistry aRegistry) {
    aRegistry.registerCustomEditor(Locale.class, new LocaleEditor());
    aRegistry.registerCustomEditor(String.class, new GetAsTextStringEditor(aRegistry));
    aRegistry.registerCustomEditor(LinkedList.class, new CustomCollectionEditor(LinkedList.class));
  }
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.