Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.8.3
-
None
-
None
Description
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:
public class FooBuilder { public FooBuilder setFooProperty1(String value) { ... return this; } public FooBuilder setFooProperty2(int value) { ... return this; } }
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.
Attachments
Attachments
Issue Links
- causes
-
BEANUTILS-541 FluentPropertyBeanIntrospector caches corrupted writeMethod (two subclasses)
- Resolved
- requires
-
BEANUTILS-425 Support customization of introspection mechanism
- Closed