public class UtilJava extends Object
| 构造器和说明 |
|---|
UtilJava() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Iterable<Object> |
getIterable(Object collection)
把指定对象转换成Iterable,如果是数据或Iterable本身的条目也是返回的Iteralbe的条目,
null返回一个空List,其他包装成一个Iterable,把对象放到Iterable条目中。
|
static Method |
getMethod(Class<?> cls,
String methodName,
List<Object> params)
通过参数值列表获取对象的方法。
|
static Object |
invokeMethod(String className,
String methodName,
ActionContext actionContext)
调用参数是ActionContext的静态方法。
|
public static Iterable<Object> getIterable(Object collection)
collection - 集合public static Method getMethod(Class<?> cls, String methodName, List<Object> params)
cls - 类methodName - 方法名称params - 参数public static Object invokeMethod(String className, String methodName, ActionContext actionContext) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException
className - 类名methodName - 方法名actionContext - 变量上下文InvocationTargetExceptionIllegalArgumentExceptionIllegalAccessExceptionSecurityExceptionNoSuchMethodExceptionClassNotFoundExceptionCopyright © 2016 xworker.org. All rights reserved.