java - beanutils set property in two level object and hash map -
i trying use beanutils set property in 2 level java object , map not working.
public class scheme { private schemedetails details; private string code; public string getcode() { return code; } public void setcode(string code) { this.code = code; } public schemedetails getdetails() { return details; } public void setdetails(schemedetails details) { this.details = details; }
}
public class schemedetails { private hashmap<string, string> detailsmaster; private integer amount; public integer getamount() { return amount; } public void setamount(integer amount) { this.amount = amount; } public hashmap<string, string> getdetailsmaster() { return detailsmaster; } public void setdetailsmaster(hashmap<string, string> detailsmaster) { this.detailsmaster = detailsmaster; }
}
void run() { beanutils.setproperty("scheme", "code", "123"); //working beanutils.setproperty("scheme", "details.amount", "3434"); //not working beanutils.setproperty("scheme", "details.detailsmaster(key)", "3434"); //not working }
i have 2 object scheme, scheme details , tried set object inside scheme using beanutils.
values
working scheme.code not working scheme.details.amount , scheme.detailsmaster(key)
it throws me error
java.lang.illegalargumentexception: no bean specified @ org.apache.commons.beanutils.propertyutilsbean.getpropertydescriptor(prope rtyutilsbean.java:883)
please me in setting object inside object using beanutils
Comments
Post a Comment