Magesh,
Sorry to miss the great org/apache/tools/ant/filters package. It is a good
job!

For my needs, I have 2 questions:
1) I need to comment out my token, otherwise the compilation fails. And I
have to compile before the replacement to use the serialver program. If I am
using ReplaceTokens, the comment characters are not replaced. Example:

import java.io.Serializable;
public class Test implements Serializable {
    //@serialVersionUID@    // Serial Version UID
    
    public Test(){
        
    }
}
the result should be: 
import java.io.Serializable;
public class Test implements Serializable {
    private static final long serialVersionUID = 2010307013874058143L;    //
Serial Version UID
    
    public Test(){
        
    }
}

A solution could be to define the "beginToken" to "//@". But this requires
to change the definition of setBeginToken(char beginToken) to accept a
String instead of a Char. Moreover, the number of spaces between "//" and
the first "@" should be fixed. It is a small detail, not a big deal.

2) The second point is about the token value. I do not know the token value
until I find the token key in the file. I run the serialver program on a
class when I read the token in the source file. It is not a good idea to run
serialver before to parse the source file because this program fails when it
is not a Serializable class. It means it will be difficult to see the
difference between an user error (when there is a token in a bad file), and
the normal reject. And I also prefer to print in the ANT output the SUID
(serialver task) only when a file is tagged with this token, and not for all
the serializable files.

I probably need to extend BaseFilterReader and create my own filterreader.
Is that make sense?

Thank you for any suggestions,
Stephane.


----- Original Message -----
From: "Stephane Chauvin" <[EMAIL PROTECTED]>


> Hi,
> Since the last time, I did the following modifications:
>
> >IMO, the replacesuid is best represented as a
> >filterreader.
>
> I renamed replacesuid to suidfilter. I would like to keep "suid".

Sorry, I guess I wasn't as clear as I would have
liked to be earlier.  What I meant by 'best represented
as a Filterreader' was not actually a renaming
of the class, but implementing replacesuid as
a FilterReader which is a newly introduced feature
in Ant 1.5Alpha.  Look at the files under
org/apache/tools/ant/filters directory for
examples...

>
> >I would be happier with something which generated a new copy of the >file
> in a destination directory
>
> Done, I added the destdir attribute. If it is not used, the original file
is
> replaced.
>
> I hope that this task will help developers who are using the serializable
> objects and especially the serialver program. I created these tasks and am
> using them, since I read this Java functionality in the "Developing JAVA
> Beans (O'Reilly)" book.
> All comments are welcome.
>
> Stephane
>

Cheers,
Magesh



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to