[Digester] clear named stack (API request?)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Digester] clear named stack (API request?)

Valerio
even if it so trivial to implement, why the following method:

public void clear(String stackname){
       while(!getDigester().isEmpty(stackName))
             getDigester.pop(stackName);
}

is not present in the digester APIs ?

can I contribute it to Digester ?
--
http://valerioschiavoni.blogspot.com
http://jroller.com/page/vschiavoni
Reply | Threaded
Open this post in threaded view
|

Re: [Digester] clear named stack (API request?)

Simon Kitching
On Wed, 2006-04-26 at 17:19 +0200, Valerio Schiavoni wrote:
> even if it so trivial to implement, why the following method:
>
> public void clear(String stackname){
>        while(!getDigester().isEmpty(stackName))
>              getDigester.pop(stackName);
> }
>
> is not present in the digester APIs ?

I don't see why clearing a single named stack would ever be needed.
Stuff goes on to stacks as rules fire "begin", and gets removed as rules
fire "end"; everything balances. Clearing a stack part-way through a
digestion is a rather odd concept.

Is there a particular scenario where this operation is needed?

Note that the method Digester.clear() will clear all sorts of stuff,
including all named stacks. This is never expected to be called *during*
a parse of course. Actually, it shouldn't *ever* be called, as described
in the javadoc, but it's there in case people want to live dangerously.


Regards,

Simon




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]