ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shackelford, John-Mason" <>
Subject polymorphic data types as nested elements
Date Wed, 21 Aug 2002 18:11:37 GMT
Greetings all,

Having combed through Hatcher & Loughran's chapter on writing custom tasks
(very good BTW),
I am still a bit perplexed as to how ant resolves addXXX calls against
nested tags. What is not clear to me is how the XXX portion is used in
conjunction with the argument type.

I have a task which is responsible for processing commands. I define an
abstract class which extends DataType and then subclass it for various
commands: Get, GenericCommand, etc. The addXXX method on my command
processing task can then take an AbstractCommand object to work its magic. 

If I write the addXXX signature as: addAbstractCommand(AbstractCommand c),
will the nested command objects be properly populated even if they contain
getters and setters which are not overriden from AbstractCommand? Do I need
to add multiple addXXX signatures: AddGet(AbstractCommand c),
AddGenericCommand(AbstractCommand c). (This seems completely backwards). In
short, what is the cash value of the XXX portion of addXXX if we can
determine type info from the argument?

Probably I am missing something basic. Forgive me.

John-Mason Shackelford

Software Developer
NCS Pearson - Measurement Services
2510 North Dodge St.
Iowa City, IA 52245

This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 

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

View raw message