|
From: Rob B. <cro...@ya...> - 2004-12-10 17:58:01
|
Hello all,
I developed a new property editor called
TokenizingEditor. It will convert Strings to a
String[] or to any implementation of Collection, and
back.
It is ideal for situations where you have a list of
items in a textarea separated by some token.
<textarea>
123
456
789
</textarea>
Can become String[] strArray = {"123", "456", "789"}
or can become List strList = new LinkedList();
strList.add("123");
strList.add("456");
strList.add("789");
by doing:
binder.registerCustomEditor(List.class, new
TokenizingEditor(" ", false, " ", LinkedList.class));
The implementation of TokenizingEditor, and a junit
test class are included. I took the liberty of
placing this in the Spring package structure already.
The file is a zip file, but ends in .zzz because yahoo
won't allow sending of anything ending with .zip for
some reason.
If this could get into the 1.1.3 release that would be
great!
Legaleze: I contribute this source which I have
written to the SpringFramework project for any
purpose.
Later
Rob
__________________________________
Do you Yahoo!?
Dress up your holiday email, Hollywood style. Learn more.
http://celebrity.mail.yahoo.com |