This file is indexed.

/usr/share/doc/libognl-java/LanguageGuide/selection.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>Selecting From Collections</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="projection.html" title="Projecting Across Collections"><link rel="next" href="constructors.html" title="Calling Constructors"></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">Selecting From Collections</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="projection.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="constructors.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="selection"></a>Selecting From Collections</h2></div></div></div><p><acronym class="acronym">OGNL</acronym> provides a simple way to use an expression to choose some elements from a collection and save the results in a new collection. We call this "selection," from the database term for choosing a subset of
            rows from a table. For example, this expression:</p><pre class="programlisting">listeners.{? #this instanceof ActionListener}</pre><p>returns a list of all those listeners that are instances of the <code class="classname">ActionListener</code> class. See the <a class="ulink" href="???" target="_self">coercion section</a> for how <acronym class="acronym">OGNL</acronym> treats
            various kinds of objects as collections.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="N10300"></a>Selecting First Match</h3></div></div></div><p>In order to get the first match from a list of matches, you could use indexing such as <code class="literal">listeners.{? true }[0]</code>. However, this is cumbersome because if the match does not return any results (or if the result
                list is empty) you will get an <code class="classname">ArrayIndexOutOfBoundsException</code>.</p><p>The selection syntax is also available to select only the first match and return it as a list. If the match does not succeed for any elements an empty list is the result.</p><pre class="programlisting">objects.{^ #this instanceof String }</pre><p>Will return the first element contained in objects that is an instance of the <code class="classname">String</code> class.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="N10316"></a>Selecting Last Match</h3></div></div></div><p>Similar to getting the first match, sometimes you want to get the last element that matched.</p><pre class="programlisting">objects.{$ #this instanceof String }</pre><p>This will return the last element contained in objects that is an instanceof the <code class="classname">String</code> class</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="projection.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="constructors.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Projecting Across Collections&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 Constructors</td></tr></table></div></body></html>