{"id":49,"date":"2005-12-05T23:18:44","date_gmt":"2005-12-06T04:18:44","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/?p=49"},"modified":"2005-12-05T23:18:44","modified_gmt":"2005-12-06T04:18:44","slug":"jakarta-beanutils-propertyutils-nested-properties","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2005\/12\/05\/jakarta-beanutils-propertyutils-nested-properties\/","title":{"rendered":"Jakarta BeanUtils PropertyUtils Nested Properties"},"content":{"rendered":"<p>I have mentioned the Jakarta BeanUtils project before (see <a href=\"http:\/\/www.juixe.com\/techknow\/index.php\/2005\/10\/13\/jakarta-beanutils-propertyutils\/\" title=\"Jakarta BeanUtils PropertyUtils\">Jakarta BeanUtils PropertyUtils<\/a>).  The PropertyUtils class of the BeanUtils project allows you to dynamically access a JavaBean property.  PropertyUtils gives you access to mapped, indexed, and simple properties via get\/setMappedProperty, get\/setIndexedProperty, and get\/setSimpleProperty.<\/p>\n<p>PropertyUtils also provides a generic getProperty method which can be used to access any arbitrary combination of mapped, indexed, or simple properties.  I&#8217;ve taken an example from the BeanUtils documentation.  Instead of this:<\/p>\n<pre>\nString city = employee.getSubordinate(1)\n    .getAddress(&quot;home&quot;)\n    .getCity();\n<\/pre>\n<p>You can write:<\/p>\n<pre>\nString city = (String)Property.getProperty(\n    employee, &quot;subordinate[1].address(home).city&quot;);\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I have mentioned the Jakarta BeanUtils project before (see Jakarta BeanUtils PropertyUtils). The PropertyUtils class of the BeanUtils project allows you to dynamically access a JavaBean property. PropertyUtils gives you access to mapped, indexed, and simple properties via get\/setMappedProperty, get\/setIndexedProperty, and get\/setSimpleProperty. PropertyUtils also provides a generic getProperty method which can be used to access [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[15,3],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-N","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/49"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":0,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/49\/revisions"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}