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;
> p
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
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;
>
> pu
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
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 MethodUtils.invokeMethod() expects to receive the method
name (i.e., "setCustomer"). So I'm wondering what is the best way to reso
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,
Hi James,
actually replacing:
BeanUtils.setProperty(myBeanInst, myProperty, instanceOfClassTypeX);
with:
MethodUtils.invokeMethod(myBeanInst, myPropertySetter, instanceOfClassTypeX);
works like a dream, thanks for pointing out MethodUtils. I'm currently
converting 'myProperty' to 'myPropertySet
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 i
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;
.
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 fro
.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
Why not have another "calculated" property ("myPropertyAsB") that can
do the translation from ClassTypeB to/from ClassTypeA and store it
into myProperty? That way, you don't have to modify the library at
all?
On Mon, Jun 7, 2010 at 12:04 AM, Dimitris Tsitses <4.biz@gmail.com> wrote:
> Ok. I n
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);
The property consists of the getter/setter, not some field. So, the
pair of matching setter/getter are what makes up the property. The
overloaded method isn't a setter for the property.
On Sun, Jun 6, 2010 at 12:55 PM, Dimitris Tsitses <4.biz@gmail.com> wrote:
> myProperty is of one type onl
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 would mean that
the JavaBeans spec undermines Java's spec! (i.e., do you like meth
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
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 setMyProperty(ClassTypeA anObj) {
this.myProperty = anObj;
17 matches
Mail list logo