You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Oliver Heger (JIRA)" <ji...@apache.org> on 2013/11/09 19:04:17 UTC

[jira] [Resolved] (BEANUTILS-428) Provide a BeanIntrospector implementation which supports properties in a fluent API

     [ https://issues.apache.org/jira/browse/BEANUTILS-428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved BEANUTILS-428.
------------------------------------

    Resolution: Fixed

Fixed in subversion in revision 1540355.

> Provide a BeanIntrospector implementation which supports properties in a fluent API
> -----------------------------------------------------------------------------------
>
>                 Key: BEANUTILS-428
>                 URL: https://issues.apache.org/jira/browse/BEANUTILS-428
>             Project: Commons BeanUtils
>          Issue Type: Improvement
>          Components: Bean / Property Utils
>    Affects Versions: 1.8.3
>            Reporter: Oliver Heger
>            Assignee: Oliver Heger
>         Attachments: beanutils-428.patch
>
>
> BEANUTILS-425 was about adding a mechanism for customizing bean introspection. This ticket is a request for a concrete new {{BeanIntrospector}} implementation which detects writable bean properties even if the return value of the set method is not *void*.
> The _builder_ pattern and fluent API definitions become more and more popular. Here methods are offered for setting properties that return the current instance of a builder object for method chaining, for instance:
> {code}
> public class FooBuilder {
>     public FooBuilder setFooProperty1(String value) {
>         ...
>         return this;
>     }
>     public FooBuilder setFooProperty2(int value) {
>         ...
>         return this;
>     }
> }
> {code}
> Standard bean introspection will not recognize set methods like that because they do not conform to the Java Beans specification. A new {{BeanIntrospector}} implementation can be created which ignores the return type of set methods and create corresponding {{PropertyDescriptor}} objects with a correct write method.



--
This message was sent by Atlassian JIRA
(v6.1#6144)