Looking at the XDoclet code, I see this:
public Object createDynamicElement(String name) throws BuildException
{
if (!isModulesRegistered) {
registerModules();
isModulesRegistered = true;
}
SubTask subTask = (SubTask) getSubtaskMap().get(name);
if (subTask == null) {
throw new BuildException(...);
}
subTasks.add(subTask);
return subTask;
}
This seems to imply that a new instance of a subtask is not
returned for each call to createDynamicElement(), but instead
a single instance (pulled from a map), is returned.
Is this the required behavior? I can see why THAT code being
called twice would "do no harm". However, my code (currently)
roughly looks like:
public Object createDynamicElement(String name) throws BuildException
{
if ("junit".equals(name)) {
return new JUnitTask();
}
}
Which if called twice, of course, results in two JUnitTask objects
being created.
-brett
-----Original Message-----
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 20, 2003 12:52 PM
To: Ant Developers List
Subject: Re: Dynamic Configurator
<snip>
The latest XDoclet code uses it, and I've used it for my Lucene <index>
task and other example tasks for the book, but never to the level
you're trying it. Perhaps the XDoclet implementation of it can help?
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]