Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-10 Thread Niall Pemberton
On Sun, Jun 6, 2010 at 3:02 AM, Dimitris Tsitses 4.biz@gmail.com wrote: Hi all, I'm trying to do something really simple but I can't seem to figure it out, I hope someone can help. I have a simple bean: public class MyBean {        private ClassTypeA myProperty;        public void

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-10 Thread Niall Pemberton
On Sun, Jun 6, 2010 at 5:55 PM, Dimitris Tsitses 4.biz@gmail.com wrote: myProperty is of one type only. The overloaded setters are there only for convenience, i.e., to convert to the type of myProperty before setting it. I don't think the JavaBeans spec disallows that, if it did, that

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-10 Thread Niall Pemberton
On Mon, Jun 7, 2010 at 5:18 PM, Dimitris Tsitses 4.biz@gmail.com wrote: Hi James, thanks for keeping up with my questions. So, you mean end up with something like this: ? public class MyBean {       private ClassTypeA myProperty;       private ClassTypeB myPropertyAsB;       private

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread henrib
.680414.n4.nabble.com/beanutils-beanutils-library-cannot-invoke-the-correct-accessor-tp2244705p2245549.html Sent from the Commons - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
it but JEXL2 just does that (JexlEngine.{s,g}etProperterty). Hope this can help, Henri -- View this message in context: http://apache-commons.680414.n4.nabble.com/beanutils-beanutils-library-cannot-invoke-the-correct-accessor-tp2244705p2245549.html Sent from the Commons - User mailing list

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread Dimitris Tsitses
Hi James, thanks for keeping up with my questions. So, you mean end up with something like this: ? public class MyBean { private ClassTypeA myProperty; private ClassTypeB myPropertyAsB; private ClassTypeC myPropertyAsC; private ClassTypeD myPropertyAsD; .

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
No, you wouldn't have the fields, just the methods that do the conversion to store/retrieve the values from the one, main, field. Also, I wouldn't consider this a lack of basic functionality on the part of BeanUtils (*many* folks use BeanUtils in their projects and haven't complained that this is

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
On Mon, Jun 7, 2010 at 1:05 PM, Dimitris Tsitses 4.biz@gmail.com wrote: Hi James, actually replacing: BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX); with: MethodUtils.invokeMethod(myBeanInst, myPropertySetter, instanceOfClassTypeX); works like a dream, thanks for

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-07 Thread James Carman
Create a helper method of your own somewhere? On Mon, Jun 7, 2010 at 5:28 PM, Dimitris Tsitses 4.biz@gmail.com wrote: Sorry, it appears that I didn't explain myself properly. What I mean is that BeanUtils.setProperty() expects to receive the property name (i.e., customer), whereas

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-06 Thread James Carman
That violates the JavaBeans specification. myProperty is supposed to be of one type only. On Sat, Jun 5, 2010 at 10:02 PM, Dimitris Tsitses 4.biz@gmail.com wrote: Hi all, I'm trying to do something really simple but I can't seem to figure it out, I hope someone can help. I have a simple

Re: [beanutils] beanutils library cannot invoke the correct accessor

2010-06-06 Thread Dimitris Tsitses
Ok. I need some help to hack the library, where do I start. I want to make it so that it checks the available setters against the objectType of the given argument, instead of assuming an argument of a specific type. Example: BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX);