You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by jonah benton <jo...@jonah.com> on 2002/05/28 19:36:03 UTC

Quick method resolution q

I have an object in the context that exposes method signatures of

public void set( String, String )
public String get( String )

I thought Velocity would call set() automatically for statements like:

#set( $object.property = "foo" )

if a signature of 

public void setProperty( String )

was not available, but it doesn't appear to be doing so Is this correct
behavior or am I missing something simple?

Thanks.




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quick method resolution q

Posted by jonah benton <jo...@jonah.com>.
Ah, put will do it. I was missing something simple. Thanks!

On Tue, 2002-05-28 at 12:09, Geir Magnusson Jr. wrote:
> On 5/28/02 1:36 PM, "jonah benton" <jo...@jonah.com> wrote:
> 
> > 
> > I have an object in the context that exposes method signatures of
> > 
> > public void set( String, String )
> > public String get( String )
> > 
> > I thought Velocity would call set() automatically for statements like:
> > 
> > #set( $object.property = "foo" )
> > 
> > if a signature of
> > 
> > public void setProperty( String )
> > 
> > was not available, but it doesn't appear to be doing so Is this correct
> > behavior or am I missing something simple?
> 
> No, it won't call that kind of set.  It will call setProperty(String value),
> or put(String, String)....
> 
> -- 
> Geir Magnusson Jr.
> Research & Development, Adeptra Inc.
> geirm@adeptra.com
> +1-203-247-1713
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Quick method resolution q

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 5/28/02 1:36 PM, "jonah benton" <jo...@jonah.com> wrote:

> 
> I have an object in the context that exposes method signatures of
> 
> public void set( String, String )
> public String get( String )
> 
> I thought Velocity would call set() automatically for statements like:
> 
> #set( $object.property = "foo" )
> 
> if a signature of
> 
> public void setProperty( String )
> 
> was not available, but it doesn't appear to be doing so Is this correct
> behavior or am I missing something simple?

No, it won't call that kind of set.  It will call setProperty(String value),
or put(String, String)....

-- 
Geir Magnusson Jr.
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>