commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Lukas" <rlu...@cadence.com>
Subject RE: [digester] Re: Trigger method call on an end Tag
Date Fri, 21 Feb 2003 17:59:58 GMT
Thanks Robert..

Ah I see.. Okay that seems pretty good. I am going to try this. I will
let you know what happens.. 
Thanks for helping me out. If (when) I get this working I will post the
solution for everyone to use if they need it.. 
Ray lukas


-----Original Message-----
From: robert burrell donkin
[mailto:robertburrelldonkin@blueyonder.co.uk] 
Sent: Friday, February 21, 2003 12:42 PM
To: Jakarta Commons Users List
Subject: [digester] Re: Trigger method call on an end Tag

hi Raymond

please remember to add a prefix containing the component.

i'd say that the easiest way to do this quickly is for you to create a
new 
Rule subclass which overrides the Rule implementation of end(String, 
String, String) to make your method call.

for example, something like (untested psuado-code)

digester.addRule("*/List", new Rule {
					public end(String namespace,
String name) {
							// make that
method call!
							...
						}
				})

hope this helps.

- robert

On Friday, February 21, 2003, at 04:28 PM, Raymond Lukas wrote:

> Please if someone could give me a hand. How do I trigger a method call
> when I hit the </Tag>.. In the small example below I am looking to
nest
> List elements in a document generation system. If I could just detect
> and trigger a method call on the </List> I would be all set. I read
the
> manual but it did not help me out enough. An example on the other hand
> would be GREAT!! This is an important project and I really need
someone
> to take a few minutes and post an example or a pointer to an
example...
>
>
>
>
>
>
>
> I need to handle nesting element inside of my XML file.. Something
like
> this:
>
>       <HeaderLevel1 headerName = "Diva DRC">
>
>             <List type = "numbered">
>
>                   <Entry name="OutterA">
>
>                         <List type = "dotted">
>
>                               <Entry name=" InnerA ">
>
>                               </Entry>
>
>                               <Entry name=" InnerB ">
>
>                               </Entry>
>
>                         </List>
>
>                   </Entry>
>
>                   <Entry name="Outter">
>
>                         <List type = "dotted">
>
>                               <Entry name="InnerA">
>
>                               </Entry>
>
>                               <Entry name="InnerB">
>
>                               </Entry>
>
>
>
>                         </List>
>
>                   </Entry>
>
>             </List>
>
>       </HeaderLevel1>
>
>
>
>
>
> Inside of my Digest setup I have something like this. Well exactly
like
> this. Everything is call fine, I just need to know when I am at the
end
> of each List Element..
>
>
>
>         Class listClass = ListElement.class;
>
>         digester.addObjectCreate("*/List", listClass);
>
>         digester.addSetProperties("*/List");
>
>         //digester.addCallMethod("Section/HeaderLevel1/List/Entry",
> "addInnerListEntry");
>
>
>
>         //      --------------------------------------
>
>          Class entryClass = Entry.class;
>
>          digester.addObjectCreate("*/List/Entry", entryClass);
>
>          digester.addSetProperties("*/List/Entry");
>
>          digester.addSetNext("*/List/Entry", "addEntry");
>


---------------------------------------------------------------------
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