Sorry for the basic question. I just started with xdoclet.

 

I am trying to read some source java classes and generate some additional classes based on them. If the source classes contain the package definition,

It seems that the xdoclet is not able to parse it and does not apply my template.

 

For instance, in the class below, if I uncomment the package element the xdoclet is does not apply the template I have defined.

 

    <property name="xdoclet.lib.dir" location="${xdoclet.home}"/>

    <path id="xdoclet.lib.path">

        <fileset dir="${xdoclet.lib.dir}" includes="*.jar"/>

    </path>

 

    <taskdef name="xdoclet"

        classname="xdoclet.DocletTask"

        classpathref="xdoclet.lib.path"/>

 

    <target name="boa-gen">

        <property name="boa-dir" location="openharbor/boa"/>

        <xdoclet verbose="true" force="true"

            destDir="src/generated/ openharbor/boa">

            <fileset dir="${boa-dir}">

                <include name="*.java"/>

            </fileset>

            <template templateFile="WrapperClasses/Templates/theBClass.xdt"

                      destinationFile="{0}_B.java"

                      />

        </xdoclet>

    </target>

 

*** theBClass.xdt ***

 

package <XDtPackage:packageName/>;

 

 public class <XDtClass:className />_B {

 

    public <XDtClass:className /> ()

    {

    }

}

 

*** The class ***

 

//package openharbor.boa;

 

import openharbor.wrapper.enumerations.AliasType;

import openharbor.boa.base.BoaChild;

 

/**

 * Alias wrapper class

 *

 * @boa.localization

 */

public class Alias extends BoaChild {

 

    /**

     * Returns the AliasType for this Alias.

     * AliasType is an enumeration.

     */

    public AliasType getType() {

        return type;

    }

 

    /**

     * Sets the AliasType for this Alias.

     * AliasType is an enumeration.

     */

    public void setType(AliasType type) {

        this.type = type;

    }

 

    /**

     * Returns the value represented by this  object.

     */

    public String getValue() {

        return value;

    }

 

 

    /**

     * Sets the value represented by this party.

     */

    public void setValue(String newValue) {

        value = newValue;

    }

 

    private String value = null;

    private AliasType type  = null;

 

}

 

 

Reply via email to