> -----Original Message----- > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] > Sent: Monday, October 20, 2003 3:16 PM > To: Jakarta Commons Users List > Subject: Re: [BeanUtils] Mapped properties, this maybe a bug? > > > [EMAIL PROTECTED] wrote: > > >Thanks David for the response. > > > >I guess then the real questions is why is the silent read-only > >assumption the default behavior? Or why not keep looking for setters > >even after the first one that comes up does not match the expected > >signature? > > > >If the non-polymorphic behavior is required rather then convenient, > >then of you have other conflicting signatures, maybe a log4j > warning to > >save other poor souls from hours of debugging? > > > >Not that I require this at present, but I could see a > situation where a > >property has both mapped and scalar behavior especially in an index > >world, ala prop(Name) and prop.config.address. > > > > > > > > The approach for mapped properties was copied from the way that > JavaBeans works for scalar and indexed properties. None of them > supports the type of name polymorphism you are describing, > and lots of > code that talks about "JavaBeans" assumes that you know this > kind of the > rule already, because it is so universal. > > To know precisely what a JavaBean is, the simplest thing to > do is skim > the JavaBeans specification. For the question at hand, > you'll want to > study the chapter on properties pretty carefully. > http://java.sun.com/products/javabeans/
Craig, I am sorry, this has created more smoke rather then cleared the air. On a quick review of the javabeans 1.01 spec an index property does support getters and setters for the complete array. void setter(int index, PropertyType value); // indexed setter PropertyType getter(int index); // indexed getter void setter(PropertyType values[]); // array setter PropertyType[] getter(); // array getter (Chapter 7, Page 41 of the PDF version of the spec). So if BeanUtil supported mapped javabeans follow a similar patterns is it not reasonable to expect a Map getter() and maybe even a void setter(Map map). (Now I really wonder what happens with Collection classes as indexed properties, can one say Object getFoo(int index); and List getFoo();). Maybe it's all that trobbing in my head that is confusing me. At this point it's now only a matter of seeking enlightenment and a way to make the headache go away.... :-) Anthony --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
