Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 84787 invoked from network); 18 May 2006 22:14:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 May 2006 22:14:48 -0000 Received: (qmail 67774 invoked by uid 500); 18 May 2006 22:14:43 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 67725 invoked by uid 500); 18 May 2006 22:14:43 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 67712 invoked by uid 99); 18 May 2006 22:14:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 May 2006 15:14:43 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=DNS_FROM_RFC_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of robertburrelldonkin@blueyonder.co.uk designates 195.188.213.8 as permitted sender) Received: from [195.188.213.8] (HELO smtp-out5.blueyonder.co.uk) (195.188.213.8) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 May 2006 15:14:42 -0700 Received: from [172.23.170.147] (helo=anti-virus03-10) by smtp-out5.blueyonder.co.uk with smtp (Exim 4.52) id 1FgqlB-0007nX-6r for commons-user@jakarta.apache.org; Thu, 18 May 2006 23:14:21 +0100 Received: from [82.38.65.173] (helo=knossos.elmet) by asmtp-out4.blueyonder.co.uk with esmtpa (Exim 4.52) id 1Fgql7-0004Dl-Bb for commons-user@jakarta.apache.org; Thu, 18 May 2006 23:14:17 +0100 Subject: Re: [betwixt] Betwixt mapping of generic lists with instances of an interface From: robert burrell donkin To: Jakarta Commons Users List In-Reply-To: <1147900889.4703.42.camel@knossos.elmet> References: <18230.1147350149@www099.gmx.net> <1147900889.4703.42.camel@knossos.elmet> Content-Type: text/plain Date: Thu, 18 May 2006 23:23:18 +0100 Message-Id: <1147990998.14154.2.camel@knossos.elmet> Mime-Version: 1.0 X-Mailer: Evolution 2.0.1-1mdk Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N i've committed a change in the default mapping for lists. please build from the latest code. i've updated the website with some documentation but it'll take a while to sync and you may be better looking at the unit tests. see src/test/org/apache/commons/betwixt/poly/TestPolyList.java. - robert On Wed, 2006-05-17 at 22:21 +0100, robert burrell donkin wrote: > On Thu, 2006-05-11 at 14:22 +0200, Holger Haag wrote: > > Hi all, > > > > I'm trying to figure out how (or if) it is possible to handle lists > > containing instances of an interface. > > > > Sample: > > > > // the interface > > public interface MyInterface { > > .. > > } > > > > // an implementation > > public class MyImpl1 implements MyInterface { > > .. > > } > > > > // an implementation > > public class MyImpl2 implements MyInterface { > > .. > > } > > > > // the list containing instances of MyInterface > > public class MyList extends java.util.List { > > .. > > } > > > > > > A serialized sample should look like the following > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I think this is currently not possible via betwixt (pls. correct me if I am > > wrong) > > since all list items will be named "myinterface" or so thus loosing the > > proper type information. > > > > > So the question boils down to how to setup polymorphic mapping for generic > > lists. > > http://jakarta.apache.org/commons/betwixt/guide/reading.html only details > > how to do this for a container, but nothing about lists/collections. > > there are two parts to this problem: the first is configuring > polymorphic mappings so that the reading works. the second is persuading > betwixt to write the right names. it's easiest to attack them > separately. > > the documentation should give a reasonable description about how to > setup the multi mapping so that the reading works. > > the second problem is covered in > http://jakarta.apache.org/commons/betwixt/guide/derived.html. you may > need to switch mapping derivation to introspection time. > > the only wrinkle is that it might be difficult to configure a list > (rather than a container). i'm not ATM whether this will be a problem or > not. i'll try to find time tomorrow to try this out. > > - robert > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org