|
From: <jue...@we...> - 2004-06-09 22:31:01
|
Actually, Spring does provide a default StringArrayPropertyEditor that =
separates CSV into multiple String values, being able to convert the =
individual values then. So you should be able to register an editor for =
Long, driving it with a CSV String.
=20
Registering for an array itself is straightforward:
=20
binder.registerCustomEditor(Boolean[].class, new PropertyEditorSupport() =
{
public void setAsText(String text) {
Boolean[] array =3D new Boolean[];
...
setValue(array);
}
});
Juergen
=20
________________________________
Von: spr...@li... im Auftrag =
von Rob Moore
Gesendet: Do 10.06.2004 00:05
An: spr...@li...
Betreff: [Springframework-developer] Re: PropertyEditor question
j=FCrgen h=F6ller [werk3AT] wrote:
> Sure, simply register a custom editor for your property (respectively =
the property type Long[]) that takes the CSV value as text and converts =
it into a Long[] value.
>=20
> Juergen
>=20
>
I must have misunderstood -- I had the impression this the framework
already provided a property editor to perform this conversion from a CSV
to a specified object type.
So how does one indicate the editor should apply to an array rather than
a single object? IOW, in initBinder for my controller I have the =
following:
binder.registerCustomEditor(Boolean.class, new =
CustomBooleanEditor(true));
How would I specify that I want my custom editor to be used for an array
of Booleans rather than just a single Boolean?
Thanks,
Rob
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|