You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by jl...@household.com on 2002/08/06 22:37:29 UTC

Creating custom data container rather than task for use as nested element in a custom task

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Creating custom data container rather than task for use as nested element in a custom task

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 6 Aug 2002, <jl...@household.com> wrote:
> What should I read to learn how to make a simple data container for
> a nested element of a task?

<http://jakarta.apache.org/ant/manual/develop.html#nested-elements>

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Creating custom data container rather than task for use as nested element in a custom task

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>