You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Conor MacNeill <co...@cortexebusiness.com.au> on 2003/12/30 16:12:01 UTC

RE: about DynamicConfigurator - addFoo ( Foo foo ) invoked if Foo is a DynamicConfigurator?

> From: Maciek Zywno [mailto:zywno@stud.ics.p.lodz.pl]
> Subject: about DynamicConfigurator - addFoo ( Foo foo ) invoked if Foo
> is a DynamicConfigurator?
>
>
> Let's assume that addFoo ( Foo foo ) is a method of a class(my custom
> task) extending org.apache.tools.ant.Task.
> I would like to know if ant invokes such method only if it comes across
> <foo> in xml file.

Yes

> Do I get it right that this is why DynamicConfigurator is extended , I
> mean Foo is to extend DynamicConfigurator, right?

No. DynamicConfigurator is used when the element to add has no corresponding
method in your task. IOW, you want to support a <foo> element but you do not
have addFoo() or createFoo() methods in your task. For most tasks you do not
need to use DynamicConfigurator.

Conor




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: about DynamicConfigurator - addFoo ( Foo foo ) invoked if Foo is a DynamicConfigurator?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 30, 2003, at 6:28 PM, Maciek Zywno wrote:
> So one more question: why would one have Foo class extend 
> DynamicConfigurator if there is already method add/createFoo( Foo foo 
> ) in custom task?

So that it could also take <bar> :))

DynamicConfigurator is for tasks that are more "dynamic" - they do not 
have a rigid set of sub-elements or attributes that they support.  A 
task (oh, say XDoclet, for example) can be made for pluggability.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: about DynamicConfigurator - addFoo ( Foo foo ) invoked if Foo is a DynamicConfigurator?

Posted by Maciek Zywno <zy...@toya.net.pl>.
Conor MacNeill wrote:

>>From: Maciek Zywno [mailto:zywno@stud.ics.p.lodz.pl]
>>Subject: about DynamicConfigurator - addFoo ( Foo foo ) invoked if Foo
>>is a DynamicConfigurator?
>>
>>
>>Let's assume that addFoo ( Foo foo ) is a method of a class(my custom
>>task) extending org.apache.tools.ant.Task.
>>I would like to know if ant invokes such method only if it comes across
>><foo> in xml file.
>>    
>>
>
>Yes
>
>  
>
>>Do I get it right that this is why DynamicConfigurator is extended , I
>>mean Foo is to extend DynamicConfigurator, right?
>>    
>>
>
>No. DynamicConfigurator is used when the element to add has no corresponding
>method in your task. IOW, you want to support a <foo> element but you do not
>have addFoo() or createFoo() methods in your task. For most tasks you do not
>need to use DynamicConfigurator.
>
>Conor
>  
>
So one more question: why would one have Foo class extend 
DynamicConfigurator if there is already method add/createFoo( Foo foo ) 
in custom task?

Regards

Maciek


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org