Hi Dimitry,
I think the following will achieve what you want:
digester.addCallMethod("menus/menu", "putClientProperty", 2);
digester.addObjectParam("menus/menu", 0, "parentId"); // pass constant
digester.addCallParam("menus/menu", 1, "parentId"); // pass value of attribute
By the way, I would recommend avoiding leading wildcards if you can (ie use
menus/menu rather than */menu).
Regards,
Simon
---- Dmitry Beransky <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm setting up rules for the following xml structure:
>
> <menus>
> <menu title="Edit" hotKey="E" parentId="parent1">...</menu>
> <menu title="View" hotKey="V">
> </menus>
>
> here's what I have so far:
>
> digester.addObjectCreate("menus", LinkedList.class);
> digester.addObjectCreate("*/menu", "javax.swing.JMenu", "class");
> digester.addSetProperties("*/menu", "title", "text");
> digester.addCallMethod("*/menu", "setMnemonic", 1, new
> Class[]{char.class});
> digester.addCallParam("*/menu", 0, "hotKey");
>
>
> I'm having problems with the parentId attribute for which I need to
> call putClientProperty("parentId", <id>) on the current menu object,
> where "parentId" is a string literal (property name), and <id> is the
> value of the parentId attribute of the <menu> element. Any thoughts
> on how to do this?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]