You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Valerio Schiavoni <va...@gmail.com> on 2006/04/26 17:19:40 UTC
[Digester] clear named stack (API request?)
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
Re: [Digester] clear named stack (API request?)
Posted by Simon Kitching <sk...@apache.org>.
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: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org