raw edit fix

This commit is contained in:
honfika@gmail.com
2015-02-03 18:59:05 +01:00
parent 74a101e1ea
commit 1fb58e6dd8
7 changed files with 52 additions and 40 deletions

View File

@@ -33,6 +33,11 @@ import java.util.logging.Logger;
*/
public class ReflectionTools {
public static Object getValue(Object obj, Field field) throws IllegalArgumentException, IllegalAccessException {
Object value = field.get(obj);
return value;
}
public static Object getValue(Object obj, Field field, int index) throws IllegalArgumentException, IllegalAccessException {
if (getFieldSubSize(obj, field) <= index) {
return null;
@@ -74,6 +79,10 @@ public class ReflectionTools {
return 0;
}
public static void setValue(Object obj, Field field, Object newValue) throws IllegalArgumentException, IllegalAccessException {
field.set(obj, newValue);
}
@SuppressWarnings("unchecked")
public static void setValue(Object obj, Field field, int index, Object newValue) throws IllegalArgumentException, IllegalAccessException {
Object value = field.get(obj);