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: r568511 - /ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
Date Wed, 22 Aug 2007 15:22:31 GMT
Things do get complicated when delegates need
to re-call PH.
The nullobject I put in is needed for the local property
delegate - it has seen a property name in its stack
of properties, but the property has not yet been set,
the property name should not pass down to the
the other property resolvers - it has been resolved!

There is a similar issue with the el: delegate, but
the behavior may need to be a bit different
"${el:project.targets.get('not-present')}" should resolve to
  "null" rather than "${el:project.targets.get('not-present')}".
- the string "null" cannot be used, it actually needs to be
an null object (when given to setAttribute(Object val))

Peter




On 8/22/07, Matt Benson <gudnabrsam@yahoo.com> wrote:
> I had looked into something like this, but what about
> the case when a delegate needs to re-call PH?  The
> delegate in question would need the NullReturn object
> (should we refactor this to be just a PSF Object on
> PropertyHelper?).  Maybe we can have a PropertyHelper
> store a proxy to itself, that does not decode
> NullReturn, and it is _this_ proxy that is passed to
> the delegates instead of the _real_ PH.  WDYT?
>
> -Matt
>
> --- peterreilly@apache.org wrote:
>
> > Author: peterreilly
> > Date: Wed Aug 22 01:42:11 2007
> > New Revision: 568511
> >
> > URL:
> > http://svn.apache.org/viewvc?rev=568511&view=rev
> > Log:
> > allow a propertyevalulator to signal that it 'owns'
> > the property, but the property is not set
> >
> > Modified:
> >
> >
> ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
> >
> > Modified:
> >
> ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
> > URL:
> >
> http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java?rev=568511&r1=568510&r2=568511&view=diff
> >
> ==============================================================================
> > ---
> >
> ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
> > (original)
> > +++
> >
> ant/core/trunk/src/main/org/apache/tools/ant/PropertyHelper.java
> > Wed Aug 22 01:42:11 2007
> > @@ -28,6 +28,8 @@
> >  import java.util.Vector;
> >  import java.util.Enumeration;
> >
> > +import org.apache.tools.ant.property.NullReturn;
> > +
> >  /* ISSUES:
> >   - ns param. It could be used to provide
> > "namespaces" for properties, which
> >   may be more flexible.
> > @@ -784,6 +786,9 @@
> >          for (Iterator iter =
> > getDelegates(PropertyEvaluator.class).iterator();
> > iter.hasNext();) {
> >              Object o = ((PropertyEvaluator)
> > iter.next()).evaluate(name, this);
> >              if (o != null) {
> > +                if (o instanceof NullReturn) {
> > +                    return null;
> > +                }
> >                  return o;
> >              }
> >          }
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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