ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: svn commit: r568096 - /ant/core/trunk/src/main/org/apache/tools/ant/IntrospectionHelper.java
Date Tue, 21 Aug 2007 17:16:19 GMT
On 8/21/07, Matt Benson <gudnabrsam@yahoo.com> wrote:
>
> --- peterreilly@apache.org 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:
> > dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > dev-help@ant.apache.org
> >
> >
>
>
>
>
> ____________________________________________________________________________________
> 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: 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