[prev in list] [next in list] [prev in thread] [next in thread]
List: groovy-user
Subject: Re: [groovy-user] Boolean property with an isProperty() type
From: Peter Niederwieser <pniederw () gmail ! com>
Date: 2009-03-30 10:58:49
Message-ID: 22780739.post () talk ! nabble ! com
[Download RAW message or body]
Groovy generates both an is() and a get() accessor for a property of type
boolean, and a get() accessor for all other types (including Boolean).
However, I'm not sure what happens together with inheritance.
Cheers,
Peter
Jean-Noël Rivasseau-3 wrote:
>
> No particular reason I used Boolean, I just prefer using the object than
> the
> primitive.
>
> Apparently the error was fixed by running a grails clean, so I just
> suspect
> something strange was going on.
>
> Anyway, does Groovy generate the is() accessor, or only the get() one?
>
> Jean-Noel
>
> On Mon, Mar 30, 2009 at 12:27 PM, Peter Niederwieser
> <pniederw@gmail.com>wrote:
>
> >
> > Can you provide a self-contained example? Is there a particular reason
> > why
> > you use Boolean instead of boolean?
> >
> > Cheers,
> > Peter
> >
> >
> > Jean-Noël Rivasseau-3 wrote:
> > >
> > > Hello,
> > >
> > > I have an interface declaring the Boolean isImmaterial() method.
> > >
> > > One of the class implementing the interface has a
> > >
> > > Boolean immaterial
> > >
> > > property, but I wrote the
> > >
> > > public Boolean isImmaterial() method anyway. When it is accessed an
> > > AbstractMethodError exception is thrown. If I remove the method
> > everything
> > > works fine.
> > >
> > > I thought Groovy only generated getImmaterial() accessors, and anyway,
> > > that
> > > you could provide your own accessors. What is wrong then?
> > >
> > > PS: I am using Grails but the class in question is not a domain class -
> > > not
> > > sure if Grails does special magic behind my back or not.
> > >
> > > Jean-Noel
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/Boolean-property-with-an-isProperty%28%29-type-accessor-tp22759804p22780254.html
> > Sent from the groovy - user mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> > http://xircles.codehaus.org/manage_email
> >
> >
> >
>
>
--
View this message in context: \
http://www.nabble.com/Boolean-property-with-an-isProperty%28%29-type-accessor-tp22759804p22780739.html
Sent from the groovy - user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic