|
From: Jean-Philippe G. <ga...@ya...> - 2005-02-21 15:47:37
|
I choose the { and } characters for the lists and [ ] for the maps.
So instead of...
<bean id="myBean" class="example.MyClass">
<property name="someList">
<list>
<value>item value</value>
<ref bean="beanReference"/>
</list>
</property>
<property name="someMap">
<map>
<entry key="key1">
<value>value1</value>
</entry>
<entry key="key2">
<value>value2</value>
</entry>
</map>
</property>
</bean>
...I have...
<myBean class="example.MyClass">
<someList>{item value, @beanReference}</someList>
<someMap>[key1=value1, key2=value2]</someMap>
</myBean>
Note that I've allowed bean references to be keys. Hence, the following is
legal:
<myBean class="example.MyClass">
<someList>{item value, @beanReference}</someList>
<someMap>[@beanReference=value1, key2=value2]</someMap>
</myBean>
Of course, when a meta-character (@ , [ ] { } =) is part of the key or value,
an escape character is required:
<myBean class="example.MyClass">
<emailAddresses>{user1\@domain1.com, user2\@domain2.com}</emailAddresses>
</myBean>
Jean-Philippe
--- Cameron Braid <ca...@br...> wrote:
> > -----Original Message-----
> > From: spr...@li...
> > [mailto:spr...@li...] On Behalf
> > Of Jean-Philippe Gariepy
> > Sent: Monday, 21 February 2005 12:29 PM
> > To: spr...@li...
> > Subject: Re: [Springframework-developer] Custom bean instantiation
> > language?
> >
> > (This is an opportunity for me to share my thoughts about the bean
> > factory.)
>
> --SNIP--
>
> > I've added other lightweight syntaxes for lists and maps.
> >
>
> Can you please share them too. I like the look of this :)
>
>
> Thanks,
>
> Cameron
>
=====
---------------------------------------
Jean-Philippe Gariépy (ga...@ya...)
"Quand l'appétit va, tout va."
-Obélix
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
|