On Fri, 2005-12-30 at 14:41 +0100, Dimitri Frederickx wrote:
> <td class="command">open</td>
> <td class="target">./tests/html/test_open.html</td>
>
>
> I want that the value of the class-attribute maps to the property (and
> method name), and the value of the tag must be the value to pass to this
> method.
>
> Is there a way to do this with digester? Does anyone has done something like
> this? It would help me a lot, because I'm really stuck at this moment.
I don't believe there is an existing rule that does exactly what you
want, but you should be able to create your own rule to achieve your
goal. I would suggest starting with BeanPropertySetterRule, then
modifying the begin method so that it saves away the target property
name in a member variable for later use. Using member variables like
that isn't actually a good idea in general (doesn't work when rules are
nested) but in this case it's fine as this rule won't be nested.
Don't be concerned about creating your own rule; that's not unusual, nor
particularly difficult.
Once you've got your custom rule class, just add it do digester like:
digester.addRule("tbody/tr/td", new MyNewRule());
Regards,
Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]