spelhelper/apidocs/net/abhinavsarkar/spelhelper/SpelHelper.html

619 lines
38 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Thu May 27 01:34:44 IST 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
SpelHelper (SpelHelper 1.0 API)
</TITLE>
<META NAME="date" CONTENT="2010-05-27">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../spring-javadoc.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SpelHelper (SpelHelper 1.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../net/abhinavsarkar/spelhelper/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SpelHelper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html" title="class in net.abhinavsarkar.spelhelper"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/abhinavsarkar/spelhelper/SpelHelper.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SpelHelper.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.abhinavsarkar.spelhelper</FONT>
<BR>
Class SpelHelper</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>net.abhinavsarkar.spelhelper.SpelHelper</B>
</PRE>
<HR>
<DL>
<DT><PRE>public final class <B>SpelHelper</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
<p>SpelHelper provides additional functionalities to work with
<a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html">Spring Expression Language (SpEL)</a>.</p>
<p>The addition functionalities provided are:</p>
<ol>
<li>Implicit methods</li>
<li>Implicit properties</li>
<li>Simplified extension functions</li>
<li>Simplified constructors</li>
</ol>
<p><strong>Implicit Methods</strong></p>
<p>Implicit methods allow one to registers methods with SpelHelper and attach
them to particular classes. After that, when that method is called on an
object of that particular class inside a SpEL expression, SpelHelper
redirects the method call to the registered method.</p>
<p>Example: <a href="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html#sorted(java.util.List)"><code>ImplicitMethods.sorted(List)</code> </a>method is automatically
registered by SpelHelper. The class that the method should be invoked for
is the type of the first parameter of the method. In this case, the class is
<a href="http://java.sun.com/javase/6/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util"><code>List</code> </a>.</p>
<p>So when an expression like <code>"#list(1,4,2).sorted()"</code> is evaluated, the
<a href="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html#sorted(java.util.List)"><code>ImplicitMethods.sorted(List)</code> </a>method is invoked with the list as its
first parameter and its return value is used in further evaluation of the
expression.</p>
<p>See <a href="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerImplicitMethodsFromClass(java.lang.Class)"><code>registerImplicitMethodsFromClass(Class)</code> </a>.</p>
<p><strong>Implicit Properties</strong></p>
<p>Implicit properties allow one to treat no argument methods of an object
as properties of the object. SpelHelper intercepts the property resolution
of SpEL and if the property name is same as some no-arg method of the target
object then it invokes the method on the object and provides its return value
as the property value for further evaluation of the expression.</p>
<p>Example: Using implicit properties, the example of implicit methods can be
written as: <code>"#list(1,4,2).sorted"</code> - dropping the parens - and it will return
the same value as the last example.</p>
<p>Implicit property resolution considers both the actual methods of the object
and the implicit methods registered on the object's class.</p>
<p><strong>Simplified extension functions</strong></p>
<p>SpEL <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html#expressions-ref-functions">allows</a> to register extension function on the context by providing a
name and a <a href="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect"><code>Method</code> </a>object. SpelHelper simplifies this by taking a class
and registering all the <code>public static</code> methods of the class which do not
have a <code>void</code> return type. The methods are registered by their simple name.</p>
<p>Example: All the methods of <a href="../../../net/abhinavsarkar/spelhelper/ExtensionFunctions.html" title="class in net.abhinavsarkar.spelhelper"><code>ExtensionFunctions</code> </a>class are automatically
registered by SpelHelper. Hence the method <a href="../../../net/abhinavsarkar/spelhelper/ExtensionFunctions.html#list(T...)"><code>ExtensionFunctions.list(Object...)</code> </a>
can be called from inside a SpEL expression using the function call syntax:
<code>"#list(1,2,3)</code>".</p>
<p>See <a href="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerFunctionsFromClass(java.lang.Class)"><code>registerFunctionsFromClass(Class)</code> </a>.</p>
<p><strong>Simplified constructors</strong></p>
<p>SpEL <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/expressions.html#d0e11927">allows</a> calling constructors from inside a SpEL expression using the
<code>new</code> operator. But they have to be called with their full name like:
<code>"new org.example.Foo('bar')"</code>. SpelHelper simplifies this by taking a class
and registering all its public constructors to the SpEL context by their
simple name.</p>
<p>Example: After registering the <code>org.example.Foo</code> class with SpelHelper, its
constructor can be called from inside a SpEL expression by: <code>"new Foo('bar')"</code>.</p>
<p>See <a href="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerConstructorsFromClass(java.lang.Class)"><code>registerConstructorsFromClass(Class)</code> </a>.</p>
<p>In addition to all the above functionalities, SpelHelper automatically registers
some extension functions and implicit methods which are always available in
the SpEL expressions evaluated through SpelHelper. See <a href="../../../net/abhinavsarkar/spelhelper/ExtensionFunctions.html" title="class in net.abhinavsarkar.spelhelper"><code>ExtensionFunctions</code> </a>
and <a href="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html" title="class in net.abhinavsarkar.spelhelper"><code>ImplicitMethods</code> </a>for further details.</p>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Abhinav Sarkar <em>abhinav@abhinavsarkar.net</em></DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#SpelHelper()">SpelHelper</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an instance of SpelHelper.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, org.springframework.expression.EvaluationContext, java.lang.Class)">evalExpression</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;expressionString,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A>&nbsp;evaluationContext,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluates a SpEL expression <code>expressionString</code> in the provided
context <code>evaluationContext</code> and gives back a result of type
<code>desiredType</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, java.lang.Object, java.lang.Class)">evalExpression</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;expressionString,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;rootElement,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluates a SpEL expression <code>expressionString</code> in the context
of root element <code>rootElement</code> and gives back a result of type
<code>desiredType</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpressions(java.lang.String[], org.springframework.expression.EvaluationContext, java.lang.Class)">evalExpressions</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]&nbsp;expressionStrings,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A>&nbsp;evaluationContext,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluates multiple SpEL expressions and returns the result of the last
expression.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY="">
<TR ALIGN="right" VALIGN="">
<TD NOWRAP><FONT SIZE="-1">
<CODE>&lt;T&gt; T</CODE></FONT></TD>
</TR>
</TABLE>
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpressions(java.lang.String[], java.lang.Object, java.lang.Class)">evalExpressions</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]&nbsp;expressionStrings,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;rootElement,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Evaluates multiple SpEL expressions and returns the result of the last
expression.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#getCurrentContext()">getCurrentContext</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current evaluation context.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</A>&lt;?&gt;</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#lookupImplicitConstructor(java.lang.String)">lookupImplicitConstructor</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;lookup)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Looks up an implicit constructor registered with this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#lookupImplicitMethod(java.lang.String)">lookupImplicitMethod</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;lookup)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Looks up an implicit method registered with this instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerConstructorsFromClass(java.lang.Class)">registerConstructorsFromClass</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Registers the public constructors of the class <code>clazz</code> so that they
can be called by their simple name from SpEL expressions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerFunctionsFromClass(java.lang.Class)">registerFunctionsFromClass</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Registers the public static methods in the class <code>clazz</code> as functions
which can be called from SpEL expressions.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#registerImplicitMethodsFromClass(java.lang.Class)">registerImplicitMethodsFromClass</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Registers the public static methods in the class <code>clazz</code> as implicit
methods for the class of the first parameter of the methods.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SpelHelper()"><!-- --></A><H3>
SpelHelper</H3>
<PRE>
public <B>SpelHelper</B>()</PRE>
<DL>
<DD>Creates an instance of SpelHelper.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="registerImplicitMethodsFromClass(java.lang.Class)"><!-- --></A><H3>
registerImplicitMethodsFromClass</H3>
<PRE>
public <A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A> <B>registerImplicitMethodsFromClass</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</PRE>
<DL>
<DD><p>Registers the public static methods in the class <code>clazz</code> as implicit
methods for the class of the first parameter of the methods.</p>
<p>Only registers the public static methods with non void return type and at
least one argument.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>clazz</CODE> - The class to register the methods from.
<DT><B>Returns:</B><DD>The current instance of SpelHelper. This is for chaining
the methods calls.<DT><B>See Also:</B><DD><A HREF="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html" title="class in net.abhinavsarkar.spelhelper"><CODE>ImplicitMethods</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="registerFunctionsFromClass(java.lang.Class)"><!-- --></A><H3>
registerFunctionsFromClass</H3>
<PRE>
public <A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A> <B>registerFunctionsFromClass</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</PRE>
<DL>
<DD><p>Registers the public static methods in the class <code>clazz</code> as functions
which can be called from SpEL expressions.
The functions are registered with the simple name of the methods.</p>
<p>Only registers the public static methods with non void return type.</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>clazz</CODE> - The class to register the functions from.
<DT><B>Returns:</B><DD>The current instance of SpelHelper. This is for chaining
the methods calls.<DT><B>See Also:</B><DD><A HREF="../../../net/abhinavsarkar/spelhelper/ExtensionFunctions.html" title="class in net.abhinavsarkar.spelhelper"><CODE>ExtensionFunctions</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="registerConstructorsFromClass(java.lang.Class)"><!-- --></A><H3>
registerConstructorsFromClass</H3>
<PRE>
public <A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html" title="class in net.abhinavsarkar.spelhelper">SpelHelper</A> <B>registerConstructorsFromClass</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;?&gt;&nbsp;clazz)</PRE>
<DL>
<DD>Registers the public constructors of the class <code>clazz</code> so that they
can be called by their simple name from SpEL expressions.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>clazz</CODE> - The class to register the constructors from.
<DT><B>Returns:</B><DD>The current instance of SpelHelper. This is for chaining
the methods calls.</DL>
</DD>
</DL>
<HR>
<A NAME="evalExpression(java.lang.String, java.lang.Object, java.lang.Class)"><!-- --></A><H3>
evalExpression</H3>
<PRE>
public &lt;T&gt; T <B>evalExpression</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;expressionString,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;rootElement,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</PRE>
<DL>
<DD>Evaluates a SpEL expression <code>expressionString</code> in the context
of root element <code>rootElement</code> and gives back a result of type
<code>desiredType</code>.
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of the result desired.<DT><B>Parameters:</B><DD><CODE>expressionString</CODE> - The SpEL expression to evaluate.<DD><CODE>rootElement</CODE> - The root element in context of which the expression
is to be evaluated.<DD><CODE>desiredType</CODE> - The class of the result desired.
<DT><B>Returns:</B><DD>The result of the evaluation of the expression.<DT><B>See Also:</B><DD><A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/ExpressionParser.html?is-external=true#parseExpression(java.lang.String)" title="class or interface in org.springframework.expression"><CODE>ExpressionParser.parseExpression(String)</CODE></A>,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/Expression.html?is-external=true#getValue(org.springframework.expression.EvaluationContext, java.lang.Class)" title="class or interface in org.springframework.expression"><CODE>Expression.getValue(EvaluationContext, Class)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="evalExpression(java.lang.String, org.springframework.expression.EvaluationContext, java.lang.Class)"><!-- --></A><H3>
evalExpression</H3>
<PRE>
public &lt;T&gt; T <B>evalExpression</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;expressionString,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A>&nbsp;evaluationContext,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</PRE>
<DL>
<DD>Evaluates a SpEL expression <code>expressionString</code> in the provided
context <code>evaluationContext</code> and gives back a result of type
<code>desiredType</code>.
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of the result desired.<DT><B>Parameters:</B><DD><CODE>expressionString</CODE> - The SpEL expression to evaluate.<DD><CODE>evaluationContext</CODE> - The context in which the expression is to be evaluated.<DD><CODE>desiredType</CODE> - The class of the result desired.
<DT><B>Returns:</B><DD>The result of the evaluation of the expression.<DT><B>See Also:</B><DD><A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/ExpressionParser.html?is-external=true#parseExpression(java.lang.String)" title="class or interface in org.springframework.expression"><CODE>ExpressionParser.parseExpression(String)</CODE></A>,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/Expression.html?is-external=true#getValue(org.springframework.expression.EvaluationContext, java.lang.Class)" title="class or interface in org.springframework.expression"><CODE>Expression.getValue(EvaluationContext, Class)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="evalExpressions(java.lang.String[], java.lang.Object, java.lang.Class)"><!-- --></A><H3>
evalExpressions</H3>
<PRE>
public &lt;T&gt; T <B>evalExpressions</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]&nbsp;expressionStrings,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;rootElement,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</PRE>
<DL>
<DD>Evaluates multiple SpEL expressions and returns the result of the last
expression.
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of the result desired.<DT><B>Parameters:</B><DD><CODE>expressionStrings</CODE> - The SpEL expressions to evaluate.<DD><CODE>rootElement</CODE> - The root element in context of which the expressions
are to be evaluated.<DD><CODE>desiredType</CODE> - The class of the result desired.
<DT><B>Returns:</B><DD>The result of the evaluation of the last expression.<DT><B>See Also:</B><DD><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, org.springframework.expression.EvaluationContext, java.lang.Class)"><CODE>evalExpression(String, EvaluationContext, Class)</CODE></A>,
<A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, java.lang.Object, java.lang.Class)"><CODE>evalExpression(String, Object, Class)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="evalExpressions(java.lang.String[], org.springframework.expression.EvaluationContext, java.lang.Class)"><!-- --></A><H3>
evalExpressions</H3>
<PRE>
public &lt;T&gt; T <B>evalExpressions</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>[]&nbsp;expressionStrings,
<A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A>&nbsp;evaluationContext,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&lt;T&gt;&nbsp;desiredType)</PRE>
<DL>
<DD>Evaluates multiple SpEL expressions and returns the result of the last
expression.
<P>
<DD><DL>
<DT><B>Type Parameters:</B><DD><CODE>T</CODE> - The type of the result desired.<DT><B>Parameters:</B><DD><CODE>expressionStrings</CODE> - The SpEL expressions to evaluate.<DD><CODE>evaluationContext</CODE> - The context in which the expression is to be evaluated.<DD><CODE>desiredType</CODE> - The class of the result desired.
<DT><B>Returns:</B><DD>The result of the evaluation of the last expression.<DT><B>See Also:</B><DD><A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, org.springframework.expression.EvaluationContext, java.lang.Class)"><CODE>evalExpression(String, EvaluationContext, Class)</CODE></A>,
<A HREF="../../../net/abhinavsarkar/spelhelper/SpelHelper.html#evalExpression(java.lang.String, java.lang.Object, java.lang.Class)"><CODE>evalExpression(String, Object, Class)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="lookupImplicitMethod(java.lang.String)"><!-- --></A><H3>
lookupImplicitMethod</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Method.html?is-external=true" title="class or interface in java.lang.reflect">Method</A> <B>lookupImplicitMethod</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;lookup)</PRE>
<DL>
<DD>Looks up an implicit method registered with this instance.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lookup</CODE> - key to lookup which should be of form:
<code>method.getParameterTypes()[0].getName() + "." + method.getName()</code>
<DT><B>Returns:</B><DD>The registered method if found, else null.</DL>
</DD>
</DL>
<HR>
<A NAME="lookupImplicitConstructor(java.lang.String)"><!-- --></A><H3>
lookupImplicitConstructor</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/reflect/Constructor.html?is-external=true" title="class or interface in java.lang.reflect">Constructor</A>&lt;?&gt; <B>lookupImplicitConstructor</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;lookup)</PRE>
<DL>
<DD>Looks up an implicit constructor registered with this instance.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>lookup</CODE> - key to lookup which should be of form:
<code>constructor.getDeclaringClass().getSimpleName()</code>
<code>+ Arrays.toString(constructor.getParameterTypes())</code>
<DT><B>Returns:</B><DD>The registered constructor if found, else null.</DL>
</DD>
</DL>
<HR>
<A NAME="getCurrentContext()"><!-- --></A><H3>
getCurrentContext</H3>
<PRE>
public static <A HREF="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/expression/EvaluationContext.html?is-external=true" title="class or interface in org.springframework.expression">EvaluationContext</A> <B>getCurrentContext</B>()</PRE>
<DL>
<DD>Returns the current evaluation context. Null if there is no context.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The current evaluation context.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../net/abhinavsarkar/spelhelper/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SpelHelper.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Code hosted at <a target='_blank' href='http://github.com/abhin4v/spelhelper/'>github</a></EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../net/abhinavsarkar/spelhelper/ImplicitMethods.html" title="class in net.abhinavsarkar.spelhelper"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?net/abhinavsarkar/spelhelper/SpelHelper.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="SpelHelper.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2010. All Rights Reserved.
</BODY>
</HTML>