From: <[EMAIL PROTECTED]>
> 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. > Once <antlib> makes its way in, <filterreader> will become extinct, ok? > > > 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. > cool :-) > > > > 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 first form is not needed currently. FilterChain recognizes elements added using <striplinecomments>. However, not all filterreaders that are created by users will be recognized by FilterChain. For such filterreaders, user would use <filterreader> (or <antlib> when available) syntax. The first form is just an _example_ to illustrate that striplinecomments, though it has a convenient form, is a generic filterreader just like the user's. The first form does follow ant patterns - checkout <mapper>. > 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. As I said, I am not opposing getting this solved in a generic way. The element <filterreader> inside <filterchain> is being used just to get around Ant's current limitations, just like <mapper>, etc. > > > 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. Are you against the proposal being put into the main trunk _before_ <antlib> gets there? > > Costin > Cheers, Magesh ************************************************* * Committee: Individuals who can do nothing * * individually and sit to decide that nothing * * can be done together. * ************************************************* -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
