You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Steven D. Wilkinson" <st...@acm.org> on 2001/07/26 06:05:20 UTC

Digester addObjectCreate

I have an object that takes an argument in the Constructor.  How do I do
this during an addObjectCreate call?

Re: Digester addObjectCreate

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 25 Jul 2001, Steven D. Wilkinson wrote:

> I have an object that takes an argument in the Constructor.  How do I do
> this during an addObjectCreate call?
> 

This issue was recently (well, yesterday :-) addressed in the version of
Digester that is included in the jakarta-commons project.

A new FactoryCreateRule (and corresponding addFactoryCreate() methods) was
added whereby you could register an object creation factory that would be
used to create the actual object to be pushed on to the stack.  And, the
factory's createObject() method is passed the attributes from the element
currently being digested -- so that it can, for example, use attribute
values to figure out what constructor to call.

Craig McClanahan