[Springnet-commits] Spring.Net/doc/reference/src objects.xml, 1.120, 1.121
Brought to you by:
aseovic,
markpollack
From: Mark P. <mar...@us...> - 2008-04-03 01:14:33
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv816 Modified Files: objects.xml Log Message: SPRNET-865 - Add Documention for the expression attribute. Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** objects.xml 2 Apr 2008 18:02:11 -0000 1.120 --- objects.xml 3 Apr 2008 01:14:26 -0000 1.121 *************** *** 1736,1740 **** can also again be any of the elements:</emphasis> ! <programlisting>(object | ref | idref | list | set | dictionary | name-values | value | null)</programlisting> </para> --- 1736,1740 ---- can also again be any of the elements:</emphasis> ! <programlisting>(object | ref | idref | expression | list | set | dictionary | name-values | value | null)</programlisting> </para> *************** *** 2012,2026 **** <sect3 id="objects-referencing-compound-properties"> ! <title>Compound property names</title> </sect3> <para>Note that compound or nested property names are perfectly legal ! when setting object properties, as long as all components of the path ! except the final property name are non-null. For example, in this object ! definition:</para> <programlisting><object id="foo" type="Spring.Foo, Spring.Foo"> <property name="bar.baz.name" value="Bingo"/> </object></programlisting> </sect2> --- 2012,2044 ---- <sect3 id="objects-referencing-compound-properties"> ! <title>Compound property names and Spring expression ! references</title> </sect3> <para>Note that compound or nested property names are perfectly legal ! when setting object properties. Property names are interpreted using the ! <link linkend="expressions">Spring Expression Language</link> (SpEL) and ! therefore can leverage its many features to set property names. For ! example, in this object definition a simple nested property name is ! configured</para> <programlisting><object id="foo" type="Spring.Foo, Spring.Foo"> <property name="bar.baz.name" value="Bingo"/> </object></programlisting> + + <para>As an example of some alternative ways to declare the property + name, you can use SpEL's support for indexers to configure a Dictionary + key value pair as an alternative to the nested + <literal><dictionary></literal> element. More importantly, you can + use the 'expression' element to refer to a Spring expression as the + value of the property. Simple examples of this are shown below</para> + + <programlisting><property name=âminValueâ expression=âint.MinValueâ /> + + <property name=âweekFromTodayâ expression="DateTime.Today + 7"/></programlisting> + + <para>Using SpEL's support for method evaluation, you can easily call + static method on various helper classes in your XML + configuraiton.</para> </sect2> |