custom XDoclet template or task

M

mark rambow

Hello,

I try to write a custom XDoclet template, that generates interfaces for
my classes (No EJBs).
Sounds simple, but how can I change the Name of the sourcefile?

I want generate from FooImpl.java a FooInterface.java or similar. But
until now I can just append something to FooImpl for example:
FooImplInterface, but thats not my favorite style for classnames :)


AntTask:
<target name="interfaces" depends="generate">
<xdoclet destdir="${generate.dir}">
<fileset dir="${src.dir}" includes="**/*.java" />
<template templateFile="test.xdt"
destinationfile="{0}Interface.java"
acceptinterfaces="false"/>
</xdoclet>
</target>

The template:
/**
* <XDtI18n:getString resource="do_not_edit"/>
*/
package <XDtPackage:packageName />;

public interface <XDtClass:className />{
<XDtMethod:forAllMethods>
<XDtMethod:methodType/>
<XDtMethod:methodName/>(<XDtParameter:parameterList/>);
</XDtMethod:forAllMethods>
}



Thanks in advance for any suggestions.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top