📄 methods.html
字号:
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Calling Methods</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 Language Guide"><link rel="up" href="basicExpressions.html" title="Chapter 4. Expressions"><link rel="previous" href="indexing.html" title="Indexing"><link rel="next" href="varref.html" title="Variable References"></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">Calling Methods</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="indexing.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><th align="center" width="60%">Chapter 4. Expressions</th><td align="right" width="20%"> <a accesskey="n" href="varref.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="methods"></a>Calling Methods</h2></div></div><div></div></div><p><span class="acronym">OGNL</span> calls methods a little differently from the way Java does, because <span class="acronym">OGNL</span> is interpreted and must choose the right method at run time, with no extra type information aside from the actual
arguments supplied. <span class="acronym">OGNL</span> always chooses the most specific method it can find whose types match the supplied arguments; if there are two or more methods that are equally specific and match the given arguments, one of
them will be chosen arbitrarily.</p><p>In particular, a null argument matches all non-primitive types, and so is most likely to result in an unexpected method being called.</p><p>Note that the arguments to a method are separated by commas, and so the comma operator cannot be used unless it is enclosed in parentheses. For example,</p><pre class="programlisting">method( ensureLoaded(), name )</pre><p>is a call to a 2-argument method, while</p><pre class="programlisting">method( (ensureLoaded(), name) )</pre><p>is a call to a 1-argument method.</p></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="indexing.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </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%"> <a accesskey="n" href="varref.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Indexing </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%"> Variable References</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -