Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.jexl2.introspection
Interface JexlMethod

All Known Implementing Classes:
  AbstractExecutor.Method, MethodExecutor

    public interface JexlMethod

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

Since:
  1.0
Version:
  $Id: JexlMethod.java 889760 2009-12-11 18:42:49Z sebb $
Author:
  Geir Magnusson Jr.

Method Summary
`java.lang.Class<?>` | `getReturnType()` returns the return type of the method invoked.
`java.lang.Object` | `invoke(java.lang.Object obj, java.lang.Object[] params)` Invocation method, called when the method invocation should be performed and a value returned.
`boolean` | `isCacheable()` Specifies if this JexlMethod is cacheable and able to be reused for this class of object it was returned for.
`boolean` | `tryFailed(java.lang.Object rval)` Checks whether a tryInvoke failed or not.
`java.lang.Object` | `tryInvoke(java.lang.String name, java.lang.Object obj, java.lang.Object[] params)` Attempts to reuse this JexlMethod, checking that it is compatible with the actual set of arguments.

Method Detail

### invoke

    java.lang.Object invoke(java.lang.Object obj,
                            java.lang.Object[] params)
                            throws java.lang.Exception

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

  Parameters:
    `obj` - the object
    `params` - method parameters.
  Returns:
    the result
  Throws:
    `java.lang.Exception` - on any error.

### tryInvoke

    java.lang.Object tryInvoke(java.lang.String name,
                               java.lang.Object obj,
                               java.lang.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:
    `obj` - the object to invoke the method upon
    `name` - the method name
    `params` - the method arguments
  Returns:
    the result of the method invocation that should be checked by tryFailed to determine if it succeeded or failed.

### tryFailed

    boolean tryFailed(java.lang.Object rval)

  Checks whether a tryInvoke failed or not.

  Parameters:
    `rval` - the value returned by tryInvoke
  Returns:
    true if tryInvoke failed, false otherwise

### isCacheable

    boolean isCacheable()

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

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

### getReturnType

    java.lang.Class<?> getReturnType()

  returns the return type of the method invoked.

  Returns:
    return type

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.