commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Gaffga" <>
Subject [betwixt] Howto serialize the classname when writing XML
Date Sun, 26 Sep 2004 17:59:52 GMT

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

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:

// TODO: ignore class property ??
if ( Class.class.equals( type ) &&
        "class".equals( propertyDescriptor.getName() ) ) {
    log.trace( "Ignoring class property" );

and something similar in:

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.

Christoph Gaffga

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:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message