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 17:03:44 GMT
On 8/22/07, Matt Benson <gudnabrsam@yahoo.com> wrote:
>
> --- Peter Reilly <peter.kitt.reilly@gmail.com> wrote:
>
> > On 8/22/07, Matt Benson <gudnabrsam@yahoo.com>
> > wrote:
>
> [SNIP]
> > > though I'd still like an opinion on the proxy
> > > mechanism I suggested for delegate recursion...
> > :)
> >
> > I did not reply because I did not understand the
> > proposal :-)
> >
> [SNIP]
>
> Okay--when a PH calls a delegate it passes itself down
> in case the delegate needs to make calls against the
> PH.  This would imply a sort of property decorator
> pattern.  Anyway, I think in this case a delegate
> calling PH.get() might need to be able to discern the
> difference between NullReturn and no-such-property
> null.  The first thing that occurred to me was that
> the PH could pass the delegate not itself, but a sort
> of proxy to itself that would fail to decode
> NullResult but instead return it to the delegate
> unharmed so that the delegate could handle the
> difference between them.  Since this would need to be
> passed down over and over again I thought it could
> live as a member of each PropertyHelper instance.

I think that I sort of follow, however I do not think that
it can be a member of the PH instance since PH needs
to be ThreadSafe.

My idea was that the nullreturn was a message to PH (i.e.
end the chain) and not to the PH delegates.

Perhaps a new method PH.evalulateProperty(project, name) (like
PH.getProperty(project, name),
   could return a PHResultObject -
   the tostring of which would be the current stringy form - ie
   ${xx} (a delegate could change this to a "null" and the getObject()
   would return null or the object
   if present. setX(String, File etc) would be called with the
   toString() method and setX(Object) would be called with the
   getObject() method.

  If a delegate can resolve a property, it can return a PHResultObject
  if it wants to do something like handing nulls.


Peter


>
> Does that make sense?
>
> -Matt
>
>
>
> ____________________________________________________________________________________
> 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