I've got further questions on this. I'm currently modifying the XmlTask (http://www.oopsconsultancy.com/software/xmltask.html) I found on the External Tools and Tasks page.
I'd like to make a decision in the addXXXX task based on the attributes of XXXX. I'd hoped that when Ant instantiated the object, it would call the object's setter methods to get those attributes, but it appears that those attributes aren't set until Ant configures the object. Am I correct? When will Ant configure the object? When the parent element's execute method is called? Kyle >>> [EMAIL PROTECTED] 06/03/02 08:20AM >>> Laval Chung wrote: > For subtask we either create or add? > What's the difference and when to use which? > > Cheers > laval > When you use addXXX, Ant will instantiate the object, pass it to the add method and then configure it. For Ant to be able to instantiate the class it must support a Zero Argument Constructor (ZAC). When you use createXXX, Ant will call createXXX and your task must create the sub-object and return it to Ant which will then configure it. As such your task can create the sub-object with whatever means available. BTW, the above is the simple explanation :-). In general, the preference nowadays is to use addXXX methods. These are more extensible since Ant can provide a subclass of the class required by the addXXX methods. That isn't much of an issue today but in the future such behaviour is envisaged. Also, it is not strictly a sub-task - more a sub-element. Conor -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
