Package org.zkoss.xel.util
Class MethodFunction
- java.lang.Object
-
- org.zkoss.lang.reflect.SerializableMethod
-
- org.zkoss.xel.util.MethodFunction
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,Function
public class MethodFunction extends SerializableMethod implements Function
A XEL function based on java.lang.reflect.Method. It is used by implementation ofExpressionFactoryThe user of XEL expressions rarely need it.- Since:
- 3.0.0
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MethodFunction(java.lang.reflect.Method method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>[]getParameterTypes()Returns an array of Class objects that represent the formal parameter types, in declaration order, of the method represented by this Method object.java.lang.Class<?>getReturnType()Returns a Class object that represents the formal return type of the method represented by this Method object.java.lang.Objectinvoke(java.lang.Object obj, java.lang.Object... args)Invokes this method with the specified arguments.java.lang.reflect.MethodtoMethod()Converts this function to a method, or null if unable to convert.
-
-
-
Method Detail
-
getParameterTypes
public java.lang.Class<?>[] getParameterTypes()
Description copied from interface:FunctionReturns an array of Class objects that represent the formal parameter types, in declaration order, of the method represented by this Method object.Returns an array of length 0 if the underlying method takes no parameters.
- Specified by:
getParameterTypesin interfaceFunction
-
getReturnType
public java.lang.Class<?> getReturnType()
Description copied from interface:FunctionReturns a Class object that represents the formal return type of the method represented by this Method object.- Specified by:
getReturnTypein interfaceFunction
-
invoke
public java.lang.Object invoke(java.lang.Object obj, java.lang.Object... args) throws java.lang.ExceptionDescription copied from interface:FunctionInvokes this method with the specified arguments.- Specified by:
invokein interfaceFunction- Parameters:
obj- the object the underlying method is invoked from. It is always null if this function is invoked in an XEL expression. It is reserved for more sophisticated expressions, such as ZK Spreadsheet's expressions.args- the arguments used for the method call. If null, an Object array with zero length is assumed.- Throws:
java.lang.Exception
-
-