📄 evaluation.html
字号:
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 9. Other API features</title><link href="../docbook.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.65.0" name="generator"><link rel="home" href="index.html" title="OGNL Developer Guide"><link rel="up" href="index.html" title="OGNL Developer Guide"><link rel="previous" href="nullHandler.html" title="Chapter 8. Null Handler"></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 9. Other API features</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="nullHandler.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><th align="center" width="60%"> </th><td align="right" width="20%"> </td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="evaluation"></a>Chapter 9. Other API features</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="evaluation.html#N10176">Tracing Evaluations</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="N10176"></a>Tracing Evaluations</h2></div></div><div></div></div><p>As of OGNL 2.5.0 the <tt class="classname">OgnlContext</tt> object can automatically tracks evaluations of expressions. This tracking is kept in the <tt class="classname">OgnlContext</tt> as <span class="property">currentEvaluation</span> during the
evaluation. After execution you can access the last evaluation through the <span class="property">lastEvaluation</span> property of <tt class="classname">OgnlContext</tt>.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="../images/admon/note.gif"></td><th align="left">Note</th></tr><tr><td valign="top" align="left" colspan="2"><p>The tracing feature is turned off by default. If you wish to turn it on there is a <tt class="function">setTraceEvaluations()</tt> method on <tt class="classname">OgnlContext</tt> that you can call.</p></td></tr></table></div><p>Any <a href="methodAccessors.html" title="Chapter 3. Method Accessors">method accessor</a>, <a href="elementsAccessors.html" title="Chapter 4. Elements Accessors">elements accessor</a>, <a href="typeConversion.html" title="Chapter 6. Type Conversion">type converter</a>, <a href="propertyAccessors.html" title="Chapter 2. Property Accessors">property accessor</a>
or <a href="nullHandler.html" title="Chapter 8. Null Handler">null handler</a> may find this useful to give context to the operation being performed. The <tt class="classname">Evaluation</tt> object is itself a tree and can be traversed up, down and left and right
through siblings to determine the exact circumstances of an evaluation. In addition the <tt class="classname">Evaluation</tt> object tracks the node that was performing the operation, the source object on which that operation was being
performed and the result of the operation. If an exception is thrown during execution the user can get the last evaluation's last descendent to find out exactly which subexpression caused the error. The execption is also tracked in
the <tt class="classname">Evaluation</tt>.</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="nullHandler.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><td align="center" width="20%"><a accesskey="u" href="index.html"><img src="../images/navigation/up.gif" alt="Up"></a></td><td align="right" width="40%"> </td></tr><tr><td valign="top" align="left" width="40%">Chapter 8. Null Handler </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%"> </td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -