From: "Steve Loughran" <[EMAIL PROTECTED]> > > > > <loadfile property="t" srcFile="d:\temp\build4.xml"> > > <filterreaderset> > > <filterrdr > > classname="org.apache.tools.ant.filters.ZapCommentsFilterReader"/> > > <filterrdr > > classname="org.apache.tools.ant.filters.StripLineBreaksFilterReader"/> > > </filterreaderset> > > </loadfile> > > > > slick > > I'd request that there is a filterreader interface that they are all derived > of,
The Ant filters have to extend java.io.FilterReader and implement the interface org.apache.tools.ant.type.Configurable which will have the method setParameters(Properties); > and that that if you spec a short name 'ZapLineCommentsFilterReader' > then there is no need to give the full path. ok. How do you want that done? > I actually did the first pass of the crlf filter as a StreamReader, but it > didnt work, there were nulls appearing at the end of the string, one for > every char stripped. So I went to a string to string postprocessor instead. I guess you are not setting/using the return value of read(char[]). It is supposed to provide the number of characters actually read. If you go by the array size, that might be a bad idea. > > One issue: how do you pass parameters to the filters. Something like a strip > line breaks filter needs to know the char to replace it by; the comment > filter needs them too. Perhaps a > <param name value> pair is needed there. > I was debating within myself to decide if it is the responsibility of the Ant engine to provide such plugs or if it is the responsibility of the FilterReader to read the configuration parameters from, say, a properties file. But, since, you seem to prefer that Ant provide mechanisms, I will do so. Cheers, Magesh ************************************************************* * Optimist: A person who while falling from the * * Eiffel tower says in midway "See I am not injured yet." * ************************************************************* -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
