On 8/20/01 2:24 PM, "robert burrell donkin" <[EMAIL PROTECTED]> wrote:

> On Monday, August 20, 2001, at 06:37 PM, Craig R. McClanahan wrote:
> 
>> On Mon, 20 Aug 2001, robert burrell donkin wrote:
> 
> <snip>
> 
>>> the good thing is that digester is extensible and one easy way round this
>>> problem would be to create a rule that allowed a property with a
>>> different
>>> name (from the attribute) to be set. if this is what you need, i can easy
>>> and quickly produce a new rule to do just this.
>>> 
>> 
>> Actually, you don't even need a new rule -- just a BeanInfo class for your
>> bean that does the appropriate mapping.  BeanUtils (which is used
>> underneath) follows standard Java introspection mechanisms - it does not
>> assume that the setter for method foo is always named setFoo().
>> 
> 
> i assumed that jason (hopefully he'll will correct me if i'm wrong) was
> trying to set - say - the 'rubbish' property from the 'trash' attribute.
> (this is reasonably common for xml->object mapping since xml-attributes
> and java method names have different naming rules.)

Yes, you've got it right :-) In my case I am trying to use the 'cvsdir'
property with the 'dir' attribute, and the 'hostprefix' property with the
'host-prefix' attribute. There are a couple others, these eventually might
map better but I am trying to get my java version of gump working without
altering the gump descriptors as they are in there current form.

I'm interested in getting to know the digester more, but I'd settle for rule
that did the trick right now :-)
 
> if there is a neat way to do this mapping using beanutils without write
> new code then that'd be cool (any chance of a pointer?) but otherwise i'm
> pretty keen to create a rule (or modify an existing rule, if that's better)
> since i'm going to run into the same problem pretty soon.
> 
> - robert

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons


Reply via email to