public class UtilJava extends Object
| 构造器 | 说明 |
|---|---|
UtilJava() |
| 修饰符和类型 | 方法 | 说明 |
|---|---|---|
static <T> Iterable<T> |
getIterable(Object collection) |
把指定对象转换成Iterable,如果是数据或Iterable本身的条目也是返回的Iteralbe的条目,
null返回一个空List,其他包装成一个Iterable,把对象放到Iterable条目中。
|
static <T> Iterator<T> |
getIterator(Object collection) |
|
static Method |
getMethod(Class<?> cls,
String methodName,
List<Object> params) |
通过参数值列表获取对象的方法。
|
static Object |
invokeMethod(String className,
String methodName,
ActionContext actionContext) |
调用参数是ActionContext的静态方法。
|
public static <T> Iterable<T> 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 © 2018 xworker.org. All rights reserved.