/usr/share/doc/libognl-java/LanguageGuide/varref.html is in libognl-java-doc 2.7.3-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 | <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Variable References</title><link href="../docbook.css" type="text/css" rel="stylesheet"><meta content="DocBook XSL Stylesheets V1.78.1" name="generator"><link rel="home" href="index.html" title="OGNL Language Guide"><link rel="up" href="basicExpressions.html" title="Chapter 4. Expressions"><link rel="prev" href="methods.html" title="Calling Methods"><link rel="next" href="paren.html" title="Parenthetical Expressions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Variable References</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="methods.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><th align="center" width="60%">Chapter 4. Expressions</th><td align="right" width="20%"> <a accesskey="n" href="paren.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="varref"></a>Variable References</h2></div></div></div><p><acronym class="acronym">OGNL</acronym> has a simple variable scheme, which lets you store intermediate results and use them again, or just name things to make an expression easier to understand. All variables in <acronym class="acronym">OGNL</acronym> are global
to the entire expression. You refer to a variable using a number sign in front of its name, like this:</p><pre class="programlisting">#var</pre><p><acronym class="acronym">OGNL</acronym> also stores the current object at every point in the evaluation of an expression in the this variable, where it can be referred to like any other variable. For example, the following expression operates on
the number of listeners, returning twice the number if it is more than 100, or 20 more than the number otherwise:</p><pre class="programlisting">listeners.size().(#this > 100? 2*#this : 20+#this)</pre><p><acronym class="acronym">OGNL</acronym> can be invoked with a map that defines initial values for variables. The standard way of invoking <acronym class="acronym">OGNL</acronym> defines the variables <code class="varname">root</code> (which holds the initial, or root,
object), and <code class="varname">context</code> (which holds the <code class="classname">Map</code> of variables itself).</p><p>To assign a value to a variable explicitly, simply write an assignment statement with a variable reference on the left-hand side:</p><pre class="programlisting">#var = 99</pre></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="methods.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><td align="center" width="20%"><a accesskey="u" href="basicExpressions.html"><img src="../images/navigation/up.gif" alt="Up"></a></td><td align="right" width="40%"> <a accesskey="n" href="paren.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Calling Methods </td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="../images/navigation/home.gif" alt="Home"></a></td><td valign="top" align="right" width="40%"> Parenthetical Expressions</td></tr></table></div></body></html>
|