Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 287 invoked from network); 4 Sep 2009 10:58:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Sep 2009 10:58:16 -0000 Received: (qmail 77829 invoked by uid 500); 4 Sep 2009 10:58:16 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 77741 invoked by uid 500); 4 Sep 2009 10:58:16 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 77731 invoked by uid 99); 4 Sep 2009 10:58:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 10:58:16 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [88.84.128.168] (HELO samaflost.de) (88.84.128.168) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Sep 2009 10:58:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by samaflost.de (Postfix) with ESMTP id 4F67528985EF for ; Fri, 4 Sep 2009 12:57:46 +0200 (CEST) Received: from samaflost.de ([127.0.0.1]) by localhost (v35516.1blu.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BBBntbsN0wd5 for ; Fri, 4 Sep 2009 12:57:38 +0200 (CEST) Received: by samaflost.de (Postfix, from userid 1000) id 32FCC28985FA; Fri, 4 Sep 2009 12:57:38 +0200 (CEST) From: Stefan Bodewig To: dev@ant.apache.org Subject: How about ${fromRefId:some-reference}? X-Draft-From: ("nnfolder:mail.jakarta-ant") Date: Fri, 04 Sep 2009 12:57:38 +0200 Message-ID: <87hbvjrn8d.fsf@v35516.1blu.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Checked: Checked by ClamAV on apache.org Hi, we have a PropertyEvaluator for ${toString:some-id} that looks up an object with id "some-id" in the current project and expands to either null (reference doesn't exist) or the result of calling toString() on the object. With trunk PropertyEvaluators can return non-Strings as values for properties and IntrospectionHelper actually uses this. Say I have public void setFoo(MyComplexType t) as attribute and and a PropertyEvaluator returns an instance of MyComplexType for "property" then IntrospectionHelper will happily pass that instance along (if the attribute setter didn't match the whole old set-from-string logic would be applied to the toString() version of my property). This is most useful for tasks that want to accept Resource as an attribute, all it takes is a property evaluator that returns a Resource instance. For example and . I suggest to add another core PropertyEvaluator that works like the one for toString but doesn't invoke toString() on the reference (but leaves that to IntrospectionHelper if necessary). As usual, I'm unsure about the name of the prefix ${fromRefId:foo} ${ref:foo} ${refid:foo} ${fromReference:foo} ... The ${ref:} and ${refid:} ideas look prettier but are more likely to collide with existing property names. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org