From 3cac9267e9c8bea82ea11ffbf4870c6db317c25c Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Thu, 9 Apr 2009 05:44:35 +0000 Subject: [PATCH] Commented out the sections on list projection and #this. --- .../src/expressions.xml | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/spring-framework-reference/src/expressions.xml b/spring-framework-reference/src/expressions.xml index 270b126d60f..4a21a794038 100644 --- a/spring-framework-reference/src/expressions.xml +++ b/spring-framework-reference/src/expressions.xml @@ -94,11 +94,11 @@ User defined functions - + Templated expressions @@ -157,8 +157,8 @@ String message = (String) exp.getValue(); Expression exp = parser.parseExpression("'Hello World'.bytes"); // invokes 'getBytes()' byte[] bytes = (byte[]) exp.getValue(); - Upper or lowercase can be used to specify the property name. SpEL - also supports nested properties using standard 'dot' notation, i.e. + + SpEL also supports nested properties using standard 'dot' notation, i.e. prop1.prop2.prop3 and the setting of property values Public fields may also be accessed @@ -217,7 +217,7 @@ String name = (String) exp.getValue(context);In the last shown using the Inventor object in the previous example Expression exp = parser.parseExpression("name == 'Nikola Tesla'"); -boolean isEqual = exp.getValue(context, Boolean.class); // evaluates to true +boolean result = exp.getValue(context, Boolean.class); // evaluates to true
The EvaluationContext interface @@ -420,9 +420,9 @@ Object nullValue = parser.parseExpression("null").getValue();
- Properties, Arrays, Lists, Dictionaries, Indexers + Properties, Arrays, Lists, Maps, Indexers - Navigating through properties is easy, just use a period to + Navigating with property references is easy, just use a period to indicate a nested property value. The instances of Inventor class, pupin and tesla, were populated with data listed in section Section Classes used in the @@ -460,9 +460,9 @@ String name = parser.parseExpression("Members[0].Name").getValue(societyContext, String invention = parser.parseExpression("Members[0].Inventions[6]").getValue(societyContext, String.class); - The contents of dictionaries are obtained by specifying the + The contents of maps are obtained by specifying the literal key value within the brackets. In this case, because keys for - the Officers dictionary are strings, we can specify string + the Officers map are strings, we can specify string literal. // Officer's Dictionary @@ -669,6 +669,7 @@ parser.parseExpression("Name = #newName").getValue(context); System.out.println(tesla.getName()) // "Mike Tesla" +
@@ -749,6 +751,7 @@ String queryResultString = parser.parseExpression(expression).getValue(societyCo // queryResultString = "Nikola Tesla is a member of the IEEE Society"
+
Expression templating