Top Description Methods
org.apache.commons.jexl2.introspection

public Interface JexlMethod

Known Direct Implementers
org.apache.commons.jexl2.introspection.UberspectImpl.ConstructorMethod, org.apache.commons.jexl2.internal.AbstractExecutor.Method

Interface used for regular method invocation. Ex. ${foo.bar()}
Since
1.0

Method Summary

Modifier and TypeMethod and Description
public Class<?>

Returns:

return type
getReturnType
()

returns the return type of the method invoked.

public Object

Returns:

the result
invoke
(Object
the object
obj
,
Object[]
method parameters.
params
)

Invocation method, called when the method invocation should be performed and a value returned.

public boolean

Returns:

true if can be reused for this class, false if not
isCacheable
()

Specifies if this JexlMethod is cacheable and able to be reused for this class of object it was returned for.

public boolean

Returns:

true if tryInvoke failed, false otherwise
tryFailed
(Object
the value returned by tryInvoke
rval
)

Checks whether a tryInvoke failed or not.

public Object

Returns:

the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.
tryInvoke
(String
the method name
name
,
Object
the object to invoke the method upon
obj
,
Object[]
the method arguments
params
)

Attempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments.

Method Detail

getReturnTypeback to summary
public Class<?> getReturnType()

returns the return type of the method invoked.

Returns:Class<?>

return type

invokeback to summary
public Object invoke(Object obj, Object[] params) throws Exception

Invocation method, called when the method invocation should be performed and a value returned.

Parameters
obj:Object

the object

params:Object[]

method parameters.

Returns:Object

the result

Exceptions
Exception:
on any error.
isCacheableback to summary
public boolean isCacheable()

Specifies if this JexlMethod is cacheable and able to be reused for this class of object it was returned for.

Returns:boolean

true if can be reused for this class, false if not

tryFailedback to summary
public boolean tryFailed(Object rval)

Checks whether a tryInvoke failed or not.

Parameters
rval:Object

the value returned by tryInvoke

Returns:boolean

true if tryInvoke failed, false otherwise

tryInvokeback to summary
public Object tryInvoke(String name, Object obj, Object[] params)

Attempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments. Related to isCacheable since this method is often used with cached JexlMethod instances.

Parameters
name:String

the method name

obj:Object

the object to invoke the method upon

params:Object[]

the method arguments

Returns:Object

the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.