This file is indexed.

/usr/share/doc/libognl-java/LanguageGuide/basicSyntax.html is in libognl-java-doc 2.7.3-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

1
2
3
4
5
6
7
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter&nbsp;3.&nbsp;Syntax</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="index.html" title="OGNL Language Guide"><link rel="prev" href="history.html" title="Chapter&nbsp;2.&nbsp;History"><link rel="next" href="basicExpressions.html" title="Chapter&nbsp;4.&nbsp;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">Chapter&nbsp;3.&nbsp;Syntax</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="history.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</td><th align="center" width="60%">&nbsp;</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="basicExpressions.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="basicSyntax"></a>Chapter&nbsp;3.&nbsp;Syntax</h1></div></div></div><p>Simple <acronym class="acronym">OGNL</acronym> expressions are very simple. The language has become quite rich with features, but you don't generally need to worry about the more complicated parts of the language: the simple cases have remained
        that way. For example, to get at the name property of an object, the <acronym class="acronym">OGNL</acronym> expression is simply <span class="property">name</span>. To get at the <span class="property">text</span> property of the object returned by the headline property, the
        <acronym class="acronym">OGNL</acronym> expression is <span class="property">headline.text</span>.</p><p>What is a property? Roughly, an <acronym class="acronym">OGNL</acronym> property is the same as a bean property, which means that a pair of get/set methods, or alternatively a field, defines a property (the full story is a bit more complicated, since
        properties differ for different kinds of objects; see below for a full explanation).</p><p>The fundamental unit of an <acronym class="acronym">OGNL</acronym> expression is the navigation chain, usually just called "chain." The simplest chains consist of the following parts:</p><div class="table"><a name="N100A2"></a><p class="title"><b>Table&nbsp;3.1.&nbsp;<acronym class="acronym">OGNL</acronym> Expression Parts</b></p><div class="table-contents"><table summary="OGNL Expression Parts" border="1"><colgroup><col class="elementPart"><col class="example"></colgroup><thead><tr><th valign="top">Expression Element Part</th><th valign="top">Example</th></tr></thead><tbody><tr><td valign="top">Property names</td><td valign="top">like the <span class="property">name</span> and <span class="property">headline.text</span> examples above</td></tr><tr><td valign="top">Method Calls</td><td valign="top"><span class="property">hashCode()</span> to return the current object's hash code</td></tr><tr><td valign="top">Array Indices</td><td valign="top"><span class="property">listeners[0]</span> to return the first of the current object's list of listeners</td></tr></tbody></table></div></div><br class="table-break"><p>All <acronym class="acronym">OGNL</acronym> expressions are evaluated in the context of a current object, and a chain simply uses the result of the previous link in the chain as the current object for the next one. You can extend a chain as long as you
        like. For example, this chain:</p><pre class="programlisting">name.toCharArray()[0].numericValue.toString()</pre><p>This expression follows these steps to evaluate:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>extracts the <span class="property">name</span> property of the initial, or root, object (which the user provides to <acronym class="acronym">OGNL</acronym> through the <em class="glossterm"><acronym class="acronym">OGNL</acronym> context</em>)</p></li><li class="listitem"><p>calls the <span class="property">toCharArray()</span> method on the resulting <code class="classname">String</code></p></li><li class="listitem"><p>extracts the first character (the one at index 0) from the resulting array</p></li><li class="listitem"><p>gets the <span class="property">numericValue</span> property from that character (the character is represented as a <code class="classname">Character</code> object, and the <code class="classname">Character</code> class has a method called
                <span class="property">getNumericValue()</span>).</p></li><li class="listitem"><p>calls <span class="property">toString()</span> on the resulting <code class="classname">Integer</code> object. The final result of this expression is the <code class="classname">String</code> returned by the last <span class="property">toString()</span> call.</p></li></ul></div><p>Note that this example can only be used to get a value from an object, not to set a value. Passing the above expression to the <span class="property">Ognl.setValue()</span> method would cause an <code class="classname">InappropriateExpressionException</code>
        to be thrown, because the last link in the chain is neither a property name nor an array index.</p><p>This is enough syntax to do the vast majority of what you ever need to do.</p></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="history.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</td><td align="center" width="20%">&nbsp;</td><td align="right" width="40%">&nbsp;<a accesskey="n" href="basicExpressions.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Chapter&nbsp;2.&nbsp;History&nbsp;</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%">&nbsp;Chapter&nbsp;4.&nbsp;Expressions</td></tr></table></div></body></html>