so using the XMLDecoder I want to create a factory class, initialize it,
and then call the newFoo method on it.
to make it easy, i'll read in everything that can be read and ignore
anything that isn't off the appropriate type.
So, if Foo is my class I want, and FooFactory is the factory.
<object id="theFactory" class="FooFactory">
<void property="bar">
<string>Hello</string>
</void>
</object>
<object idref="theFactory" method="newFoo" />
the second object being read in by the XMLDecoder is the FooFactory from
before, it's not even calling the newFoo method.
Any ideas?
Dave Mandelin - 21 Mar 2006 00:32 GMT
Try
<object id="theFactory" class="FooFactory">
<void property="bar">
<string>Hello</string>
</void>
<void id="theFoo" method="newFoo"/>
</object>
<object idref="theFoo"/>
I didn't find any good documentation, but I gather that if you put
<object idref="z"/> then the result of that element will definitely be
z, no matter what else is there.