ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: DynamicConfigurator passing fully qualified class name
Date Thu, 22 Aug 2002 10:21:38 GMT

Shackelford, John-Mason wrote:
> Erik,
>>I'm confused by what you are asking here.  FQN of what exactly?  The 
>>class that is implementing the DynamicConfigurator interface (you have 
>>that already)?
> Sorry to be unclear.
> All I was suggesting is that IntrospectionHelper.createElement could check
> to see of the tag is already associated with a class via <typedef> or
> <taskdef> and, if so, pass in a FQN to
> DynamicConfigurator.createDynamicElement(String name) since that will reduce
> ambiguity. 

Ah, I see.  But again at least Dominique and I feel this is a hack to 
use a DataType for your purposes, but its not what I'd really recommend.

> On second thought, perhaps it would be better to have a signature
> DynamicConfigurator.createDynamicElement(ProjectComponent pc)and pass in an
> instantiated ProjectComponent when we can do so instead of calling the
> signature that takes a String. 

Its atypical, I think, to have dynamic elements correspond to datatypes 
in this manner, and even if you wanted it that way, the lookup is easily 
done as you have done, internal to your own code.

> I suggest this because it seems to me that instantiate a Task or DataType in
> createDynamicElement(String name) will be done so frequently that it should
> be "pulled up" into IntrospectionHelper.

I disagree with the frequency of this use, actually.  Its probably more 
likely that if you wanted dynamic elements to correspond to datatypes, 
that they'd probably all correspond to the same datatype.  A contrived 
example: suppose <war> were enhanced to support DynamicConfigurator such 
that any unrecognized element was mapped to a FileSet by createElement 
and it returned a FileSet and used the element name as the directory 
name of where to place the files inside the WAR.  Internally only a 
FileSet is returned.

So, you should stick to doing it the way you are doing it by doing the 
datatype mapping lookup yourself, or find another mapping mechanism. 
Either way, you're doing cool stuff!  :)


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message