ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: [Q:] Writing a simple Ant task?
Date Wed, 25 Sep 2002 18:57:07 GMT
I would recommend *not* extending from DataType unless you have some 
reusability need for these nested elements and wish to define them 
outside of your task.


Ryan Cuprak wrote:
>  To accomplish this, you need to write a param class that extends DataType,
> has a default constructor and setter/getter methods for the attributes. In
> the mytask (extends Task), you add a method "addParam" which takes your
> param class. 
>  Hopefully that answers your question!
> -Ryan Cuprak
> On 9/25/02 7:51 AM, "David M. Smith" <>
> wrote:
>>I wanted to write a task along the following lines
>><mytask srcfile="" destfile="">
>>      <param find="Key1" replaceWith="Value1"/>
>>      <param find="Key2" replaceWith="Value2"/>
>>      <param find="Keyn" replaceWith="Valuen"/>
>>In reading through the documentation trying to write this task I came
>>across copy and filterset which seem to do exactly what I want.
>>However, I would still like to understand how I would write this task.
>>Looking at the Ant source code, it seems generic enough to be able to
>>handle arbitary nested elements, but what methods must I put on my task
>>class to support this? I am thinking createParam(), setParam() and
>>Do I need to create a ant.types.Param class?
>>Any advice that helps me write this task would be gratefully received.
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message