ognl
Interface MethodAccessor

All Known Implementing Classes:
ObjectMethodAccessor

public interface MethodAccessor

This interface defines methods for callinig methods in a target object. Methods are broken up into static and instance methods for convenience. indexes into the target object, which must be an array.

Author:
Luke Blanshard (blanshlu@netscape.net), Drew Davidson (drew@ognl.org)

Method Summary
 Object callMethod(Map context, Object target, String methodName, Object[] args)
          Calls the method named with the arguments given.
 Object callStaticMethod(Map context, Class targetClass, String methodName, Object[] args)
          Calls the static method named with the arguments given on the class given.
 

Method Detail

callStaticMethod

public Object callStaticMethod(Map context,
                               Class targetClass,
                               String methodName,
                               Object[] args)
                        throws MethodFailedException
Calls the static method named with the arguments given on the class given.

Parameters:
context - expression context in which the method should be called
targetClass - the object in which the method exists
methodName - the name of the method
args - the arguments to the method
Throws:
MethodFailedException - if there is an error calling the method

callMethod

public Object callMethod(Map context,
                         Object target,
                         String methodName,
                         Object[] args)
                  throws MethodFailedException
Calls the method named with the arguments given.

Parameters:
context - expression context in which the method should be called
target - the object in which the method exists
methodName - the name of the method
args - the arguments to the method
Throws:
MethodFailedException - if there is an error calling the method

OGNL Project Page