Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 83271 invoked from network); 27 Sep 2004 21:51:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Sep 2004 21:51:22 -0000 Received: (qmail 81049 invoked by uid 500); 27 Sep 2004 21:51:18 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 80844 invoked by uid 500); 27 Sep 2004 21:51:17 -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 80830 invoked by uid 99); 27 Sep 2004 21:51:17 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of robertburrelldonkin@blueyonder.co.uk designates 195.188.213.5 as permitted sender) Received: from [195.188.213.5] (HELO smtp-out2.blueyonder.co.uk) (195.188.213.5) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 27 Sep 2004 14:51:16 -0700 Received: from [10.0.0.2] ([82.38.65.173]) by smtp-out2.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Mon, 27 Sep 2004 22:51:38 +0100 Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <59114150-10CF-11D9-805E-003065DC754C@blueyonder.co.uk> Content-Transfer-Encoding: 7bit From: robert burrell donkin Subject: Re: [betwixt] Howto serialize the classname when writing XML Date: Mon, 27 Sep 2004 22:51:12 +0100 To: "Jakarta Commons Developers List" X-Mailer: Apple Mail (2.619) X-OriginalArrivalTime: 27 Sep 2004 21:51:38.0916 (UTC) FILETIME=[2AB01640:01C4A4DC] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 26 Sep 2004, at 18:59, Christoph Gaffga wrote: > hi, > > I have to output some Exception instances to XML using betwixt, but it > doesn't seem to be possible to get the class name into the XML result. yep. it's on the todo... > First of all it should output the name of the class only, and not > introspect > the whole Class type. This is done well because the type Class is > handled as > a primitive type (see > TypeBindingStrategy.Default.isStadardPrimitive(Class)). a concrete example would be useful (so i'm sure i understand you correctly)...? (i'm guessing that you want to map a com.example.SomeException class to xml which looks something like: Mysterious problem com.example.SomeException ) > But the output of the class name is deactivated in betwixt for whatever > reason and there is no configuration option for turning it on for some > classes, or plugging some custom rules in for that. that's true. this is related to the derived beans stuff i've been looking at recently. i should really add support for writing types (so that betwixt supports round tripping for simple attribute typed derived beans) so i'll probably take a look at coding this up sometime soonish. but it's important that i understand your use case so i make that i cover it. > I don't want to output the class property for all beans, I just want > to have it for > all beans derived from java.lang.Throwable. so, you'll need a coursely grained pluggable strategy. probably also want to be able to override in a betwixt file but that seem like it's a secondary priority. > Does anybody has a hint for me, where to start? I can't get the parent > bean > containing the property 'class' in configureProperty(..) method, only > PropertyDescriptor, that does not has a context. i'm happy to take a look at coding this up but i other pots on the boil right now so it might take a few days... - robert --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org