Ok - inlined ...

Jan


build.xml 
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----
<project default="compile">

  <available property="onJDK15" classname="java.lang.Iterable"/>
  <echo>onJDK15: ${onJDK15}</echo>


  <target name="jdk15.1" if="onJDK15">
      <echo>Using Java 5 stuff</echo>
      <replace dir="src" token="/*JDK5-backport*/" value="extends
java.lang.Iterable"/>
  </target>
  <target name="jdk15.2" unless="onJDK15">
      <echo>Hiding Java 5 stuff</echo>
      <replace dir="src" token="extends java.lang.Iterable"
value="/*JDK5-backport*/"/>
  </target>

  <target name="compile" depends="jdk15.1,jdk15.2">
    <delete dir="classes"/>
    <mkdir dir="classes"/>
    <javac srcdir="src" destdir="classes"/>
  </target>


</project>
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----


src\oata\Iterable.java 
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----
package oata;

import java.util.Iterator;

public interface Iterable /*JDK5-backport*/ {
    public Iterator iterator();
}
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----


src\oata\MyClass.java 
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----
package oata;

import java.util.Iterator;

public class MyClass implements Iterable {
    public Iterator iterator() { 
        return null; 
    }
}
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<
----


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Gesendet am: Donnerstag, 21. April 2005 07:58
An: [EMAIL PROTECTED]
Betreff: AW: PropertySet.iterator()

I had a project where a code generator inserts one interface statement - and
that 
what missing. So I created just an empty interface to make the compiler
happy. Couldnt 
we "backport" the Iterable interface? 
I played a little with these... 
- build.xml 
- src\oata\Iterable.java 
- src\oata\MyClass.java 


Jan 
> -----Ursprüngliche Nachricht----- 
> Von: Dominique Devienne [mailto:[EMAIL PROTECTED] 
> Gesendet am: Donnerstag, 21. April 2005 00:05 
> An: Ant Developers List 
> Betreff: RE: PropertySet.iterator() 
> 
> > From: Matt Benson [mailto:[EMAIL PROTECTED] 
> > I will take your opinion as gospel, since you are the 
> > father of PropertySet, and since you agree with me ;) 
> 
> Note that I can't think of any use case for iterating 
> over the property names selected by a propertyset, but 
> I'm sure someone somewhere sometime will find one ;-) --DD 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED] 
> 
 

Reply via email to