commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rupesh Khandelwal <rupesh.khandel...@gmail.com>
Subject Re: [Digester] Trouble with digester logger
Date Wed, 13 Apr 2005 06:03:22 GMT
Hi Simon,

Thanks for your advice.

> The FactoryCreateRule allows user code to return objects which end up on
> the digester stack.
> 
> However Digester does not support the ability for invoking methods on
> objects already on the digester stack which return new objects to be
> manipulated. I guess you could write a custom Rule class to do this, but
> I can't see when this might be useful...

As per the requirements, I get an object initialized by parsing a XML
file say a.xml. And now some of the properties of this object need to
be overridden while parsing another XML file say b.xml. That's why
while parsing file b.xml I need previously initialized object on the
stack rather a new one. I can have method to return that object but
the problem is in how to push it onto the stack.

We have not opted for Factory classes as we have many such objects,
which will be initialized making use of two or more XML files.

A code snippet of a custom Rule class for pushing an object, which is
returned by a method, on to the stack, will be very helpful.

Thanks
Rupesh  


On 4/13/05, Simon Kitching <skitching@apache.org> wrote:
> On Mon, 2005-04-11 at 10:29 +0530, Rupesh Khandelwal wrote:
> > Hi All,
> >
> > I have recently started using digester, So far I have been able to make
> > things work, however I have certain questions in mind.
> >
> > 1. Even when I have registered only a fileAppender for digester
> > logger, digester is logging messages on the console also. Can I stop
> > that?
> 
> Digester logs sax-related messages to a category named
> "org.apache.commons.digester.Digester.sax" (as described in the javadoc
> package documentation), so you need to configure logging to control that
> category appropriately.
> 
> > 2. If certain method (being called from digester internally) returns
> > an object, how can I use this object for subsequent digester
> > operations. (Can this returned be even pushed on the top of the stack)
> 
> The FactoryCreateRule allows user code to return objects which end up on
> the digester stack.
> 
> However Digester does not support the ability for invoking methods on
> objects already on the digester stack which return new objects to be
> manipulated. I guess you could write a custom Rule class to do this, but
> I can't see when this might be useful...
> 
> Regards,
> 
> Simon
> 
>

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