ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Creating custom data container rather than task for use as nested element in a custom task
Date Wed, 07 Aug 2002 01:46:47 GMT
You don't need execute methods on nested elements - they do not get 
implicitly "executed" by Ant. There are three special methods that are 
used to add support for nested elements to a task: createXXX, addXXX, 
and addConfiguredXXX - each has a slightly different purpose.  For now, 
implement a:

public void addDataContainerA (SomeObject obj) { }

method, where SomeObject is some custom class of yours that has setters 
for attrib1 and attrib2.

If you need to get even fancier with things, I suggest a very fine book 
on the subject: Java Development with Ant -  :))

In chapter 19 of our book, writing custom tasks is covered in great gory 
detail.  I hate sounding like a salesman, but its a work I'm very proud 
of and it does answer a lot of very typical real-world questions on 
using and customizing Ant.

	Erik wrote:
> What should I read to learn how to make a simple data container for a
> nested element of a task?
> Is this nothing but a typical task with an empty execute method?
> example:
> <customtaskA>
>      <datacontainerA attrib1="bla" attrib2="blaaa"/>
> </customtaskA>
> How do I learn how to make a DataContainerA class?
> James Lee Carpenter
> Software Engineer
> Household Technical Services
> 6602 Convoy Court
> San Diego, CA 92111
> ph: 858-609-2461
> email:
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <>

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

View raw message