Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 98527 invoked from network); 3 Jun 2004 17:45:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Jun 2004 17:45:48 -0000 Received: (qmail 90127 invoked by uid 500); 3 Jun 2004 17:45:41 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 90053 invoked by uid 500); 3 Jun 2004 17:45:40 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 89947 invoked by uid 99); 3 Jun 2004 17:45:38 -0000 Received: from [195.228.242.225] (HELO fmx5.freemail.hu) (195.228.242.225) by apache.org (qpsmtpd/0.27.1) with SMTP; Thu, 03 Jun 2004 10:45:38 -0700 Received: (qmail 77308 invoked from network); 3 Jun 2004 19:45:13 +0200 Received: from fm10.freemail.hu (195.228.242.210) by fmx5.freemail.hu with SMTP; 3 Jun 2004 19:45:13 +0200 Received: (qmail 8882 invoked by uid 5870165); 3 Jun 2004 19:45:11 +0200 Date: Thu, 3 Jun 2004 19:45:11 +0200 (CEST) From: Sandor Murakozi Subject: [betwixt] Using interfaces as property types/ in collections To: commons-dev@jakarta.apache.org Message-ID: X-Originating-IP: [213.253.202.190] X-HTTP-User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.7b) Gecko/20040421 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-2 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi all, We use betwixt in our project, but we found a problem which we couldn't solve with the actual implementation: When a property is an interface type then the actual class of the property instance is not saved to the xml -> when I read it back the reader won't be able to instantiate it. The same problem occurs if want a collection of interfaces. I've checked the docs and the mailing lists, and seen that some other guys has the same problem. I have 2 questions: 1. Is this problem already solved somehow? If it is, how? 2. If it isn't I have a proposal: As a workaround I've implemented a subclass of XMLIntrospector that saves the actual class as a property of the element. A BeanCreator is able to create instances from this representation, so if you add it to the bean creator chain it solves both problems. The functionality is working, but it still lacks some polishing and documenting. If you are interested in it I can finish it, and contribute it to the project. The only ugly thing that my introspector contains a big copy pasted method from the original one, so some refactoring would be desirable in both classes. Should I work on it and send a patch with the finished version? Thanks, don --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org