From: "Mark R. Diggory" <[EMAIL PROTECTED]>
> This is probibly a "stretch" but I thought I'd put it out there...
>
> Are there any "taglibraries" or tools that would allow me to "design" a
> class in xml such that I could create it "mid-stream in my Jelly Script?
>
> What I want is something where I can build an object and add
> getter/setter methods to it.
>
> Something like:
>
> <bean package="org.acme" name="FooBar" extends="java.lang.Object">
>     <property name="foo" class="java.lang.String"/>
>     <property name="bar" class="java.lang.Integer"/>
> </bean>
>
> then
>
> <new var="foobar" className="org.acme.FooBar"/>
>
> <set target="foobar" property="foo" value="hello world"/>

As dIon said, you can do exactly the above with the dynabean library...

<!-- define the DynaClass -->
<dynabean:dynaclass var="CustomerType" name ="CustomerDynaClass">
    <dynabean:property name="name" type="String" />
    <dynabean:property name="address" type="String" />
</dynabean:dynaclass>

<!-- now lets create a DynaBean -->
<dynabean:dynabean var="customer" dynaclass="${CustomerType}"/>
<dynabean:set var="customer" property="name" value="Customer 1" />
<dynabean:set var="customer" property="address" value="Address of Customer
1" />

<!-- or we can use the standard <j:set/> tag to set properties -->
<dynabean:dynabean var="cust2" dynaclass="${CustomerType}"/>
<j:set target="${cust2}" property="name" value="James"/>

James
-------
http://radio.weblogs.com/0112098/

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to