custom XDoclet template or task

Discussion in 'Java' started by mark rambow, Sep 8, 2004.

  1. mark rambow

    mark rambow Guest

    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
     
    mark rambow, Sep 8, 2004
    #1
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor
    Replies:
    0
    Views:
    9,289
    Victor
    Sep 1, 2004
  2. Replies:
    0
    Views:
    432
  3. Greg
    Replies:
    0
    Views:
    755
  4. krabhi
    Replies:
    1
    Views:
    9,954
    Marco Meschieri
    Aug 9, 2006
  5. teggy
    Replies:
    0
    Views:
    983
    teggy
    May 29, 2007
  6. Mike
    Replies:
    1
    Views:
    2,177
    GArlington
    May 12, 2008
  7. Stéphane Wirtel
    Replies:
    3
    Views:
    572
    Stephane Wirtel
    Jun 15, 2007
  8. Ingo Weiss
    Replies:
    0
    Views:
    204
    Ingo Weiss
    Mar 1, 2010
Loading...