EL: accessing non-getter/setter

Discussion in 'Java' started by Timo Nentwig, May 10, 2004.

  1. Timo Nentwig

    Timo Nentwig Guest

    Hi!

    What about "read-only" properties of a bean such as size/length? In this
    case I used to name the method size() rather than getSize() for a matter
    of there's no setSize().

    It seems that I can only access getter/setter using the EL dot syntax.
    And what about hasXXX() or isXXX()?

    Timo
    Timo Nentwig, May 10, 2004
    #1
    1. Advertising

  2. Timo Nentwig

    Timo Nentwig Guest

    Or, how do I iterator thru a List (-> List.iterator()) via <c:forEach>?
    Timo Nentwig, May 10, 2004
    #2
    1. Advertising

  3. Timo Nentwig

    Tim Slattery Guest

    Timo Nentwig <> wrote:

    >Hi!
    >
    >What about "read-only" properties of a bean such as size/length? In this
    >case I used to name the method size() rather than getSize() for a matter
    >of there's no setSize().
    >
    >It seems that I can only access getter/setter using the EL dot syntax.
    >And what about hasXXX() or isXXX()?


    You can name the getter for a boolean property isXxx(). I've never
    encountered anything named hasXxx().

    --
    Tim Slattery
    Tim Slattery, May 10, 2004
    #3
  4. Timo Nentwig

    Roedy Green Guest

    On Mon, 10 May 2004 14:24:29 +0200, Timo Nentwig <>
    wrote or quoted :

    >What about "read-only" properties of a bean such as size/length? In this
    >case I used to name the method size() rather than getSize() for a matter
    >of there's no setSize().

    Does not matter. Beans must use the get prefix on methods they want
    to export to a beanbox.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, May 10, 2004
    #4
  5. Timo Nentwig

    Timo Nentwig Guest

    Tim Slattery wrote:
    > You can name the getter for a boolean property isXxx(). I've never


    I tried isEmpty() but this didn't work...

    > encountered anything named hasXxx().


    Iterator.hasNext()
    Timo Nentwig, May 11, 2004
    #5
  6. Timo Nentwig

    Murray Guest

    "Timo Nentwig" <> wrote in message
    news:...
    > Tim Slattery wrote:
    > > You can name the getter for a boolean property isXxx(). I've never

    >
    > I tried isEmpty() but this didn't work...
    >
    > > encountered anything named hasXxx().

    >
    > Iterator.hasNext()


    I've tried that in the past also. I believe it's because 'empty' is a
    reserved word.
    Murray, May 11, 2004
    #6
  7. Timo Nentwig

    Murray Guest

    "Murray" <4Mnet.com.au> wrote in message
    news:40a0ea07$0$16964$...
    >
    > "Timo Nentwig" <> wrote in message
    > news:...
    > > Tim Slattery wrote:
    > > > You can name the getter for a boolean property isXxx(). I've never

    > >
    > > I tried isEmpty() but this didn't work...
    > >
    > > > encountered anything named hasXxx().

    > >
    > > Iterator.hasNext()

    >
    > I've tried that in the past also. I believe it's because 'empty' is a
    > reserved word.


    I've also found that isXXX() methods will only work for primitive booleans
    and not Booleans
    Murray, May 11, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raoul Markus
    Replies:
    3
    Views:
    1,075
    Roedy Green
    Sep 20, 2003
  2. Timo Nentwig
    Replies:
    75
    Views:
    3,292
    Jon A. Cruz
    Jan 18, 2004
  3. Stacey
    Replies:
    1
    Views:
    1,777
    Collin VanDyck
    Feb 10, 2004
  4. Adam Sandler

    problem with getter and setter not working

    Adam Sandler, May 25, 2006, in forum: ASP .Net
    Replies:
    12
    Views:
    715
    Jimi200478
    May 26, 2006
  5. gamehack
    Replies:
    2
    Views:
    491
    James Stroud
    Jul 18, 2007
Loading...

Share This Page