velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henning P. Schmiedehausen" <...@intermeta.de>
Subject Language Lawyer question (was: Re: syntax issue)
Date Thu, 25 Aug 2005 16:25:05 GMT
Nathan Bubna <nbubna@gmail.com> writes:

>barely) and specificity.  Shorthand notation ($bar.foo or $bar.Foo) is

Personally, I'd like to get $bar.Foo deprecated in favour of $bar.foo

Question for the velocity language lawyers ;-) :

--- cut --- 
public class TestBean {
    private String baz = null;
    private String foo = null;

    public String getBAZ() {
        return baz;
    }

    public void setBAZ(String baz) {
        this.baz = baz;
    }

    public String getFoo() {
        return foo;
    }

    public void setFoo(String foo) {
        this.foo = foo;
    }
}
--- cut --- 

$test is an instance of the test bean above.
--- cut --- 
$test.setBAZ("ok")
$test.setFoo("ok")

$test.getbaz()
$test.getBaz()
$test.getBAZ()
$test.getbAZ()

$test.baz
$test.Baz
$test.BAZ
$test.bAZ

$test.getfoo()
$test.getFoo()
$test.getFOO()
$test.getfoo()

$test.foo
$test.Foo
$test.FOO
$test.foo
--- cut --- 

a: What is the outcome? (without trying it out or peeking below ... ;-) )
b: Did it surprise you? 
c: Is this according to the Sun bean Specs?

I'd love to see the Velocity introspector to move closer to the actual
bean spec (though it probably predates it...). Which means IMHO that
$foo.bar and $foo.getBar() are equivalent and behave the same.

	Regards
		Henning















--- cut ---
$test.getbaz()
$test.getBaz()
ok
$test.getbAZ()

$test.baz
$test.Baz
ok
ok

$test.getfoo()
ok
$test.getFOO()
$test.getfOO()

ok
ok
$test.FOO
$test.fOO
--- cut ---
-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

		      4 - 8 - 15 - 16 - 23 - 42

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message