You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by wg...@apache.org on 2005/10/03 08:36:30 UTC
svn commit: r293265 - in /jakarta/velocity/core/trunk/xdocs/docs:
user-guide.xml vtl-reference-guide.xml
Author: wglass
Date: Sun Oct 2 23:36:28 2005
New Revision: 293265
URL: http://svn.apache.org/viewcvs?rev=293265&view=rev
Log:
updated docs for == operator describing toString() equality. VELOCITY-350.
Modified:
jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml
jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml
Modified: jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml?rev=293265&r1=293264&r2=293265&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/user-guide.xml Sun Oct 2 23:36:28 2005
@@ -1162,7 +1162,9 @@
<p>Note that the semantics of <em>==</em> are slightly different than Java where <em>==</em>
can only be used to test object equality. In Velocity the equivalent operator
- can be used to directly compare numbers, strings, or objects.
+ can be used to directly compare numbers, strings, or objects. When the objects
+ are of different classes, the string representations are obtained by calling
+ <code>toString()</code> for each object and then compared.
</p>
<p>
Modified: jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml?rev=293265&r1=293264&r2=293265&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/docs/vtl-reference-guide.xml Sun Oct 2 23:36:28 2005
@@ -248,14 +248,23 @@
</tr>
</table>
- <P>Note: You can also use brackets to delimit directives. This is especially
- useful when text immediately follows an <code>#else</code> directive.
- </P>
-
+ <p>Notes:</p>
+ <ol>
+ <li>
+ The == operator can be used to compare numbers, strings, objects of the same class, or objects
+ of different classes. In the last case (when objects are of different classes), the toString()
+ method is called on each object and the resulting Strings are compared.
+ </li>
+ <li>
+ You can also use brackets to delimit directives. This is especially
+ useful when text immediately follows an <code>#else</code> directive.
+ </li>
+ </ol>
+
<source><![CDATA[
#if( $foo == $bar)it's true!#{else}it's not!#end</li>
]]></source>
-
+
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org