[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    Re: Accessing class constants
From:       Bojan Smojver <bojan () binarix ! com>
Date:       2001-10-27 0:13:09
[Download RAW message or body]

Kelvin Tan wrote:
> 
> [snip]
> > > if class Foo has
> > >
> > > public static final String HOME = "bar"
> > >
> > > am I able to access $foo.HOME, or do I need to add an accessor method?
> > >
> > > I looked through the source code, and there's no mention about fields in
> the
> > > Introspector class, only methods. I could've missed it though.
> >
> > From what I can see in UG, you should have the method.
> >
> > Bojan
> >
> 
> Sorry, I don't really catch that. In UG?

Apologies. User's Guide.

> Do you think it's a better coding practise to include a getter method for
> the class constant?

I think that's the only way, actually.

Bojan

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic