Add get(Object target, String field) to ReflectionUtils.java
This commit is contained in:
@@ -33,4 +33,10 @@ public abstract class ReflectionUtils extends org.springframework.util.Reflectio
|
|||||||
makeAccessible(f);
|
makeAccessible(f);
|
||||||
setField(f, target, value);
|
setField(f, target, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Object get(Object target, String field) {
|
||||||
|
Field f = findField(target.getClass(), field);
|
||||||
|
makeAccessible(f);
|
||||||
|
return getField(f, target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user