Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 44907 invoked from network); 12 Feb 2007 12:22:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2007 12:22:30 -0000 Received: (qmail 4734 invoked by uid 500); 12 Feb 2007 12:22:37 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 4674 invoked by uid 500); 12 Feb 2007 12:22:37 -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 4663 invoked by uid 99); 12 Feb 2007 12:22:37 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2007 04:22:37 -0800 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Feb 2007 04:22:26 -0800 Received: from z011100.bk.fin.local (z011100.bk.fin.local [172.18.101.140]) by dnsinet.rzf-nrw.de (8.13.8/8.13.8) with ESMTP id l1CCM1RX001989 for ; Mon, 12 Feb 2007 13:22:01 +0100 Received: from z011134.bk.fin.local ([130.11.7.134]) by z011100.bk.fin.local with Microsoft SMTPSVC(6.0.3790.0); Mon, 12 Feb 2007 13:22:03 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: AW: Playing with annotations for Ant - Sandboxable or not? Date: Mon, 12 Feb 2007 13:22:03 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Playing with annotations for Ant - Sandboxable or not? Thread-Index: AcdOnOtjooGBg5IlS/OJcOH6OnwGkwAAMubw From: To: X-OriginalArrivalTime: 12 Feb 2007 12:22:03.0391 (UTC) FILETIME=[670BD0F0:01C74EA0] X-Virus-Checked: Checked by ClamAV on apache.org >I had an idea to try out using annotations in Ant - starting with a >simple @Validation for fields. > >I know this can't be put in trunk for bwc reasons, but is it the sort >of thing that should be considered for the sandbox? Annotations could make life easier, indeed. Maybe via a Java5Helper? @Task class MyFooTask { @Attribute @Validate String foo; @Element @Validate(min=3D2) List resources; public void execute(); // via normal TaskAdapter Project p; // via normal TaskAdapter } Java5Helper { List findTasks(Classpath); } @Task's attributes name - name of the task (taskdef), defaults to the classname in lowercase=20 with out a "task" at the end. Here: "myfoo" =20 @Attribute's attributes name - name of the attribute to use in the xml description. Defaults to the=20 field name. Here: @Element's attributes name - name of the nested elements. Defaults to the standard name of the field type. Here: @Validate's attributes class - delegation to a custom validation class regexp - string representation must match a given regexp required=20 min|max - minimum and maximum size of a list ... More ideas (and maybe implementations) could come from binding frameworks (think about binding of a GUI field to a business class (converter classes, ...)) The supporting classes could be in the Java5-conditional directory org\apache\tools\ant\util\java15. In that way new tasks could use these features (like the Enum's at the moment) without loosing 1.2-compatibility. Jan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org