On Thu, 28 Feb 2002, Magesh Umasankar wrote: > > Not if you first declare "striplinecomments" as a type, using > > a typedef declaration ( or antlib ). > > > > How will I be able to extend from java.ioFilterReader > as well as DataType at the same time?
You don't have to - again, TaskAdapter ( or RoleAdapter in <antlib> proposal ) will do the magic. ( well, you need a TypeAdapter equivalent with TaskAdapter ). I'm working on a generic solution based on RoleAdapter and TaskFactory, but even if this is not accepted, RoleAdapter in antlib or a trivial cut&paste from TaskAdapter will solve this - not only for FilterReader but for anything else. Plugging a bean into ant shouldn't require extending DataType or Task - just by implementing the ant patterns and letting ant do the adaptation. > Also, note one of my aims was to be able to write > a pluggable filterreader that has been created > without making use of any of Ant's APIs... I don't > know how _important_ it is for this rule to > stay, but if it stays, it will be more convenient... Yes, this is very _important_ for me too. > > The class would have to follow ant's patterns - i.e. have > > addComment(), etc - like a task ( or a TaskAdapter-ed task ) > > would. > > It already does so that it can be used > in short form notation too. That is, > <filterreader classname="org.apache.tools.ant.filters.StripLineComments"> > ... > </filterreader> > can also be written as > <striplinecomments> > ... > </striplinecomments> Why do you need the first form ? It's ugly, doesn't follow the ant patterns, etc. We don't have <task classname="..." >. The real problem is that you don't have enough power in <typedef> and TypeAdapter - but it's better to solve the real problem instead of doing a workaround. > There are enough proposals already ;-) > I will just wait till something surfaces > and I will use it. Till then, look at > <filterreader> as another motivation > for <antlib> ;-) I would reverse it - look at my comments on filterreader as a motivation for you to get involved in <antlib> or just the adapter part. Costin -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
