Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 51583 invoked from network); 6 Aug 2004 10:55:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Aug 2004 10:55:30 -0000 Received: (qmail 15550 invoked by uid 500); 6 Aug 2004 10:55:27 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 15499 invoked by uid 500); 6 Aug 2004 10:55:26 -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 15486 invoked by uid 99); 6 Aug 2004 10:55:26 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [193.109.254.243] (HELO mail39.messagelabs.com) (193.109.254.243) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 06 Aug 2004 03:55:23 -0700 X-VirusChecked: Checked X-Env-Sender: andrew.gray@defra.gsi.gov.uk X-Msg-Ref: server-23.tower-39.messagelabs.com!1091789720!3475799 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [212.137.57.25] Received: (qmail 319 invoked from network); 6 Aug 2004 10:55:20 -0000 Received: from gateway101.gsi.gov.uk (HELO mail9.gsi.gov.uk) (212.137.57.25) by server-23.tower-39.messagelabs.com with SMTP; 6 Aug 2004 10:55:20 -0000 Received: from mailgw2.mceu.gsi.gov.uk ([51.64.35.210] helo=gsimail3.defra.gsi.gov.uk) by mail9.gsi.gov.uk with smtp id 1Bt2Nc-00050u-6u for commons-dev@jakarta.apache.org; Fri, 06 Aug 2004 11:55:20 +0100 Received: from SMTP agent by mail gateway Fri, 06 Aug 2004 11:20:07 -0000 Received: from gb093xi.maff.gov.uk (unverified) by gsimail3.defra.gsi.gov.uk (Content Technologies SMTPRS 4.3.12) with ESMTP id ; Fri, 6 Aug 2004 11:55:19 +0100 Received: by gb093xi.maff.gov.uk with Internet Mail Service (5.5.2653.19) id <36FWQX6B>; Fri, 6 Aug 2004 11:55:19 +0100 Message-ID: From: "Gray, Andrew (ITDA)" To: 'Jakarta Commons Developers List' , "'robertburrelldonkin@blueyonder.co.uk'" Subject: RE: betwixt files doesn't work with inherited Interfaces Date: Fri, 6 Aug 2004 11:55:15 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C47BA3.DAAFDA60" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N ------_=_NextPart_000_01C47BA3.DAAFDA60 Content-Type: text/plain; charset="iso-8859-1" Hi Robert, Not sure what you mean by a normalizer, but the other part is certainly correct - I need the introspecter to discover methods declared in the superinterfaces. I've attached the files I edited to provide me with an immediate workaround (afraid firewall prevents CVS access, so patch files not easy) I've not tried this with an abstract class but I think it should be OK Not sure if this is the best place to apply a fix in the longer term - overall architecture is still a bit daunting. I'm mainly interested in unmarshalling XML into objects and an happy to have .betwixt files dotted about the place so it works for me. I also inferred that when marshalling java into XML there would be object instances to play with which must have come from non-abstract classes and in that case the Introspector would work as expected. - (untill some show-off is using the Proxy API but they should expect trouble) -----Original Message----- From: robert burrell donkin [mailto:robertburrelldonkin@blueyonder.co.uk] Sent: 05 August 2004 21:46 To: Jakarta Commons Developers List Subject: Re: betwixt files doesn't work with inherited Interfaces hi andrew i'm a little intrigued by this problem and i'll take a look at adding a solution but i'm not likely to be able to have anything ready tonight. just to check i've parsed you correctly, you're using a normalizer and the introspection needs to pick up the methods on the super-interfaces for the given interface, right? (unfortunately, you'll have to roll your own jar since it'll be too late to go into the upcoming 0.6 release.) - robert On 5 Aug 2004, at 16:26, Gray, Andrew (ITDA) wrote: > Hi, > > After some digging I've hit a "limitation" - ultimately due (IMHO) to > java.beans.Introspector - if you introspect an interface you don't get > deatils on anything defined in super interfaces (I'm using jdk > 1.4.2.02) > > > All of my javaBean structures are defined by interfaces with the > implementation classes being context specific. > > > public interface Person { > String getName(); > void setName(String name); > } > > public interface Developer extends Person { > int getHackCount(); > void setHackCount(int hacks); > Pet getPet(); > void setPet(Pet pet);} > > public interface Pet { > ... > } > public interface DevTeam { > Collection getDevelopers(); > void addDeveloper(Developer dev); > } > > add some .betwixt files telling the parser what mplementations to use > DevTeam.betwixt: - > ... > > ... > > and Developer.betwixt: - > ... > > > ... > etc. > > Now I come to unmarshall the following snippet in a xml doc. > ... > > > Joe Blo > 32 > ... > > > ... > > Trying to get betwixt to parse a Developer is failing as the > Introspection > API is not telling it about the name property defined in Person > superinterface. > > Defining specific elements is no better. There is no WriteMethod > returned > from the introspector so no Digester rule is created to parse "name" > and it > ends up null. > > > Thoughts appreciated. > Will DynaBeans get round this? > Does anyone know if Sun will "fix" the introspector? > Is there a preferred workaround / approach if they won't (soon)? > > (I don't want to redifine things in subclasses already in superclasses) > > regards > > Andy Gray > > > > Department for Environment, Food and Rural Affairs (Defra) > > This email and any attachments is intended for the named recipient > only. Its > unauthorised use, disclosure, storage or copying is not permitted. If > you have > received it in error, please destroy all copies and inform the sender. > Whilst this > email and associated attachments will have been checked for known > viruses > whilst within Defra systems we can accept no responsibility once it > has left our > systems. Communications on Defra's computer systems may be monitored > and/or recorded to secure the effective operation of the system and > for other > lawful purposes. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org ------_=_NextPart_000_01C47BA3.DAAFDA60 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org ------_=_NextPart_000_01C47BA3.DAAFDA60--