commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BEANUTILS-428) Provide a BeanIntrospector implementation which supports properties in a fluent API
Date Fri, 15 Mar 2013 21:26:14 GMT

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

Oliver Heger updated BEANUTILS-428:
-----------------------------------

    Attachment: beanutils-428.patch

Enhanced patch with generics and Java 5 features.
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message