struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Tibbetts <ttibbe...@ecmc.org>
Subject Re: Digester and Factory methods
Date Tue, 28 Aug 2001 14:54:04 GMT
Thanks Craig.  I did, in the meantime, just created my own rule that calls 
my factory method.  Not as elegant as what you're doing.  Thanks, again...Tom

At 05:05 PM 8/27/01 -0700, you wrote:


>On Fri, 24 Aug 2001, Tom Tibbetts wrote:
>
> > Date: Fri, 24 Aug 2001 09:52:30 -0500
> > From: Tom Tibbetts <ttibbetts@ecmc.org>
> > Reply-To: struts-user@jakarta.apache.org
> > To: struts-user@jakarta.apache.org
> > Subject: Digester and Factory methods
> >
> > Greetings.  I'm using the digester to read a poor-person's DB and am
> > wondering if there is a way for the digester to call my own factory methods
> > for creating objects instead of using the Digester's addCreateObject
> > method.  If there was a way of registering factory methods for object
> > creation, that would be way cool.  Thanks, Tom Tibbetts
> >
>
>The current development branch of Digester in the jakarta-commons project
>has just such a feature -- there is a new rule type called
>FactoryCreateRule, to which you pass an object that implements
>ObjectCreationFactory.  This works wonders, for example, when you need to
>instantiate an object that does not have a zero-args constructor, or where
>you *must* call an underlying factory method to create the thing, instead
>of Class.newInstance().
>
>Craig


Mime
View raw message