On Tue, 2003-07-15 at 20:10, Langelage, Frank wrote:
> I want to add a field like
>     public final static int LAYOUT = 1;
> to home-remote interface of a session bean.
> 
> But there seems to be no way to do this ?
> Am I right ?
> 
> In home.xdt I only found iterators on methods, not on fields.

It's obviously National Merge Files Day today :-)
http://xdoclet.sourceforge.net/ant/xdoclet/modules/ejb/home/HomeInterfaceSubTask.html#Merge%20Files
You could use the home-custom.xdt merge point to include some extra
template code of your own that loops through the fields and include
those which have been labelled with a custom tag.  The value is more of
a problem, though, since the templates only have access to the javadocs
and not the source code.  So you'd have to include the value as the
custom tag's body (or a tag parameter).  e.g.

<XDtField:forAllFields>
<XDtField:ifHasFieldTag tagName="franks.constant">
    /** <XDtField:fieldComment/> */
    public static final <XDtField:fieldType/> <XDtField:fieldName/> =
<XDtField:fieldTagValue tagName="franks.constant"/>;
</XDtField:ifHasFieldTag>
</XDtField:forAllFields>

Of course, since you're having to include the value in the tag anyway,
then unless you also need to have the field in your bean class for some
reason you could always generate the whole lot from class-level tags:

<XDtClass:forAllClassTags tagName="franks.constant">
    /** <XDtClass:classTagValue tagName="franks.constant"
paramName="comment"/> */
    public static final <XDtClass:classTagValue
tagName="franks.constant" paramName="type"/> <XDtClass:classTagValue
tagName="franks.constant" paramName="name"/> = <XDtClass:classTagValue
tagName="franks.constant" paramName="value"/>;
<XDtClass:forAllClassTags/>

Watch out for the quotes if you're using strings...


Andrew.



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to