Yes and no. Afaik, there's a feature with Castor's Unmarshaller where you 
control whether Castor actually instantiates instances of DvConfdig or not. Let 
me just have a look, and I'll be back with (hopefully) a more educated opinion.

Werner

> -----Ursprüngliche Nachricht-----
> Von: Saladin Sharif [mailto:[EMAIL PROTECTED]
> Gesendet: Donnerstag, 05. April 2007 23:16
> An: [email protected]
> Betreff: [castor-user] Castor unmarshalling & Spring factory bean
> 
> 
> Hi,
> I am using Castor with Spring in my project.  I am
> currently faced with a problem in that I have a
> particular Java bean that I am unmarshall to using
> Castor.  So Castor is instantiating that java bean and
> unmarshalling xml data to that java bean.
> 
> But the problem is that I also want to load to that
> Java object certain properties from the spring xml
> file using the spring FactoryBean.  For example, I
> want to unmarshall to dvConfig, using Castor and a
> castor xml mapping file; so I have the following in my
> spring xml file
> 
> <bean id="resolver"
> class="org.springframework.xml.castor.CastorResolverFactoryBean">
>   <property name="mappingLocations">
>     <list>
>       <value>castor-mapping.xml</value>
>     </list>
>   </property>
> </bean>
> 
> <bean id="unmarshaller"
> class="org.springframework.xml.castor.CastorUnmarshallerFactoryBean">
>   <property name="resolver" ref="resolver"/>
> </bean>
> 
> 
> And at the same time, I also want to load certain
> properties to the dvConfig object using spring factory
> bean, like so
> 
> <bean id="dvConfig"
> class="com.nget.japps.model.dv.dvConfig" >
>   <property name="someJavaBean" ref="javaBean" />
>   <property name="filePathProperties">
>     <map>
>       <entry key="file.path.script"
> value="/scripts/run_dv_script.ksh"/>
>       <entry key="file.path.input"
> value="/data/dvInput.dat"/>
>       <entry key="file.path.output"
> value="/data/dvOutput.dat"/>
>     </map>
>   </property>
> </bean>
> 
> 
> But the problem is that if Castor is instantiating the
> dvConfig and unmarshalling to it, then that means that
> I wont be able to load that object using the spring
> factory bean, because it was already instantiated by
> Castor.  Is there a way around this dilema?
> 
> -Saladin
> 
> 
> **********************************************************
> * Saladin Sharif
> * e-mail:  [EMAIL PROTECTED]
> * Visit homepage @ http://gaia.ecs.csus.edu/~sharifs
> **********************************************************
> 
> 
> 
> __________________________________________________________________________
> __________
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo!
> Games.
> http://videogames.yahoo.com/platform?platform=120121
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to