Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 78153 invoked from network); 26 Sep 2004 19:41:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Sep 2004 19:41:46 -0000 Received: (qmail 86656 invoked by uid 500); 26 Sep 2004 19:41:44 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 86394 invoked by uid 500); 26 Sep 2004 19:41:42 -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 88218 invoked by uid 99); 26 Sep 2004 14:59:41 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Message-ID: <018c01c4a3d9$6ac5dfc0$7401a8c0@mawu> From: "Christoph Gaffga \(triplemind.com\)" To: "Jakarta Commons Developers List" Cc: "Development" Subject: [betwixt] Howto serialize the classname when writing XML Date: Sun, 26 Sep 2004 16:59:25 +0200 Organization: Triplemind Internet Services OHG MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Triplemind-Filter: procmail-filter applied X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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. 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)). 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. I found the following code that omits outputting the class property: org.apache.commons.betwixt.digester.ElementRule:260 // TODO: ignore class property ?? if ( Class.class.equals( type ) && "class".equals( propertyDescriptor.getName() ) ) { log.trace( "Ignoring class property" ); return; } and something similar in: org.apache.commons.betwixt.digester.AttributeRule:190 org.apache.commons.betwixt.BeanProperty:172 Has somebody any idea how to fix this. I'm don't know much about betwixt to figure out how to implement a configuration option for this. And, 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. 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. Any help would be apreciated. regards Christoph Gaffga cgaffga@triplemind.com P.S.: I also just posted a patch to handle throwable, exceptions and errors as complex types. Hope it would find it's way into betwixt, see: http://issues.apache.org/bugzilla/show_bug.cgi?id=31425 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org