getters and setters for scripted objects

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

getters and setters for scripted objects

Andreas Rozek
Hello once again!

BeanShell automatically invokes the proper getter and setter
methods for JavaBeans when a script tries to access the cor-
responding object properties.

Is there a similar method  for scripted objects?  (JavaBeans
are precompiled or interpreted Java classes  which therefore
cannot be extended at runtime)

Thanks in advance for your effort!

Andreas Rozek         Phone:  ++49 (7031) 222305
Bunsenstra?e 80/1     Fax:    -
D-71032 B?blingen     EMail:  [hidden email]
Germany               URL:    http://www.Andreas-Rozek.de





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

RE: getters and setters for scripted objects

Daniel Leuck
Hello Andreas,

I recently implemented scripted object properties (you can see it in
subversion - svn://ikayzo.org/beanshell), but for some reason it seems to
have broken a number of scope related tests.  I want to revisit this soon,
but am currently slammed with work.  Hopefully I can get to it before the
end of the month.

Regards,
Daniel Leuck
Ikayzo
http://www.ikayzo.com 
http://www.javaui.net 

> -----Original Message-----
> From: [hidden email] [mailto:beanshell-users-
> [hidden email]] On Behalf Of Andreas Rozek
> Sent: Friday, November 11, 2005 6:12 AM
> To: Beanshell Mail List (??. ?????)
> Subject: [Beanshell-users] getters and setters for scripted objects
>
> Hello once again!
>
> BeanShell automatically invokes the proper getter and setter
> methods for JavaBeans when a script tries to access the cor-
> responding object properties.
>
> Is there a similar method  for scripted objects?  (JavaBeans
> are precompiled or interpreted Java classes  which therefore
> cannot be extended at runtime)
>
> Thanks in advance for your effort!
>
> Andreas Rozek         Phone:  ++49 (7031) 222305
> Bunsenstraße 80/1     Fax:    -
> D-71032 Böblingen     EMail:  [hidden email]
> Germany               URL:    http://www.Andreas-Rozek.de
>
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: RE: getters and setters for scripted objects

Andreas Rozek
Hello Daniel et al.

Thanks for your response...

What would happen,  if I would subclass a JavaBean from bsh.NameSpace?
In my understanding, this would effectively create an (unbound) scrip-
ted object - and (on the other side)  it would be an external JavaBean
which BeanShell might treat as such...

This "trick" (is it one?) could actually offer everything I need:
 - dynamic extensibility at runtime
 - access to (predefined) properties using "getters" and "setters"

Does anybody have any experiences with this approach?  Otherwise, I'll
have to try it myself...

Kind regards,

Andreas Rozek         Phone:  ++49 (7031) 222305
Bunsenstra?e 80/1     Fax:    -
D-71032 B?blingen     EMail:  [hidden email]
Germany               URL:    http://www.Andreas-Rozek.de





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

RE: RE: getters and setters for scripted objects

Daniel Leuck
Hi Andreas,

If you create a scripted class and add full blown Java methods following the
bean conventions, the properties will work.  What doesn't work (unless you
grab the head from SVN), is properties for scripted objects.

I took a second to look at my change, and am still not sure why it is
breaking the tests.  My Hawaii->NY jet lag probably isn't helping.  I will
try again on the weekend.

Best regards,
Dan

> -----Original Message-----
> From: Andreas Rozek [mailto:[hidden email]]
> Sent: Thursday, November 17, 2005 11:15 AM
> To: 'Beanshell Mail List (??. ?????)'; Daniel Leuck
> Subject: Re: RE: [Beanshell-users] getters and setters for scripted
> objects
>
> Hello Daniel et al.
>
> Thanks for your response...
>
> What would happen,  if I would subclass a JavaBean from bsh.NameSpace?
> In my understanding, this would effectively create an (unbound) scrip-
> ted object - and (on the other side)  it would be an external JavaBean
> which BeanShell might treat as such...
>
> This "trick" (is it one?) could actually offer everything I need:
>  - dynamic extensibility at runtime
>  - access to (predefined) properties using "getters" and "setters"
>
> Does anybody have any experiences with this approach?  Otherwise, I'll
> have to try it myself...
>
> Kind regards,
>
> Andreas Rozek         Phone:  ++49 (7031) 222305
> Bunsenstraße 80/1     Fax:    -
> D-71032 Böblingen     EMail:  [hidden email]
> Germany               URL:    http://www.Andreas-Rozek.de
>
>




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
<a href="http://ads.osdn.com/?ad_idv28&alloc_id845&op=click">http://ads.osdn.com/?ad_idv28&alloc_id845&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: RE: RE: getters and setters for scripted objects

Andreas Rozek
Hello Daniel!

Thanks for your answer!

>If you create a scripted class and add full blown Java methods following the
>bean conventions, the properties will work.  What doesn't work (unless you
>grab the head from SVN), is properties for scripted objects.

The problem with that kind of objects is: they aren't ex-
tensible at runtime...

>I took a second to look at my change, and am still not sure why it is
>breaking the tests.  My Hawaii->NY jet lag probably isn't helping.  I will
>try again on the weekend.

Oh, I know how bad a jet lag may be - thus: sleep well!

Kind regards,

Andreas Rozek         Phone:  ++49 (7031) 222305
Bunsenstra?e 80/1     Fax:    -
D-71032 B?blingen     EMail:  [hidden email]
Germany               URL:    http://www.Andreas-Rozek.de





-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users