I need the factory method to be non-static. Any
reason why the code can't be changed as shown below?
I could first check for a static method, and then try
to find an instance method if necessary.
Gary
--- Thomas Dudziak <[EMAIL PROTECTED]> wrote:
> On Thu, 5 Feb 2004, Gary wrote:
>
> > Unfortunately, the factory class won't work until
> the
> > following change is made in RowReaderDefaultImpl:
> >
> > Change:
> > // 1. create an empty Object by calling the
> no-parms
> > factory method
> > result =
> >
>
targetClassDescriptor.getFactoryMethod().invoke(null,
> > null);
> >
> >
> > To:
> > // 1. create an empty Object by calling the
> no-parms
> > factory method
> > Object obj =
> >
>
targetClassDescriptor.getFactoryClass().newInstance();
> > result =
> >
> targetClassDescriptor.getFactoryMethod().invoke(obj,
> > null);
>
> I guess you missed the intention of factory-class.
> You specify a class
> (not necessarily the persistent class) which
> contains a no-arg static(!)
> method.
> Usually you would have a class MyObjectFactory that
> contains a static
> function:
>
> public static MyObject createMyObject()
> {
> // create a new object here and return it
> }
>
> Tom
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]