com.aiyc.server.standalone.util
类 ReflectHelper

java.lang.Object
  继承者 com.aiyc.server.standalone.util.ReflectHelper

public class ReflectHelper
extends Object


构造方法摘要
ReflectHelper()
           
 
方法摘要
static Object getFileValue(Object object, String filedName)
          访问类成员变�?
static Object getObjectByConstructor(String className, Class[] intArgsClass, Object[] intArgs)
          通过构�?
static void main(String[] args)
           
static void modifyFileValue(Object object, String filedName, Object filedValue)
          修改成员变量的�??
static Object useMethod(Object object, String methodName, Class[] type, Class[] value)
          调用类的方法,包括私�?
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

ReflectHelper

public ReflectHelper()
方法详细信息

getObjectByConstructor

public static Object getObjectByConstructor(String className,
                                            Class[] intArgsClass,
                                            Object[] intArgs)
通过构�?�器取得实例

参数:
className - 类的全限定名
intArgsClass - 构�?�函数的参数类型
intArgs - 构�?�函数的参数�?
返回:
Object

modifyFileValue

public static void modifyFileValue(Object object,
                                   String filedName,
                                   Object filedValue)
修改成员变量的�??

参数:
Object - 修改对象
filedName - 指定成员变量�?
filedValue - 修改的�??

getFileValue

public static Object getFileValue(Object object,
                                  String filedName)
访问类成员变�?

参数:
Object - 访问对象
filedName - 指定成员变量�?
返回:
Object 取得的成员变量的�?

useMethod

public static Object useMethod(Object object,
                               String methodName,
                               Class[] type,
                               Class[] value)
调用类的方法,包括私�?

参数:
Object - 访问对象
methodName - 指定成员变量�?
type - 方法参数类型
value - 方法参数�?
返回:
Object 方法的返回结果对�?

main

public static void main(String[] args)


Copyright © 2017. All Rights Reserved.