ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <jakarta-...@ehatchersolutions.com>
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 - 
http://www.amazon.com/exec/obidos/ASIN/1930110588  :))

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


jlcarpenter@household.com 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: jlcarpenter@household.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message