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

> 
> <Attachment missing>On Monday, August 20, 2001, at 07:31 PM, Jason van Zyl
> wrote:
> 
>> 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 :-)
> 
> here's a rule that should do what you need.
> you pass in the name of the xml-attribute and the bean name into the
> constructor.
> you'll need to repackage it to live somewhere local.

Thanks! Now I have another option :-)
 
> - robert
> 
> <Attachment missing>

-- 

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