commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan <crum...@gmail.com>
Subject [betwixt] Reading and writing objects without using getters/setters
Date Wed, 30 Aug 2006 23:01:02 GMT
I would like to use betwixt to read and write objects from a 3rd party
java library. Unfortunately the naming conventions used in some of
these objects don't conform to the getter/setter properties that
betwixt likes. Here are a few of the problems I need to address:

1. There is a class called Money which is backed by a BigDecimal that
is accessible using the method asBigDecimal(). The object can be
recreated using new Money(oldMoney.asBigDecimal()). Is there a way to
tell betwixt/digestor to do the conversion by using that conversion to
BigDecimal?

2. The setter methods on each of the objects return themselves instead
of void. This appears to cause betwixt to believe the properties are
readable but not writable. It looks like I can subclass
XMLIntrospector so that I can modify the BeanInfo object before it is
cached so that it knows about the writer methods, is this the best way
to go about it?


Ryan

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message