I have a POJO that I'm using for Hibernate, and it's marked up with
@hibernate and @struts.form tags.  This all works fine with XDoclet, until I
add indexed properties.  I want to add setter methods that allow indexed
properties for use on my Struts Form (POJO shouldn't care).  The reason is
b/c I want to use one source file (the POJO) for generating my Hibernate
object and Struts Form.

What I'm looking for is the XDoclet template syntax to allow the following
indexed method to make it into my StrutsForm.


        /**
        * Setter for indexed channelMap forms. 
        * @param index the location to set the form
        * @param cmForm the channelMapForm to set
        */
        public void setChannelMapList(int index, CMCFChannelMapForm cmForm)
{
                this.channelMapList.set(index, cmForm);
        }

Here is my custom template for my setter method:

    <XDtType:ifIsOfType value="return-type"
type="java.util.List,java.util.Set" extent="concrete-type">
    public void <XDtMethod:setterMethod/>( ArrayList
<XDtMethod:propertyName/> )
    </XDtType:ifIsOfType>
    <XDtType:ifIsNotOfType value="return-type"
type="java.util.List,java.util.Set" extent="concrete-type">
    public void <XDtMethod:setterMethod/>( String <XDtMethod:propertyName/>
)
    </XDtType:ifIsNotOfType>
    {
        this.<XDtMethod:propertyName/> = <XDtMethod:propertyName/>;
    }

Thanks,

Matt




-------------------------------------------------------
This SF.NET email is sponsored by: Thawte.com
Understand how to protect your customers personal information by implementing
SSL on your Apache Web Server. Click here to get our FREE Thawte Apache 
Guide: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0029en
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to