Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D43CBE978 for ; Sun, 3 Mar 2013 20:31:14 +0000 (UTC) Received: (qmail 92703 invoked by uid 500); 3 Mar 2013 20:31:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 92593 invoked by uid 500); 3 Mar 2013 20:31:13 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 92317 invoked by uid 99); 3 Mar 2013 20:31:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Mar 2013 20:31:13 +0000 Date: Sun, 3 Mar 2013 20:31:13 +0000 (UTC) From: "Oliver Heger (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (BEANUTILS-428) Provide a BeanIntrospector implementation which supports properties in a fluent API MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 Patch contains the proposed {{FluentPropertyBeanIntrospector}} class and a corresponding test class. > 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