Package org.apache.commons.ognl
Interface MethodAccessor
-
- All Known Implementing Classes:
ObjectMethodAccessor
public interface MethodAccessorThis interface defines methods for calling 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectcallMethod(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Object target, java.lang.String methodName, java.lang.Object[] args)Calls the method named with the arguments given.java.lang.ObjectcallStaticMethod(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Class<?> targetClass, java.lang.String methodName, java.lang.Object[] args)Calls the static method named with the arguments given on the class given.
-
-
-
Method Detail
-
callStaticMethod
java.lang.Object callStaticMethod(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Class<?> targetClass, java.lang.String methodName, java.lang.Object[] args) throws OgnlExceptionCalls the static method named with the arguments given on the class given.- Parameters:
context- expression context in which the method should be calledtargetClass- the object in which the method existsmethodName- the name of the methodargs- the arguments to the method- Returns:
- result of calling the method
- Throws:
OgnlException- if there is an error calling the method
-
callMethod
java.lang.Object callMethod(java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Object target, java.lang.String methodName, java.lang.Object[] args) throws OgnlExceptionCalls the method named with the arguments given.- Parameters:
context- expression context in which the method should be calledtarget- the object in which the method existsmethodName- the name of the methodargs- the arguments to the method- Returns:
- result of calling the method
- Throws:
OgnlException- if there is an error calling the method
-
-