Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BeanUtils - 'describe' method returning Incorrect array value
- public class Demo {
- private ArrayList<String> myList = new ArrayList<String>();
- public Demo() {
- myList.add("first_value");
- myList.add("second_value");
- }
- public ArrayList<String> getMyList() {
- return myList;
- }
- public void setMyList(ArrayList<String> myList) {
- this.myList = myList;
- }
- public static void main(String[] args) {
- Demo myBean = new Demo();
- try {
- Map describe = BeanUtils.describe(myBean);
- Iterator it = describe.entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry pairs = (Map.Entry) it.next();
- System.out.println(String.format("key=%s,value=%s", (String) pairs.getKey(), (String) pairs.getValue()));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
Add Comment
Please, Sign In to add comment