I saw a similar issue on the archive but did not see what the solution to
this was, so decided to ask the same question again.

Do BeanUtils.describe and BeanUtils.populate supposed to handle indexed
properties?

Suppose I have this JavaBean:

public class NameBean {
     private String[] name;

     public String[] getName() {
          return this.name;
     }
     public void setName(String[] name) {
          this.name = name;
     }
     public String getName(int index) {
          return this.name[index];
     }
     public void setName(int index, String name) {
          this.name[index] = name;
     }
}

     NameBean nameBean = new NameBean();
     nameBean.setName(new String[] {"John", "Paul", "Jack"});

     Map properties = BeanUtils.describe(nameBean);

I would expect the following code to return a Map containing:
name[0]="John", name[1]="Paul", name[2]="Jack"

but instead,

I get name="John".
Only the first element is considered.

regards

Rajesh


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to