On Tue, 11 Mar 2003, Erik Price wrote:

> Date: Tue, 11 Mar 2003 11:28:14 -0500
> From: Erik Price <[EMAIL PROTECTED]>
> Reply-To: Jakarta Commons Users List <[EMAIL PROTECTED]>
> To: Jakarta Commons Users List <[EMAIL PROTECTED]>
> Subject: [digester] addSetNext call placement
>
> Does it matter where you place the call to the "addSetNext" method of a
> Digester instance, as long as it's before the "parse" method call?
>
> i.e.:
>
> Digester dig = new Digester();
> dig.push(this);
> dig....
> dig....
> dig....
> dig.addSetNext("some/pattern", "addFoo");
> dig.parse(file);
>
>
> is the same as:
>
> Digester dig = new Digester();
> dig.push(this);
> dig.adSetNext("some/pattern", "addFoo");
> dig....
> dig....
> dig....
> dig.parse(file);
>

Ordering only matters among rules with the same pattern String -- they are
executed in the order they were registered.  So, if you're creating the
foo object before using the set next rule, you will want to register the
object create rule first.

For example, my rulesets are full of things like:

  digester.addObjectCreate("some/pattern", "com.mycompany.MyFoo");
  digester.addSetProperties("some/pattern");
  digester.addSetNext("some/pattern", "addFoo");

The rules for different patterns can be added in any order.

>
> ?
>
>
> Thanks,
>
> Erik

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to