What can you do in the ant Task.init() method?

Posted by skiphoppy on Stack Overflow See other posts from Stack Overflow or by skiphoppy
Published on 2010-02-17T16:46:04Z Indexed on 2010/05/24 12:41 UTC
Read the original article Hit count: 195

Filed under:
|
|

I'm developing a few custom ant tasks that all need to initialize the same objects. I wanted to initialize those object's in a common superclass that extends from Task, in the init() method. But I see from the lifecycle of an ant task that init() gets called before the tasks child elements and attributes are set. So all of the data I need for initializing those objects is unavailable during init(), if I am reading right.

So, why is init() called at this point? What do you even know that you could use in init()? What could it be used for?

(And is there some other method that I can rely on to be called before execute(), but after my data is available?)

© Stack Overflow or respective owner

Related posts about java

Related posts about design