This file is indexed.

/usr/share/doc/libognl-java/LanguageGuide/indexing.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
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Indexing</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&nbsp;4.&nbsp;Expressions"><link rel="prev" href="properties.html" title="Referring to Properties"><link rel="next" href="methods.html" title="Calling Methods"></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">Indexing</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="properties.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</td><th align="center" width="60%">Chapter&nbsp;4.&nbsp;Expressions</th><td align="right" width="20%">&nbsp;<a accesskey="n" href="methods.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="indexing"></a>Indexing</h2></div></div></div><p>As discussed above, the "indexing" notation is actually just property reference, though a computed form of property reference rather than a constant one.</p><p>For example, <acronym class="acronym">OGNL</acronym> internally treats the "array.length" expression exactly the same as this expression:</p><pre class="programlisting">array["length"]</pre><p>And this expression would have the same result (though not the same internal form):</p><pre class="programlisting">array["len" + "gth"]</pre><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="N10184"></a>Array and List Indexing</h3></div></div></div><p>For Java arrays and Lists indexing is fairly simple, just like in Java. An integer index is given and that element is the referrent. If the index is out of bounds of the array or List and IndexOutOfBoundsException is thrown,
                just as in Java.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="N10189"></a>JavaBeans Indexed Properties</h3></div></div></div><p>JavaBeans supports the concept of Indexed properties. Specifically this means that an object has a set of methods that follow the following pattern:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>public <em class="replaceable"><code>PropertyType</code></em>[] get<em class="replaceable"><code>PropertyName</code></em>()</p></li><li class="listitem"><p>public void set<em class="replaceable"><code>PropertyName</code></em>(<em class="replaceable"><code>PropertyType</code></em>[] anArray)</p></li><li class="listitem"><p>public <em class="replaceable"><code>PropertyType</code></em> get<em class="replaceable"><code>PropertyName</code></em>(int index)</p></li><li class="listitem"><p>public void set<em class="replaceable"><code>PropertyName</code></em>(int index, <em class="replaceable"><code>PropertyType</code></em> value)</p></li></ul></div><p>OGNL can interpret this and provide seamless access to the property through the indexing notation. References such as</p><pre class="programlisting">someProperty[2]</pre><p>are automatically routed through the correct indexed property accessor (in the above case through <code class="function">getSomeProperty(2)</code> or <code class="function">setSomeProperty(2, value)</code>). If there is no indexed property
                accessor a property is found with the name <code class="varname">someProperty</code> and the index is applied to that.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="N101C5"></a>OGNL Object Indexed Properties</h3></div></div></div><p>OGNL extends the concept of indexed properties to include indexing with arbitrary objects, not just integers as with JavaBeans Indexed Properties. When finding properties as candidates for object indexing, OGNL looks for
                patterns of methods with the following signature:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>public <em class="replaceable"><code>PropertyType</code></em> get<em class="replaceable"><code>PropertyName</code></em>(<em class="replaceable"><code>IndexType</code></em> index)</p></li><li class="listitem"><p>public void set<em class="replaceable"><code>PropertyName</code></em>(<em class="replaceable"><code>IndexType</code></em> index, <em class="replaceable"><code>PropertyType</code></em> value)</p></li></ul></div><p>The <em class="replaceable"><code>PropertyType</code></em> and <em class="replaceable"><code>IndexType</code></em> must match each other in the corresponding set and get methods. An actual example of using Object Indexed Properties is with the Servlet API:
                the Session object has two methods for getting and setting arbitrary attributes:</p><pre class="programlisting">public Object getAttribute(String name) public void setAttribute(String name, Object value)</pre><p>An OGNL expression that can both get and set one of these attributes is</p><pre class="programlisting">session.attribute["foo"]</pre></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="properties.html"><img src="../images/navigation/prev.gif" alt="Prev"></a>&nbsp;</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%">&nbsp;<a accesskey="n" href="methods.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Referring to Properties&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;Calling Methods</td></tr></table></div></body></html>