/usr/share/doc/libognl-java/DeveloperGuide/nullHandler.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 5 6 7 8 | <html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 8. Null Handler</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 Developer Guide"><link rel="up" href="index.html" title="OGNL Developer Guide"><link rel="prev" href="memberAccessManager.html" title="Chapter 7. Member Access"><link rel="next" href="evaluation.html" title="Chapter 9. Other API features"></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 8. Null Handler</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="memberAccessManager.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><th align="center" width="60%"> </th><td align="right" width="20%"> <a accesskey="n" href="evaluation.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="nullHandler"></a>Chapter 8. Null Handler</h1></div></div></div><p>When navigating a chain sometimes properties or methods will evaluate to null, causing subsequent properties or method calls to fail with <code class="classname">NullPointerException</code>s. Most of the time this behaviour is correct (as it is
with Java), but sometimes you want to be able to dynamically substitute another object in place of <code class="constant">null</code>. The <code class="classname">NullHandler</code> interface allows you to specify on a class-by-class basis how nulls are
handled within OGNL expressions. Implementing this interface allows you to intercept when methods return <code class="constant">null</code> and properties evaluate to <code class="constant">null</code> and allow you to substitute a new value. Since you are
given the source of the method or property a really clever implementor might write the property back to the object so that subsequent invocations do not return or evaluate to <code class="constant">null</code>.</p><pre class="programlisting">public interface NullHandler
{
public Object nullMethodResult(Map context, Object target, String methodName, List args);
public Object nullPropertyValue(Map context, Object target, Object property);
}</pre><p><code class="classname">NullHandler</code> implementors are registered with <acronym class="acronym">OGNL</acronym> using the <code class="function">OgnlRuntime.setNullHandler()</code> method.</p></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="memberAccessManager.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><td align="center" width="20%"> </td><td align="right" width="40%"> <a accesskey="n" href="evaluation.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Chapter 7. Member Access </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%"> Chapter 9. Other API features</td></tr></table></div></body></html>
|