On 8/21/07, Matt Benson <[EMAIL PROTECTED]> wrote: > > --- [EMAIL PROTECTED] wrote: > > > Author: peterreilly > > Date: Tue Aug 21 05:26:21 2007 > > New Revision: 568096 > > > > URL: > > http://svn.apache.org/viewvc?rev=568096&view=rev > > Log: > > Allow reflection on setX(Object x) to be an xml > > attribute > > Normally x will be of String type, however with the > > new > > PropertyHelper, x may be of other types. > > x="${el:path.main}" for example. > > > > > > Peter--I must be having an idiotic moment. Can you > explain this one? :)
I am playing around the jexl - it is pretty neat. It is easy to integrate with the new PropertyHelper ;-) My test code does something like this: <propertyhelper> <j:jexl/> </propertyhelper> <path id="main.path"> <fileset dir="lib" includes="*.jar"/> </path> <j:for param="item" items="${el:main.path}"> <echo>item is @{item}</echo> </j:for> Peter > > -Matt > > (Not so brilliant now, am I?) > > > Modified: > > > > > ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java > > > > Modified: > > > ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java > > URL: > > > http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java?rev=568096&r1=568095&r2=568096&view=diff > > > ============================================================================== > > --- > > > ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java > > (original) > > +++ > > > ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java > > Tue Aug 21 05:26:21 2007 > > @@ -943,6 +943,17 @@ > > final Class reflectedArg = > > PRIMITIVE_TYPE_MAP.containsKey(arg) > > ? (Class) PRIMITIVE_TYPE_MAP.get(arg) : > > arg; > > > > + // Object.class - it gets handled > > differently by AttributeSetter > > + if (java.lang.Object.class == reflectedArg) > > { > > + return new AttributeSetter(m, arg) { > > + public void set(Project p, Object > > parent, String value) > > + throws > > InvocationTargetException, > > + IllegalAccessException { > > + throw new BuildException( > > + "Internal ant problem - > > this should not get called"); > > + } > > + }; > > + } > > // simplest case - setAttribute expects > > String > > if > > (java.lang.String.class.equals(reflectedArg)) { > > return new AttributeSetter(m, arg) { > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > ____________________________________________________________________________________ > Got a little couch potato? > Check out fun summer activities for kids. > http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]