I have also found an other approach: use a task that looks like a type. I add an id attribute, and the execute method of the task can do the validation, have a location, can add the properties he want to add, and just have to add himself as a reference into the project.
By the way, when you class extends Task, is there a difference to declare it in the antlib xml as a task or as datatype ? Gilles > -----Original Message----- > From: Steve Loughran [mailto:[EMAIL PROTECTED] > Sent: lundi 26 mars 2007 14:37 > To: Ant Users List > Subject: Re: DataType life cycle > > Gilles Scokart wrote: > > What is the life cycle of a datatype? > > > > More precisely, I'm writting a dataype and I would like: > > > > 1. To be able to validate its attribute and content as soon as > > possible (and if possible report the Location of the error) > > 2. To launch some process to modify the Project as soon as the > > datatype is defined (actually, I want to add some properties in it). > > > > Currently, I validate the content only when the datatype is used by a > > task (and I can't report the location). And I have overwritten the > > setProject for the second point. > > > > Is it the best aproach? > > > > Thanks, > > > > This is something we were discussing on [EMAIL PROTECTED] last week. Right now > there is no lifecycle; no methods called after configuration is complete > yet before first use. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]