on 5/10/01 3:22 PM, "Daniel F. Savarese" <[EMAIL PROTECTED]> wrote:
> And if you do, what approach do you recommend instead of
> a preprocessor?
Problem:
Need code to work with JDK 1.1 and JDK 1.2 with regards to the
Collections API (sound familiar?).
Point of overlap:
To use the Collections API as a separate .jar file, you need to slightly
modify the imports.
Solution:
Write your .java code using the latest API's (ie: Java2). Use Ant's
<replace> tag to find/replace the imports relating to the Collection's
API and then conditionally include the collections.jar file depending on
what JDK you are using.
I did this at one point with WebMacro and it worked without any problems and
was very clean. It also allowed the author to continue to code to the latest
API's while still maintaining full backwards compatibility.
Here is a copy of the .jar:
http://cvs.jdom.org/cgi-bin/viewcvs.cgi/jdom/lib/collections.jar?sortby=date
-jon
--
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>