Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 8943 invoked from network); 9 Jun 2005 14:37:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Jun 2005 14:37:05 -0000 Received: (qmail 57040 invoked by uid 500); 9 Jun 2005 14:36:43 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 56976 invoked by uid 500); 9 Jun 2005 14:36:42 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 56936 invoked by uid 99); 9 Jun 2005 14:36:42 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from gate.corvil.net (HELO corvil.com) (213.94.219.177) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 09 Jun 2005 07:36:40 -0700 Received: from [172.18.1.171] (angel.local.corvil.com [172.18.1.171]) by corvil.com (8.13.3/8.13.3) with ESMTP id j59EaQ3J047773 for ; Thu, 9 Jun 2005 15:36:26 +0100 (IST) (envelope-from peterreilly@apache.org) Message-ID: <42A855A2.7070402@apache.org> Date: Thu, 09 Jun 2005 15:43:46 +0100 From: Peter Reilly User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ant Users List Subject: Re: What is the difference between a nested element and a nested type? References: <7881d2f2050609023221657430@mail.gmail.com> <3819.1118324518@www73.gmx.net> In-Reply-To: <3819.1118324518@www73.gmx.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Antoine Levy-Lambert wrote: >>--- Urspr�ngliche Nachricht --- >>Von: Eric Tchepannou >>An: user@ant.apache.org >>Betreff: Re: What is the difference between a nested element and a nested >>type? >>Datum: Thu, 9 Jun 2005 10:32:51 +0100 >> >>Thanks a lot for that Antoine. That was very clear to me. >>I was able to check at >>http://www.oracle.com/technology/pub/articles/bodewig_taskwriters.html >>and I think the correct syntax (at least the one used there) to nest >>types is >>public void addSomething(BaseType t); >> >> >this one means : > - map to instantiating BaseType > - and creates the BaseType from the nested element > > >>I have been using >>public void add(BaseType); >>and experience problems with this syntax. I will later rewrite my code >>accordingly and see how it behaves. >> >>My guess is that public void add(BaseType) is obsolete. I use 1.6.2. I >>am just wondering why the Ant documentation keeps mentioning this... >> >> >> >No, it is not obsolete, but it will only work if you are mapping BaseType to >an XML tag name such as using the task before. > > And one can used types that derive from the base type as follows (continuing my previous example): ----- Derived.java ---- package my; public class Derived extends Type { } ----- build.xml ----- ... ... However this may be not what you want to do. One can just use nested elements discoved by reflection as Antonie has shown above. ---- Reflect.java -- package my; public class Reflect extends org.apache.tools.ant.Task { public void addBase(Type p) { } public void addDerived(Derived p) { } } ---- build.xml --- .. .. Peter > > >>Eric >> >> >> >Antoine > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org