- Manipulate fields.
Field[] flds = cls.getFields();
//Check modifier first, if necessary.
int mods = flds[i].getModifiers();
flds[i].set(obj, value);
flds[i].setBoolean(obj, b);
flds[i].setLong(obj, l);
...
- Invoke a method.
Method m = cls.getMethod(name, paraTypes);
Object ob = m.invoke(obj, args);
public Method getMethod(String nm, Class[] paramTypes);
public Object invoke(Object ob, Object[] args);
- Manipulate an array.
public Class getComponentType();
public static int getLength(Object array);
public static Object newInstance(Class type, int len);
public static Object get(Object array, int idx);
public void set(Object array, int idx, Object value);