ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: AW: PropertySet.iterator()
Date Thu, 21 Apr 2005 08:57:19 GMT
or


public class Something
#ifdef JAVA15
	implements Iterable, Closeable
#endif

-and we pump all the source through m5 , velocity, whatever.

just a thought :)


Jan.Materne@rzf.fin-nrw.de wrote:
> 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: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> Gesendet am: Donnerstag, 21. April 2005 07:58
> An: dev@ant.apache.org
> 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:DDevienne@lgc.com] 
>>Gesendet am: Donnerstag, 21. April 2005 00:05 
>>An: Ant Developers List 
>>Betreff: RE: PropertySet.iterator() 
>>
>>
>>>From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
>>>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: dev-unsubscribe@ant.apache.org 
>>For additional commands, e-mail: dev-help@ant.apache.org 
>>
> 
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message